去掉无用代码
This commit is contained in:
@@ -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