58 lines
2.3 KiB
Go
58 lines
2.3 KiB
Go
package platform
|
|
|
|
import (
|
|
"gitea.redpowerfuture.com/red-future/common/beans"
|
|
)
|
|
|
|
// AdAccount 广告账户实体(平台凭据 + 多级层级 + API能力标识)
|
|
type AdAccount struct {
|
|
beans.SQLBaseDO `orm:",inherit"`
|
|
// 业务字段
|
|
Name string `orm:"name" json:"name" description:"账户显示名"`
|
|
Platform string `orm:"platform" json:"platform" description:"广告平台 douyin/xiaohongshu/kuaishou"`
|
|
AccountID string `orm:"account_id" json:"accountId" description:"平台侧账户ID"`
|
|
ParentAccountID int64 `orm:"parent_account_id" json:"parentAccountId" description:"上级账户ID(多级代理层级,自引用)"`
|
|
AccountRole string `orm:"account_role" json:"accountRole" description:"账户角色 agent/owner/sub"`
|
|
Capabilities string `orm:"capabilities" json:"capabilities" description:"API能力(JSON) attribution/delivery/report"`
|
|
AppID string `orm:"app_id" json:"appId" description:"应用ID"`
|
|
AppSecret string `orm:"app_secret" json:"appSecret" description:"应用密钥"`
|
|
AccessToken string `orm:"access_token" json:"accessToken" description:"访问令牌"`
|
|
TokenExpireAt int64 `orm:"token_expire_at" json:"tokenExpireAt" description:"令牌过期时间戳"`
|
|
Config string `orm:"config" json:"config" description:"平台特定配置(JSON) 含回传事件映射等"`
|
|
Enabled bool `orm:"enabled" json:"enabled" description:"是否启用"`
|
|
}
|
|
|
|
// AdAccountCol 广告账户表字段定义
|
|
type AdAccountCol struct {
|
|
beans.SQLBaseCol
|
|
Name string
|
|
Platform string
|
|
AccountID string
|
|
ParentAccountID string
|
|
AccountRole string
|
|
Capabilities string
|
|
AppID string
|
|
AppSecret string
|
|
AccessToken string
|
|
TokenExpireAt string
|
|
Config string
|
|
Enabled string
|
|
}
|
|
|
|
// AdAccountCols 广告账户表字段常量
|
|
var AdAccountCols = AdAccountCol{
|
|
SQLBaseCol: beans.DefSQLBaseCol,
|
|
Name: "name",
|
|
Platform: "platform",
|
|
AccountID: "account_id",
|
|
ParentAccountID: "parent_account_id",
|
|
AccountRole: "account_role",
|
|
Capabilities: "capabilities",
|
|
AppID: "app_id",
|
|
AppSecret: "app_secret",
|
|
AccessToken: "access_token",
|
|
TokenExpireAt: "token_expire_at",
|
|
Config: "config",
|
|
Enabled: "enabled",
|
|
}
|