syntax = "proto3"; option go_package = ".;pb"; enum Identity { Identity_Null = 0; Admin = 1; //超管权限(唯一可管理后台账号) Manager = 2; //管理员权限(除账号管理外全部权限,不受工厂/产品限制) Agent = 3; //代理权限(外部公司,按勾选下发页面/工厂/产品) Operator = 4; //运营权限(公司内部,按勾选下发页面/工厂/产品) Dealer = 5; //渠道商权限(品牌商下的渠道商,绑定 brandid+channelid,只看自己渠道的数据) } //后台账号 message DBAdminUser{ string account = 1; //@go_tags(`gorm:"primary_key"`) 账号 string password = 2; //@go_tags(`json:"password"`) 密码 Identity identity = 3; //@go_tags(`json:"identity"`) 身份 string access = 5; //@go_tags(`json:"access"`) 权限列表,分割 string factoryids = 6; //@go_tags(`json:"factoryids"`) 所属工厂列表,分割 string productids = 7; //@go_tags(`json:"productids"`) 所属产品列表,分割(代理用) // 资源点池(超管以外,赠送资源时从池中扣减;超管不受限) int64 vipday_balance = 8; //@go_tags(`gorm:"vipday_balance" json:"vipday_balance"`) VIP天数余额 int64 aichatintegral_balance = 9; //@go_tags(`gorm:"aichatintegral_balance" json:"aichatintegral_balance"`) AI资源点余额 int64 tradesecond_balance = 10; //@go_tags(`gorm:"tradesecond_balance" json:"tradesecond_balance"`) 翻译时长余额(秒) int64 meetsecond_balance = 11; //@go_tags(`gorm:"meetsecond_balance" json:"meetsecond_balance"`) 会议时长余额(秒) } //后台账号资源点流水(超管→管理员/代理/运营) message DBAdminResourceLog{ uint64 id = 1; //@go_tags(`gorm:"primaryKey;autoIncrement"`) 自增主键 int64 ts = 2; //@go_tags(`gorm:"ts;index" json:"ts"`) 时间戳 string from_account = 3; //@go_tags(`gorm:"from_account:50;index" json:"from_account"`) 发起人账号(超管) string to_account = 4; //@go_tags(`gorm:"to_account:50;index" json:"to_account"`) 接收人账号 int64 vipday = 5; //@go_tags(`gorm:"vipday" json:"vipday"`) 赠送的VIP天数 int64 aichatintegral= 6; //@go_tags(`gorm:"aichatintegral" json:"aichatintegral"`) 赠送的AI资源点 int64 tradesecond = 7; //@go_tags(`gorm:"tradesecond" json:"tradesecond"`) 赠送的翻译秒数 int64 meetsecond = 8; //@go_tags(`gorm:"meetsecond" json:"meetsecond"`) 赠送的会议秒数 string remark = 9; //@go_tags(`gorm:"remark" json:"remark"`) 备注 } //产品激活/绑定统计(重建统计时全量扫描 userdevice 落库,仪表盘读取) message DBProductStat{ uint32 productid = 1; //@go_tags(`gorm:"productid;primaryKey;autoIncrement:false" json:"productid"`) 产品ID int64 activated_count = 2; //@go_tags(`gorm:"activated_count" json:"activated_count"`) 激活设备数(userdevice 行数) int64 bound_user_count = 3; //@go_tags(`gorm:"bound_user_count" json:"bound_user_count"`) 绑定用户数(去重 uid) int64 update_time = 4; //@go_tags(`gorm:"update_time" json:"update_time"`) 最近重建时间 } //后台操作日志 message DBConsoleLog{ uint64 id = 1; //@go_tags(`gorm:"primary_key;AUTO_INCREMENT"`) 自增主键 string account = 2; //@go_tags(`gorm:"index:idx_account"`) 操作人账号 string api_name = 3; //@go_tags(`gorm:"index:idx_api"`) 接口名称 string request = 4; //@go_tags(`gorm:"type:text"`) 请求参数JSON string response = 5; //@go_tags(`gorm:"type:text"`) 响应结果JSON int32 code = 6; // 响应状态码 0=成功 string ip = 7; // 操作IP int64 cost_ms = 8; // 耗时毫秒 int64 created_at = 9; //@go_tags(`gorm:"index:idx_time"`) 操作时间戳 }