50 lines
1.7 KiB
Go
50 lines
1.7 KiB
Go
|
|
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",
|
|||
|
|
}
|