去掉无用代码
This commit is contained in:
@@ -1,95 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
"cid/consts/app"
|
||||
entity "cid/model/entity/app"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateApplicationReq 创建应用请求
|
||||
type CreateApplicationReq struct {
|
||||
g.Meta `path:"/createApplication" method:"post" tags:"应用管理" summary:"创建应用" dc:"创建新的应用"`
|
||||
Name string `json:"name" v:"required" dc:"应用名称"`
|
||||
AppCode string `json:"appCode" v:"required" dc:"应用编码(唯一标识)"`
|
||||
Type app.AppType `json:"type" v:"required" dc:"应用类型"`
|
||||
Status app.AppStatus `json:"status" dc:"应用状态" d:"active"`
|
||||
Description string `json:"description" dc:"应用描述"`
|
||||
AccessConfig map[string]interface{} `json:"accessConfig" dc:"接入配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
CallbackConfig map[string]interface{} `json:"callbackConfig" dc:"回调配置"`
|
||||
}
|
||||
|
||||
// CreateApplicationRes 创建应用响应
|
||||
type CreateApplicationRes struct {
|
||||
Id int64 `json:"id" dc:"应用ID"`
|
||||
}
|
||||
|
||||
// ListApplicationReq 获取应用列表请求
|
||||
type ListApplicationReq struct {
|
||||
g.Meta `path:"/listApplications" method:"get" tags:"应用管理" summary:"获取应用列表" dc:"分页查询应用列表"`
|
||||
*beans.Page
|
||||
Name string `json:"name" dc:"应用名称"`
|
||||
AppCode string `json:"appCode" dc:"应用编码"`
|
||||
Type app.AppType `json:"type" dc:"应用类型"`
|
||||
Status app.AppStatus `json:"status" dc:"应用状态"`
|
||||
Keyword string `json:"keyword" dc:"关键字(搜索应用名称或编码)"`
|
||||
}
|
||||
|
||||
// ListApplicationRes 获取应用列表响应
|
||||
type ListApplicationRes struct {
|
||||
List []ApplicationItem `json:"list" dc:"应用列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type ApplicationItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
Name string `json:"name"`
|
||||
AppCode string `json:"appCode"`
|
||||
Type app.AppType `json:"type"`
|
||||
TypeName string `json:"typeName"`
|
||||
Status app.AppStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
Description string `json:"description"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetApplicationReq 获取应用详情请求
|
||||
type GetApplicationReq struct {
|
||||
g.Meta `path:"/getApplication" method:"get" tags:"应用管理" summary:"获取应用详情" dc:"获取应用详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
}
|
||||
|
||||
// GetApplicationRes 获取应用详情响应
|
||||
type GetApplicationRes struct {
|
||||
*entity.Application
|
||||
}
|
||||
|
||||
// UpdateApplicationReq 更新应用请求
|
||||
type UpdateApplicationReq struct {
|
||||
g.Meta `path:"/updateApplication" method:"put" tags:"应用管理" summary:"更新应用" dc:"更新应用信息"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
Name string `json:"name" dc:"应用名称"`
|
||||
AppCode string `json:"appCode" dc:"应用编码"`
|
||||
Type app.AppType `json:"type" dc:"应用类型"`
|
||||
Status app.AppStatus `json:"status,omitempty" dc:"应用状态"`
|
||||
Description string `json:"description" dc:"应用描述"`
|
||||
AccessConfig map[string]interface{} `json:"accessConfig" dc:"接入配置"`
|
||||
LimitConfig map[string]interface{} `json:"limitConfig" dc:"限流配置"`
|
||||
CallbackConfig map[string]interface{} `json:"callbackConfig" dc:"回调配置"`
|
||||
}
|
||||
|
||||
// DeleteApplicationReq 删除应用请求
|
||||
type DeleteApplicationReq struct {
|
||||
g.Meta `path:"/deleteApplication" method:"delete" tags:"应用管理" summary:"删除应用" dc:"删除应用"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
}
|
||||
|
||||
// UpdateApplicationStatusReq 更新应用状态请求
|
||||
type UpdateApplicationStatusReq struct {
|
||||
g.Meta `path:"/updateApplicationStatus" method:"put" tags:"应用管理" summary:"更新应用状态" dc:"更新应用状态"`
|
||||
Id int64 `json:"id" v:"required" dc:"应用ID"`
|
||||
Status app.AppStatus `json:"status" v:"required|in:active,inactive" dc:"状态:active启用/inactive停用"`
|
||||
}
|
||||
@@ -1,102 +0,0 @@
|
||||
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停用"`
|
||||
}
|
||||
@@ -1,99 +0,0 @@
|
||||
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:"消息"`
|
||||
}
|
||||
@@ -1,91 +0,0 @@
|
||||
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停用"`
|
||||
}
|
||||
@@ -1,125 +0,0 @@
|
||||
package mapping
|
||||
|
||||
import (
|
||||
"cid/consts/mapping"
|
||||
entity "cid/model/entity/mapping"
|
||||
|
||||
"gitea.com/red-future/common/beans"
|
||||
"github.com/gogf/gf/v2/frame/g"
|
||||
)
|
||||
|
||||
// CreateDataMappingReq 创建数据映射请求
|
||||
type CreateDataMappingReq struct {
|
||||
g.Meta `path:"/createDataMapping" method:"post" tags:"数据映射" summary:"创建数据映射" dc:"创建数据映射规则"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
SourceField string `json:"sourceField" v:"required" dc:"源字段"`
|
||||
TargetField string `json:"targetField" v:"required" dc:"目标字段"`
|
||||
FieldType string `json:"fieldType" v:"required" dc:"字段类型"`
|
||||
DefaultValue string `json:"defaultValue" dc:"默认值"`
|
||||
TransformRule map[string]interface{} `json:"transformRule" dc:"转换规则"`
|
||||
Priority int `json:"priority" dc:"优先级" d:"0"`
|
||||
Status mapping.MappingStatus `json:"status" dc:"状态" d:"active"`
|
||||
}
|
||||
|
||||
// CreateDataMappingRes 创建数据映射响应
|
||||
type CreateDataMappingRes struct {
|
||||
Id int64 `json:"id" dc:"映射ID"`
|
||||
}
|
||||
|
||||
// ListDataMappingReq 获取数据映射列表请求
|
||||
type ListDataMappingReq struct {
|
||||
g.Meta `path:"/listDataMappings" method:"get" tags:"数据映射" summary:"获取数据映射列表" dc:"分页查询数据映射列表"`
|
||||
*beans.Page
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" dc:"接口ID"`
|
||||
SourceField string `json:"sourceField" dc:"源字段"`
|
||||
TargetField string `json:"targetField" dc:"目标字段"`
|
||||
Status mapping.MappingStatus `json:"status" dc:"状态"`
|
||||
}
|
||||
|
||||
// ListDataMappingRes 获取数据映射列表响应
|
||||
type ListDataMappingRes struct {
|
||||
List []DataMappingItem `json:"list" dc:"映射列表"`
|
||||
Total int `json:"total" dc:"总数"`
|
||||
}
|
||||
|
||||
type DataMappingItem struct {
|
||||
Id int64 `json:"id,string"`
|
||||
PlatformId int64 `json:"platformId"`
|
||||
PlatformName string `json:"platformName"`
|
||||
InterfaceId int64 `json:"interfaceId"`
|
||||
InterfaceName string `json:"interfaceName"`
|
||||
SourceField string `json:"sourceField"`
|
||||
TargetField string `json:"targetField"`
|
||||
FieldType string `json:"fieldType"`
|
||||
DefaultValue string `json:"defaultValue"`
|
||||
TransformRule map[string]interface{} `json:"transformRule"`
|
||||
Priority int `json:"priority"`
|
||||
Status mapping.MappingStatus `json:"status"`
|
||||
StatusName string `json:"statusName"`
|
||||
CreatedAt int64 `json:"createdAt"`
|
||||
UpdatedAt int64 `json:"updatedAt"`
|
||||
}
|
||||
|
||||
// GetDataMappingReq 获取数据映射详情请求
|
||||
type GetDataMappingReq struct {
|
||||
g.Meta `path:"/getDataMapping" method:"get" tags:"数据映射" summary:"获取数据映射详情" dc:"获取数据映射详情"`
|
||||
Id int64 `json:"id" v:"required" dc:"映射ID"`
|
||||
}
|
||||
|
||||
// GetDataMappingRes 获取数据映射详情响应
|
||||
type GetDataMappingRes struct {
|
||||
*entity.DataMapping
|
||||
PlatformName string `json:"platformName,omitempty"`
|
||||
InterfaceName string `json:"interfaceName,omitempty"`
|
||||
}
|
||||
|
||||
// UpdateDataMappingReq 更新数据映射请求
|
||||
type UpdateDataMappingReq struct {
|
||||
g.Meta `path:"/updateDataMapping" method:"put" tags:"数据映射" summary:"更新数据映射" dc:"更新数据映射规则"`
|
||||
Id int64 `json:"id" v:"required" dc:"映射ID"`
|
||||
PlatformId int64 `json:"platformId" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" dc:"接口ID"`
|
||||
SourceField string `json:"sourceField" dc:"源字段"`
|
||||
TargetField string `json:"targetField" dc:"目标字段"`
|
||||
FieldType string `json:"fieldType" dc:"字段类型"`
|
||||
DefaultValue string `json:"defaultValue" dc:"默认值"`
|
||||
TransformRule map[string]interface{} `json:"transformRule" dc:"转换规则"`
|
||||
Priority int `json:"priority" dc:"优先级"`
|
||||
Status mapping.MappingStatus `json:"status,omitempty" dc:"状态"`
|
||||
}
|
||||
|
||||
// DeleteDataMappingReq 删除数据映射请求
|
||||
type DeleteDataMappingReq struct {
|
||||
g.Meta `path:"/deleteDataMapping" method:"delete" tags:"数据映射" summary:"删除数据映射" dc:"删除数据映射"`
|
||||
Id int64 `json:"id" v:"required" dc:"映射ID"`
|
||||
}
|
||||
|
||||
// BatchCreateDataMappingReq 批量创建数据映射请求
|
||||
type BatchCreateDataMappingReq struct {
|
||||
g.Meta `path:"/batchCreateDataMappings" method:"post" tags:"数据映射" summary:"批量创建数据映射" dc:"批量创建数据映射规则"`
|
||||
PlatformId int64 `json:"platformId" v:"required" dc:"平台ID"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
Mappings []CreateDataMappingReq `json:"mappings" v:"required" dc:"映射规则列表"`
|
||||
}
|
||||
|
||||
// BatchCreateDataMappingRes 批量创建数据映射响应
|
||||
type BatchCreateDataMappingRes struct {
|
||||
SuccessCount int `json:"successCount" dc:"成功数量"`
|
||||
FailedCount int `json:"failedCount" dc:"失败数量"`
|
||||
Ids []int64 `json:"ids" dc:"映射ID列表"`
|
||||
}
|
||||
|
||||
// ExecuteDataMappingReq 执行数据映射请求
|
||||
type ExecuteDataMappingReq struct {
|
||||
g.Meta `path:"/executeDataMapping" method:"post" tags:"数据映射" summary:"执行数据映射" dc:"执行数据字段映射"`
|
||||
InterfaceId int64 `json:"interfaceId" v:"required" dc:"接口ID"`
|
||||
SourceData map[string]interface{} `json:"sourceData" v:"required" dc:"源数据"`
|
||||
}
|
||||
|
||||
// ExecuteDataMappingRes 执行数据映射响应
|
||||
type ExecuteDataMappingRes struct {
|
||||
TargetData map[string]interface{} `json:"targetData" dc:"目标数据"`
|
||||
AppliedRules []string `json:"appliedRules" dc:"应用的映射规则"`
|
||||
}
|
||||
@@ -1,49 +0,0 @@
|
||||
package app
|
||||
|
||||
import (
|
||||
consts "cid/consts/app"
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// Application 应用管理实体
|
||||
type Application struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
// 基础信息
|
||||
Name string `orm:"name" json:"name" description:"应用名称"`
|
||||
AppCode string `orm:"app_code" json:"appCode" description:"应用编码(唯一标识)"`
|
||||
Type consts.AppType `orm:"type" json:"type" description:"应用类型"`
|
||||
Status consts.AppStatus `orm:"status" json:"status" description:"应用状态:active启用/inactive停用"`
|
||||
Description string `orm:"description" json:"description" description:"应用描述"`
|
||||
// 接入配置 (JSONB)
|
||||
AccessConfig map[string]interface{} `orm:"access_config" json:"accessConfig" description:"接入配置"`
|
||||
// 限流配置 (JSONB)
|
||||
LimitConfig map[string]interface{} `orm:"limit_config" json:"limitConfig" description:"限流配置"`
|
||||
// 回调配置 (JSONB)
|
||||
CallbackConfig map[string]interface{} `orm:"callback_config" json:"callbackConfig" description:"回调配置"`
|
||||
}
|
||||
|
||||
// ApplicationCol 应用表字段定义
|
||||
type ApplicationCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
AppCode string
|
||||
Type string
|
||||
Status string
|
||||
Description string
|
||||
AccessConfig string
|
||||
LimitConfig string
|
||||
CallbackConfig string
|
||||
}
|
||||
|
||||
// ApplicationCols 应用表字段常量
|
||||
var ApplicationCols = ApplicationCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
AppCode: "app_code",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
Description: "description",
|
||||
AccessConfig: "access_config",
|
||||
LimitConfig: "limit_config",
|
||||
CallbackConfig: "callback_config",
|
||||
}
|
||||
@@ -1,56 +0,0 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
consts "cid/consts/data"
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// ApiInterface 接口管理实体
|
||||
type ApiInterface struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
// 基础信息
|
||||
PlatformId int64 `orm:"platform_id" json:"platformId" description:"所属平台ID"`
|
||||
Name string `orm:"name" json:"name" description:"接口名称"`
|
||||
Code string `orm:"code" json:"code" description:"接口编码"`
|
||||
Url string `orm:"url" json:"url" description:"接口地址"`
|
||||
Method consts.ApiMethod `orm:"method" json:"method" description:"请求方法:GET/POST/PUT/DELETE等"`
|
||||
Status consts.PlatformStatus `orm:"status" json:"status" description:"接口状态:active启用/inactive停用"`
|
||||
// 认证类型
|
||||
AuthType string `orm:"auth_type" json:"authType" description:"认证类型:oauth2/apikey/basic等"`
|
||||
// 请求配置 (JSONB)
|
||||
RequestConfig map[string]interface{} `orm:"request_config" json:"requestConfig" description:"请求配置"`
|
||||
// 响应配置 (JSONB)
|
||||
ResponseConfig map[string]interface{} `orm:"response_config" json:"responseConfig" description:"响应配置"`
|
||||
// 独立限流配置 (JSONB)
|
||||
LimitConfig map[string]interface{} `orm:"limit_config" json:"limitConfig" description:"接口独立限流配置(可选,覆盖平台配置)"`
|
||||
}
|
||||
|
||||
// ApiInterfaceCol 接口表字段定义
|
||||
type ApiInterfaceCol struct {
|
||||
beans.SQLBaseCol
|
||||
PlatformId string
|
||||
Name string
|
||||
Code string
|
||||
Url string
|
||||
Method string
|
||||
Status string
|
||||
AuthType string
|
||||
RequestConfig string
|
||||
ResponseConfig string
|
||||
LimitConfig string
|
||||
}
|
||||
|
||||
// ApiInterfaceCols 接口表字段常量
|
||||
var ApiInterfaceCols = ApiInterfaceCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
PlatformId: "platform_id",
|
||||
Name: "name",
|
||||
Code: "code",
|
||||
Url: "url",
|
||||
Method: "method",
|
||||
Status: "status",
|
||||
AuthType: "auth_type",
|
||||
RequestConfig: "request_config",
|
||||
ResponseConfig: "response_config",
|
||||
LimitConfig: "limit_config",
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
consts "cid/consts/data"
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// DataFetchLog 数据获取日志实体
|
||||
type DataFetchLog struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
// 关联信息
|
||||
PlatformId int64 `orm:"platform_id" json:"platformId" description:"平台ID"`
|
||||
InterfaceId int64 `orm:"interface_id" json:"interfaceId" description:"接口ID"`
|
||||
RequestId string `orm:"request_id" json:"requestId" description:"请求ID"`
|
||||
// 执行状态
|
||||
Status consts.FetchStatus `orm:"status" json:"status" description:"执行状态:pending/running/success/failed/rate_limit"`
|
||||
StartTime int64 `orm:"start_time" json:"startTime" description:"开始时间(时间戳)"`
|
||||
EndTime int64 `orm:"end_time" json:"endTime" description:"结束时间(时间戳)"`
|
||||
Duration int `orm:"duration" json:"duration" description:"执行时长(毫秒)"`
|
||||
// 请求响应数据
|
||||
RequestConfig map[string]interface{} `orm:"request_config" json:"requestConfig" description:"请求配置参数"`
|
||||
ResponseData string `orm:"response_data" json:"responseData" description:"响应数据(JSON)"`
|
||||
ErrorMessage string `orm:"error_message" json:"errorMessage" description:"错误信息"`
|
||||
// 重试信息
|
||||
RetryCount int `orm:"retry_count" json:"retryCount" description:"重试次数"`
|
||||
}
|
||||
|
||||
// DataFetchLogCol 数据获取日志表字段定义
|
||||
type DataFetchLogCol struct {
|
||||
beans.SQLBaseCol
|
||||
PlatformId string
|
||||
InterfaceId string
|
||||
RequestId string
|
||||
Status string
|
||||
StartTime string
|
||||
EndTime string
|
||||
Duration string
|
||||
RequestConfig string
|
||||
ResponseData string
|
||||
ErrorMessage string
|
||||
RetryCount string
|
||||
}
|
||||
|
||||
// DataFetchLogCols 数据获取日志表字段常量
|
||||
var DataFetchLogCols = DataFetchLogCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
PlatformId: "platform_id",
|
||||
InterfaceId: "interface_id",
|
||||
RequestId: "request_id",
|
||||
Status: "status",
|
||||
StartTime: "start_time",
|
||||
EndTime: "end_time",
|
||||
Duration: "duration",
|
||||
RequestConfig: "request_config",
|
||||
ResponseData: "response_data",
|
||||
ErrorMessage: "error_message",
|
||||
RetryCount: "retry_count",
|
||||
}
|
||||
@@ -1,46 +0,0 @@
|
||||
package data
|
||||
|
||||
import (
|
||||
consts "cid/consts/data"
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// Platform 平台管理实体
|
||||
type Platform struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
// 基础信息
|
||||
Name string `orm:"name" json:"name" description:"平台名称"`
|
||||
Type consts.SyncPlatform `orm:"type" json:"type" description:"平台类型"`
|
||||
Status consts.PlatformStatus `orm:"status" json:"status" description:"平台状态:active启用/inactive停用"`
|
||||
Description string `orm:"description" json:"description" description:"平台描述"`
|
||||
// 认证配置 (JSONB)
|
||||
AuthConfig map[string]interface{} `orm:"auth_config" json:"authConfig" description:"认证配置"`
|
||||
// 限流配置 (JSONB)
|
||||
LimitConfig map[string]interface{} `orm:"limit_config" json:"limitConfig" description:"限流配置"`
|
||||
// 平台专用配置 (JSONB)
|
||||
PlatformConfig map[string]interface{} `orm:"platform_config" json:"platformConfig" description:"平台专用配置"`
|
||||
}
|
||||
|
||||
// PlatformCol 平台表字段定义
|
||||
type PlatformCol struct {
|
||||
beans.SQLBaseCol
|
||||
Name string
|
||||
Type string
|
||||
Status string
|
||||
Description string
|
||||
AuthConfig string
|
||||
LimitConfig string
|
||||
PlatformConfig string
|
||||
}
|
||||
|
||||
// PlatformCols 平台表字段常量
|
||||
var PlatformCols = PlatformCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
Name: "name",
|
||||
Type: "type",
|
||||
Status: "status",
|
||||
Description: "description",
|
||||
AuthConfig: "auth_config",
|
||||
LimitConfig: "limit_config",
|
||||
PlatformConfig: "platform_config",
|
||||
}
|
||||
@@ -1,52 +0,0 @@
|
||||
package mapping
|
||||
|
||||
import (
|
||||
"cid/consts/mapping"
|
||||
"gitea.com/red-future/common/beans"
|
||||
)
|
||||
|
||||
// DataMapping 数据映射实体
|
||||
type DataMapping struct {
|
||||
beans.SQLBaseDO `orm:",inherit"`
|
||||
// 关联信息
|
||||
PlatformId int64 `orm:"platform_id" json:"platformId" description:"平台ID"`
|
||||
InterfaceId int64 `orm:"interface_id" json:"interfaceId" description:"接口ID"`
|
||||
// 映射规则
|
||||
SourceField string `orm:"source_field" json:"sourceField" description:"源字段(接口返回字段)"`
|
||||
TargetField string `orm:"target_field" json:"targetField" description:"目标字段(本地表字段)"`
|
||||
FieldType string `orm:"field_type" json:"fieldType" description:"字段类型:string/int/float/bool/array/object"`
|
||||
DefaultValue string `orm:"default_value" json:"defaultValue" description:"默认值"`
|
||||
// 转换规则 (JSONB)
|
||||
TransformRule map[string]interface{} `orm:"transform_rule" json:"transformRule" description:"转换规则"`
|
||||
// 优先级和状态
|
||||
Priority int `orm:"priority" json:"priority" description:"优先级(数字越小优先级越高)"`
|
||||
Status mapping.MappingStatus `orm:"status" json:"status" description:"状态:active启用/inactive停用"`
|
||||
}
|
||||
|
||||
// DataMappingCol 数据映射表字段定义
|
||||
type DataMappingCol struct {
|
||||
beans.SQLBaseCol
|
||||
PlatformId string
|
||||
InterfaceId string
|
||||
SourceField string
|
||||
TargetField string
|
||||
FieldType string
|
||||
DefaultValue string
|
||||
TransformRule string
|
||||
Priority string
|
||||
Status string
|
||||
}
|
||||
|
||||
// DataMappingCols 数据映射表字段常量
|
||||
var DataMappingCols = DataMappingCol{
|
||||
SQLBaseCol: beans.DefSQLBaseCol,
|
||||
PlatformId: "platform_id",
|
||||
InterfaceId: "interface_id",
|
||||
SourceField: "source_field",
|
||||
TargetField: "target_field",
|
||||
FieldType: "field_type",
|
||||
DefaultValue: "default_value",
|
||||
TransformRule: "transform_rule",
|
||||
Priority: "priority",
|
||||
Status: "status",
|
||||
}
|
||||
Reference in New Issue
Block a user