Files
cid/model/dto/data/platform_dto.go
2026-03-23 14:08:11 +08:00

92 lines
3.9 KiB
Go
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
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停用"`
}