去掉无用代码
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:"应用的映射规则"`
|
||||
}
|
||||
Reference in New Issue
Block a user