Dockerfile
This commit is contained in:
102
model/dto/data/api_interface_dto.go
Normal file
102
model/dto/data/api_interface_dto.go
Normal file
@@ -0,0 +1,102 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"cid/consts/data"
|
||||
entity "cid/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApiInterfaceReq 创建接口请求
|
||||
type CreateApiInterfaceReq struct {
|
||||
g.Meta `path:"/createApiInterface" method:"post" tags:"接口管理" summary:"创建接口" dc:"创建新的数据接口"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"所属平台ID"`
|
||||
Name string `json:"name" v:"required" dc:"接口名称"`
|
||||
Code string `json:"code" v:"required" dc:"接口编码"`
|
||||
Url string `json:"url" v:"required" dc:"接口地址"`
|
||||
Method data.ApiMethod `json:"method" v:"required" dc:"请求方法"`
|
||||
Status data.PlatformStatus `json:"status" dc:"接口状态" d:"active"`
|
||||
AuthType string `json:"authType" dc:"认证类型"`
|
||||
RequestConfig map[string]interface{} `json:"requestConfig" dc:"请求配置"`
|
||||
ResponseConfig map[string]interface{} `json:"responseConfig" dc:"响应配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"接口独立限流配置"`
|
||||
}
|
||||
|
||||
// CreateApiInterfaceRes 创建接口响应
|
||||
type CreateApiInterfaceRes struct {
|
||||
Id int64 `json:"id" dc:"接口ID"`
|
||||
}
|
||||
|
||||
// ListApiInterfaceReq 获取接口列表请求
|
||||
type ListApiInterfaceReq struct {
|
||||
g.Meta `path:"/listApiInterfaces" method:"get" tags:"接口管理" summary:"获取接口列表" dc:"分页查询接口列表"`
|
||||
*beans.Page
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
Name string `json:"name" dc:"接口名称"`
|
||||
Code string `json:"code" dc:"接口编码"`
|
||||
Method data.ApiMethod `json:"method" dc:"请求方法"`
|
||||
Status data.PlatformStatus `json:"status" dc:"接口状态"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索名称或编码)"`
|
||||
}
|
||||
|
||||
// ListApiInterfaceRes 获取接口列表响应
|
||||
type ListApiInterfaceRes struct {
|
||||
List []ApiInterfaceItem `json:"list" dc:"接口列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type ApiInterfaceItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
PlatformId int64 `json:"platformId"`
|
||||
PlatformName string `json:"platformName"`
|
||||
Name string `json:"name"`
|
||||
Code string `json:"code"`
|
||||
Url string `json:"url"`
|
||||
Method data.ApiMethod `json:"method"`
|
||||
Status data.PlatformStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetApiInterfaceReq 获取接口详情请求
|
||||
type GetApiInterfaceReq struct {
|
||||
g.Meta `path:"/getApiInterface" method:"get" tags:"接口管理" summary:"获取接口详情" dc:"获取接口详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
}
|
||||
|
||||
// GetApiInterfaceRes 获取接口详情响应
|
||||
type GetApiInterfaceRes struct {
|
||||
*entity.ApiInterface
|
||||
PlatformName string `json:"platformName,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateApiInterfaceReq 更新接口请求
|
||||
type UpdateApiInterfaceReq struct {
|
||||
g.Meta `path:"/updateApiInterface" method:"put" tags:"接口管理" summary:"更新接口" dc:"更新接口信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
PlatformId int64 `json:"platformId" dc:"所属平台ID"`
|
||||
Name string `json:"name" dc:"接口名称"`
|
||||
Code string `json:"code" dc:"接口编码"`
|
||||
Url string `json:"url" dc:"接口地址"`
|
||||
Method data.ApiMethod `json:"method" dc:"请求方法"`
|
||||
Status data.PlatformStatus `json:"status,omitempty" dc:"接口状态"`
|
||||
AuthType string `json:"authType" dc:"认证类型"`
|
||||
RequestConfig map[string]interface{} `json:"requestConfig" dc:"请求配置"`
|
||||
ResponseConfig map[string]interface{} `json:"responseConfig" dc:"响应配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"接口独立限流配置"`
|
||||
}
|
||||
|
||||
// DeleteApiInterfaceReq 删除接口请求
|
||||
type DeleteApiInterfaceReq struct {
|
||||
g.Meta `path:"/deleteApiInterface" method:"delete" tags:"接口管理" summary:"删除接口" dc:"删除接口"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
}
|
||||
|
||||
// UpdateApiInterfaceStatusReq 更新接口状态请求
|
||||
type UpdateApiInterfaceStatusReq struct {
|
||||
g.Meta `path:"/updateApiInterfaceStatus" method:"put" tags:"接口管理" summary:"更新接口状态" dc:"更新接口状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"接口ID"`
|
||||
Status data.PlatformStatus `json:"status" v:"required|in:active,inactive" dc:"状态:active启用/inactive停用"`
|
||||
}
|
||||
99
model/dto/data/data_fetch_dto.go
Normal file
99
model/dto/data/data_fetch_dto.go
Normal file
@@ -0,0 +1,99 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"cid/consts/data"
|
||||
entity "cid/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// ExecuteDataFetchReq 执行数据获取请求
|
||||
type ExecuteDataFetchReq struct {
|
||||
g.Meta `path:"/executeDataFetch" method:"post" tags:"数据获取" summary:"执行数据获取" dc:"执行接口数据获取"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
RequestParams map[string]interface{} `json:"requestParams" dc:"请求参数"`
|
||||
}
|
||||
|
||||
// ExecuteDataFetchRes 执行数据获取响应
|
||||
type ExecuteDataFetchRes struct {
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
Message string `json:"message" dc:"消息"`
|
||||
}
|
||||
|
||||
// ListDataFetchLogReq 获取数据获取日志列表请求
|
||||
type ListDataFetchLogReq struct {
|
||||
g.Meta `path:"/listDataFetchLogs" method:"get" tags:"数据获取" summary:"获取数据获取日志" dc:"分页查询数据获取日志"`
|
||||
*beans.Page
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" dc:"接口ID"`
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Status data.FetchStatus `json:"status" dc:"执行状态"`
|
||||
StartTime int64 `json:"startTime" dc:"开始时间(时间戳)"`
|
||||
EndTime int64 `json:"endTime" dc:"结束时间(时间戳)"`
|
||||
}
|
||||
|
||||
// ListDataFetchLogRes 获取数据获取日志列表响应
|
||||
type ListDataFetchLogRes struct {
|
||||
List []DataFetchLogItem `json:"list" dc:"日志列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type DataFetchLogItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
PlatformId int64 `json:"platformId"`
|
||||
PlatformName string `json:"platformName"`
|
||||
InterfaceId int64 `json:"interfaceId"`
|
||||
InterfaceName string `json:"interfaceName"`
|
||||
RequestId string `json:"requestId"`
|
||||
Status data.FetchStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
StartTime int64 `json:"startTime"`
|
||||
EndTime int64 `json:"endTime"`
|
||||
Duration int `json:"duration"`
|
||||
ErrorMessage string `json:"errorMessage"`
|
||||
RetryCount int `json:"retryCount"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
}
|
||||
|
||||
// GetDataFetchLogReq 获取数据获取日志详情请求
|
||||
type GetDataFetchLogReq struct {
|
||||
g.Meta `path:"/getDataFetchLog" method:"get" tags:"数据获取" summary:"获取数据获取日志详情" dc:"获取数据获取日志详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"日志ID"`
|
||||
}
|
||||
|
||||
// GetDataFetchLogRes 获取数据获取日志详情响应
|
||||
type GetDataFetchLogRes struct {
|
||||
*entity.DataFetchLog
|
||||
PlatformName string `json:"platformName,omitempty"`
|
||||
InterfaceName string `json:"interfaceName,omitempty"`
|
||||
}
|
||||
|
||||
// BatchExecuteDataFetchReq 批量执行数据获取请求
|
||||
type BatchExecuteDataFetchReq struct {
|
||||
g.Meta `path:"/batchExecuteDataFetch" method:"post" tags:"数据获取" summary:"批量执行数据获取" dc:"批量执行接口数据获取"`
|
||||
InterfaceIds []int64 `json:"interfaceIds" v:"required" dc:"接口ID列表"`
|
||||
RequestParams map[string]interface{} `json:"requestParams" dc:"请求参数(所有接口共用)"`
|
||||
}
|
||||
|
||||
// BatchExecuteDataFetchRes 批量执行数据获取响应
|
||||
type BatchExecuteDataFetchRes struct {
|
||||
SuccessCount int `json:"successCount" dc:"成功数量"`
|
||||
FailedCount int `json:"failedCount" dc:"失败数量"`
|
||||
RequestIds []string `json:"requestIds" dc:"请求ID列表"`
|
||||
}
|
||||
|
||||
// ReExecuteDataFetchReq 重新执行数据获取请求
|
||||
type ReExecuteDataFetchReq struct {
|
||||
g.Meta `path:"/reExecuteDataFetch" method:"post" tags:"数据获取" summary:"重新执行数据获取" dc:"重新执行失败的数据获取"`
|
||||
LogId int64 `json:"logId" v:"required" dc:"日志ID"`
|
||||
}
|
||||
|
||||
// ReExecuteDataFetchRes 重新执行数据获取响应
|
||||
type ReExecuteDataFetchRes struct {
|
||||
RequestId string `json:"requestId" dc:"请求ID"`
|
||||
Status string `json:"status" dc:"状态"`
|
||||
Message string `json:"message" dc:"消息"`
|
||||
}
|
||||
91
model/dto/data/platform_dto.go
Normal file
91
model/dto/data/platform_dto.go
Normal file
@@ -0,0 +1,91 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
"cid/consts/data"
|
||||
entity "cid/model/entity/data"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreatePlatformReq 创建平台请求
|
||||
type CreatePlatformReq struct {
|
||||
g.Meta `path:"/createPlatform" method:"post" tags:"平台管理" summary:"创建平台" dc:"创建新的数据源平台"`
|
||||
Name string `json:"name" v:"required" dc:"平台名称"`
|
||||
Type data.SyncPlatform `json:"type" v:"required" dc:"平台类型"`
|
||||
Status data.PlatformStatus `json:"status" dc:"平台状态" d:"active"`
|
||||
Description string `json:"description" dc:"平台描述"`
|
||||
AuthConfig map[string]interface{} `json:"authConfig" dc:"认证配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
PlatformConfig map[string]interface{} `json:"platformConfig" dc:"平台专用配置"`
|
||||
}
|
||||
|
||||
// CreatePlatformRes 创建平台响应
|
||||
type CreatePlatformRes struct {
|
||||
Id int64 `json:"id" dc:"平台ID"`
|
||||
}
|
||||
|
||||
// ListPlatformReq 获取平台列表请求
|
||||
type ListPlatformReq struct {
|
||||
g.Meta `path:"/listPlatforms" method:"get" tags:"平台管理" summary:"获取平台列表" dc:"分页查询平台列表"`
|
||||
*beans.Page
|
||||
Name string `json:"name" dc:"平台名称"`
|
||||
Type data.SyncPlatform `json:"type" dc:"平台类型"`
|
||||
Status data.PlatformStatus `json:"status" dc:"平台状态"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索平台名称)"`
|
||||
}
|
||||
|
||||
// ListPlatformRes 获取平台列表响应
|
||||
type ListPlatformRes struct {
|
||||
List []PlatformItem `json:"list" dc:"平台列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type PlatformItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
Name string `json:"name"`
|
||||
Type data.SyncPlatform `json:"type"`
|
||||
TypeName string `json:"typeName"`
|
||||
Status data.PlatformStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Description string `json:"description"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetPlatformReq 获取平台详情请求
|
||||
type GetPlatformReq struct {
|
||||
g.Meta `path:"/getPlatform" method:"get" tags:"平台管理" summary:"获取平台详情" dc:"获取平台详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
}
|
||||
|
||||
// GetPlatformRes 获取平台详情响应
|
||||
type GetPlatformRes struct {
|
||||
*entity.Platform
|
||||
}
|
||||
|
||||
// UpdatePlatformReq 更新平台请求
|
||||
type UpdatePlatformReq struct {
|
||||
g.Meta `path:"/updatePlatform" method:"put" tags:"平台管理" summary:"更新平台" dc:"更新平台信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
Name string `json:"name" dc:"平台名称"`
|
||||
Type data.SyncPlatform `json:"type" dc:"平台类型"`
|
||||
Status data.PlatformStatus `json:"status,omitempty" dc:"平台状态"`
|
||||
Description string `json:"description" dc:"平台描述"`
|
||||
AuthConfig map[string]interface{} `json:"authConfig" dc:"认证配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
PlatformConfig map[string]interface{} `json:"platformConfig" dc:"平台专用配置"`
|
||||
}
|
||||
|
||||
// DeletePlatformReq 删除平台请求
|
||||
type DeletePlatformReq struct {
|
||||
g.Meta `path:"/deletePlatform" method:"delete" tags:"平台管理" summary:"删除平台" dc:"删除平台"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
}
|
||||
|
||||
// UpdatePlatformStatusReq 更新平台状态请求
|
||||
type UpdatePlatformStatusReq struct {
|
||||
g.Meta `path:"/updatePlatformStatus" method:"put" tags:"平台管理" summary:"更新平台状态" dc:"更新平台状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"平台ID"`
|
||||
Status data.PlatformStatus `json:"status" v:"required|in:active,inactive" dc:"状态:active启用/inactive停用"`
|
||||
}
|
||||
Reference in New Issue
Block a user