You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
573 lines
56 KiB
573 lines
56 KiB
syntax = "proto3";
|
|
option go_package = ".;pb";
|
|
import "enum.proto";
|
|
|
|
//用户渠道
|
|
enum UserChannel {
|
|
UNKNOWN = 0; //未知
|
|
CHINA_HUAWEI = 1; //中国-华为
|
|
CHINA_XIAOMI = 2; //中国-小米
|
|
CHINA_OPPO = 3; //中国-OPPO
|
|
CHINA_VIVO = 4; //中国-VIVO
|
|
CHINA_HONOR = 5; //中国-荣耀
|
|
OFFICIAL = 100; //官方包
|
|
GLOBAL_APPLE = 101; //全球-苹果
|
|
GLOBAL_GOOGLE = 102; //全球-谷歌
|
|
}
|
|
|
|
enum Codetype {
|
|
AUTHCODE = 0; //认证码
|
|
DEVICECODE = 1; //设备码
|
|
}
|
|
|
|
//用户数据
|
|
message DBUser {
|
|
string uid = 1; //@go_tags(`gorm:"uid:50;primaryKey" json:"uid"`) 用户ID
|
|
string mail = 2; //@go_tags(`gorm:"mail:50;index" json:"mail"`) 邮箱
|
|
string phone = 3; //@go_tags(`gorm:"phone:50;index" json:"phone"`) 手机号
|
|
string name = 5; //@go_tags(`gorm:"name:50" json:"name"`) 用户名
|
|
string avatar = 8; //@go_tags(`gorm:"avatar" json:"avatar"`) 玩家头像
|
|
string phonemodel = 10; //@go_tags(`json:"phonemodel"`) 手机型号
|
|
string phonemac = 11; //@go_tags(`gorm:"phonemac:50;index" json:"phonemac"`) 手机硬件id
|
|
string account = 12; //@go_tags(`gorm:"account:50;index" json:"account"`) 登录帐号
|
|
string password = 13; //@go_tags(`json:"password"`) 密码登录
|
|
int64 lastsgintime = 20; //@go_tags(`gorm:"lastsgintime" json:"lastsgintime"`) 最后登录四件
|
|
int64 createtime = 21; //@go_tags(`gorm:"createtime" json:"createtime"`) 注册时间
|
|
string language = 22; //@go_tags(`gorm:"language" json:"language"`) 语言
|
|
string servicetag = 23; //@go_tags(`gorm:"servicetag" json:"servicetag"`) 服务所属区
|
|
UserChannel channel = 24; //@go_tags(`gorm:"channel" json:"channel"`) 用户渠道
|
|
string version = 25; //@go_tags(`gorm:"version" json:"version"`) 版本
|
|
UserState State = 26; //@go_tags(`gorm:"State" json:"State"`) 状态
|
|
int64 canceltime = 27; //@go_tags(`gorm:"canceltime" json:"canceltime"`) 注销时间(0 未注销)
|
|
string wxopenid = 30; //@go_tags(`gorm:"wxopenid:50;index" json:"wxopenid"`) 微信openid
|
|
string googleopenid = 31; //@go_tags(`gorm:"googleopenid:50;index" json:"googleopenid"`) 谷歌openid
|
|
string facebookopenid = 32; //@go_tags(`gorm:"facebookopenid:50;index" json:"facebookopenid"`) FaceBook
|
|
string appleopenid = 33; //@go_tags(`gorm:"appleopenid:50;index" json:"appleopenid"`)
|
|
|
|
bool isgiveaway = 36; //@go_tags(`gorm:"isgiveaway" json:"isgiveaway"`) 是否是第一次绑定
|
|
int32 gender = 37; //@go_tags(`gorm:"gender" json:"gender"` 性别 1-男 2-女
|
|
string country_code = 38; //@go_tags(`gorm:"country_code" json:"country_code"` // 国家编码
|
|
string continent_code = 39; //@go_tags(`gorm:"continent_code" json:"continent_code"` // 国家
|
|
|
|
int32 viplv = 40; //@go_tags(`gorm:"viplv:50" json:"viplv"`) viplv
|
|
int64 vipexptime = 41; //@go_tags(`gorm:"vipexptime" json:"vipexptime"`) 会员过期时间
|
|
int64 aichatintegral = 42; //@go_tags(`gorm:"aichatintegral" json:"aichatintegral"`) ai聊天积分
|
|
int64 aichattotalintegral = 43; //@go_tags(`gorm:"aichattotalintegral" json:"aichattotalintegral"`) ai聊天总积分
|
|
int64 tradeintegral = 44; //@go_tags(`gorm:"tradeintegral" json:"tradeintegral"`) 翻译积分
|
|
int64 tradetotalintegral = 45; //@go_tags(`gorm:"tradetotalintegral" json:"tradetotalintegral"`) 翻译总积分
|
|
int64 meetintegral = 46; //@go_tags(`gorm:"meetintegral" json:"meetintegral"`) 会议积分
|
|
int64 meettotalintegral = 47; //@go_tags(`gorm:"meettotalintegral" json:"meettotalintegral"`) 会议总积分
|
|
bool isactivatecode = 48; //@go_tags(`gorm:"isactivatecode" json:"isactivatecode"`) 是否已使用过激活码(厂家公码)每账号一生限领一次
|
|
uint32 lastbindproductid = 49; //@go_tags(`gorm:"lastbindproductid" json:"lastbindproductid"`) 最后绑定的产品ID(充值/消耗按此产品归属统计)
|
|
string lastbindchannelid = 50; //@go_tags(`gorm:"lastbindchannelid;size:16;index" json:"lastbindchannelid"`) 最后绑定设备的渠道商ID(充值/消耗按此渠道商归属统计与结算)
|
|
bool idverified = 51; //@go_tags(`gorm:"idverified;index" json:"idverified"`) 是否已通过身份证实名校验(明细见 useridverify 表)
|
|
int64 idverifiedtime = 52; //@go_tags(`gorm:"idverifiedtime" json:"idverifiedtime"`) 实名校验通过时间(0=未通过)
|
|
// 用户算力余额(充值/后台调整获得,归属账号,不过期)。
|
|
// 三个旧额度桶(aichatintegral/tradeintegral/meetintegral)自 2026-09 起停用、不再作为闸门,
|
|
// 存量值已按换算系数折进本字段(见 docs/会员权益与用量统计-设计与开发文档.md §10 存量迁移)。
|
|
int64 computebalance = 53; //@go_tags(`gorm:"computebalance" json:"computebalance"`) 算力余额(账号自有,不过期)
|
|
}
|
|
|
|
//用户实名认证记录(表 useridverify)。一个用户一行。
|
|
//
|
|
// 合规口径:身份证号**全文不落库**——只存掩码(展示用)与 SHA-256 指纹(排查同证多号用)。
|
|
// 指纹加了盐(ID_HASH_SALT),避免拿全国身份证号做彩虹表反查。
|
|
// 姓名按业务需要保留原文(开票/客服核实要用),若后续要求更严可再改为加密字段。
|
|
message DBUserIdVerify {
|
|
string uid = 1; //@go_tags(`gorm:"uid;size:50;primaryKey" json:"uid"`) 用户ID
|
|
string realname = 2; //@go_tags(`gorm:"realname;size:64" json:"realname"`) 姓名
|
|
string idcardmask = 3; //@go_tags(`gorm:"idcardmask;size:32" json:"idcardmask"`) 身份证号掩码,如 4403**********1234
|
|
string idcardhash = 4; //@go_tags(`gorm:"idcardhash;size:64;index" json:"idcardhash"`) 身份证号加盐 SHA-256(后台排查"同一证件多个账号")
|
|
string provider = 5; //@go_tags(`gorm:"provider;size:32" json:"provider"`) 核验服务商 aliyun/tencent
|
|
string svcid = 6; //@go_tags(`gorm:"svcid;size:64" json:"svcid"`) 使用的第三方服务配置 id
|
|
string bizcode = 7; //@go_tags(`gorm:"bizcode;size:16" json:"bizcode"`) 服务商返回的原始结果码(阿里 BizCode / 腾讯 Result)
|
|
int64 verifytime = 8; //@go_tags(`gorm:"verifytime" json:"verifytime"`) 校验通过时间(0=未通过)
|
|
int32 failcount = 9; //@go_tags(`gorm:"failcount" json:"failcount"`) 累计失败次数(限频用)
|
|
int64 lastfailtime = 10; //@go_tags(`gorm:"lastfailtime" json:"lastfailtime"`) 最后一次失败时间
|
|
int64 createtime = 11; //@go_tags(`gorm:"createtime" json:"createtime"`) 首次提交时间
|
|
int64 updatetime = 12; //@go_tags(`gorm:"updatetime" json:"updatetime"`) 最后更新时间
|
|
}
|
|
|
|
//用户设备数据
|
|
message DBUserDivice {
|
|
uint64 id = 1; //@go_tags(`gorm:"id:50;primaryKey;autoIncrement json:"id"`) id
|
|
string uid = 2; //@go_tags(`gorm:"uid:50;index" json:"uid"`) 用户ID
|
|
uint32 productid = 3; //@go_tags(`gorm:"productid:50;index" json:"productid"`) 产品ID
|
|
DeviceType devicetype = 4; //@go_tags(`gorm:"devicetype:50;index" json:"devicetype"`) 设备类型
|
|
string devicename = 5; //@go_tags(`gorm:"devicename:50" json:"devicename"`) 设备名称
|
|
string devicemac = 6; //@go_tags(`gorm:"devicemac:50;index" json:"devicemac"`) 设备地址
|
|
string license = 7; //@go_tags(`gorm:"license:50;index" json:"license"`) 认证码
|
|
string cmei = 8; //@go_tags(`gorm:"cmei:50;index" json:"cmei"`) cmei码
|
|
string version = 9; //@go_tags(`gorm:"version:50" json:"version"`) 版本
|
|
string lxsetting = 10; //@go_tags(`gorm:"lxsetting:256" json:"lxsetting"`) 蓝训设置
|
|
string channelid = 11; //@go_tags(`gorm:"channelid;size:16;index" json:"channelid"`) 渠道商ID(绑定时从授权码带入,空=未分配渠道)
|
|
}
|
|
|
|
//用户画像数据结构
|
|
message DBUserPortrait{
|
|
string uid = 1; //@go_tags(`gorm:"uid:50;primaryKey" json:"uid"`) 用户ID
|
|
string name = 2;
|
|
int32 gender = 3;
|
|
string age = 4;
|
|
string city = 5;
|
|
string homeaddr = 6;
|
|
|
|
}
|
|
|
|
//智能体数据
|
|
message DBAgent {
|
|
string id = 1; //@go_tags(`gorm:"id:50;primaryKey" json:"id"`) 智能体id
|
|
string name = 2; //@go_tags(`gorm:"name:50" json:"name"`) 智能体名称
|
|
string avatarUrl = 3; //@go_tags(`gorm:"avatarUrl:50" json:"avatarUrl"`) 头像
|
|
string description = 4; //@go_tags(`gorm:"description" json:"description"`) 智能体描述
|
|
string tag = 5; //@go_tags(`gorm:"tag" json:"tag"`) 类型 多个用逗号分隔
|
|
bool enable = 6; //@go_tags(`gorm:"enable" json:"enable"`) 是否启用
|
|
bool isOnline = 7; //@go_tags(`gorm:"isOnline" json:"isOnline"`) 是否在线
|
|
string welcomeMessage = 8; //@go_tags(`gorm:"welcomeMessage" json:"welcomeMessage"`) 文字欢迎消息
|
|
string voiceWelcomeMessage = 9; //@go_tags(`gorm:"voiceWelcomeMessage" json:"voiceWelcomeMessage"`) 声音欢迎消息
|
|
string systemPrompt = 10; //@go_tags(`gorm:"systemPrompt" json:"systemPrompt"`) 提示词
|
|
string languages = 11; //@go_tags(`gorm:"languages" json:"languages"`) 支持语言 多个用逗号分隔 zh-CN,en-US
|
|
AgentSource source = 12; //@go_tags(`gorm:"source;index" json:"source"`) Agent来源 0:内置 1:PolyChat 2:阿里云 3:火山
|
|
string serviceData = 13; //@go_tags(`gorm:"serviceData" json:"serviceData"`) 服务数据 JSON 存放各平台所需的接入参数
|
|
string roleId = 14; //@go_tags(`gorm:"roleId:50;index" json:"roleId"`) 角色ID
|
|
string voice = 15; //@go_tags(`gorm:"voice" json:"voice"`) 音色配置 多个用逗号分隔 平台音色id
|
|
string voices = 16; //@go_tags(`gorm:"voices" json:"voices"`) 音色配置 多个用逗号分隔 平台音色id
|
|
int32 sort = 17; //@go_tags(`gorm:"sort;index" json:"sort"`) 排序权重 值越小越靠前
|
|
}
|
|
|
|
//mcp 服务列表
|
|
message DBMcpServer {
|
|
string id = 1; //@go_tags(`gorm:"id:50;primaryKey" json:"id"`) mcp服务id
|
|
string name = 2; //@go_tags(`gorm:"name:50" json:"name"`) mcp服务名称
|
|
Region region = 3; //@go_tags(`gorm:"region;index" json:"region"`) 配置组
|
|
string description = 4; //@go_tags(`gorm:"description" json:"description"`) mcp服务名称
|
|
string url = 5; //@go_tags(`gorm:"url" json:"url"`) 地址
|
|
MCPServerType stype = 6; //@go_tags(`gorm:"stype" json:"type"`) 服务类型
|
|
string tools = 7; //@go_tags(`gorm:"tools" json:"tools"`) 启用工具 空表示 全部启用
|
|
bool enable = 8; //@go_tags(`gorm:"enable" json:"enable"`) 是否启用
|
|
}
|
|
|
|
//app 配置数据
|
|
message DBGlobalConfigItem{
|
|
uint64 id = 1; //@go_tags(`gorm:"primaryKey;autoIncrement json:"group"`) 配置组
|
|
Region region = 2; //@go_tags(`gorm:"region;index json:"region"`) 区域枚举,用于根据区域适配服务配置
|
|
string group = 3; //@go_tags(`gorm:"group:50;index" json:"group"`) 配置组
|
|
string key = 4;
|
|
string value = 5;
|
|
string description = 6;
|
|
}
|
|
|
|
//app 配置数据
|
|
message DBAppConfigItem{
|
|
uint64 id = 1; //@go_tags(`gorm:"primaryKey;autoIncrement json:"group"`) 配置组
|
|
string group = 3; //@go_tags(`gorm:"group:50;index" json:"group"`) 配置组
|
|
string key = 4;
|
|
string value = 5;
|
|
string description = 6;
|
|
}
|
|
|
|
//厂家数据管理
|
|
//方案商所属芯片厂商(分组维度)。一个芯片厂商可以有多套方案,每套方案一条 DBSolutionProvider 记录。
|
|
//
|
|
//⚠️【2026-09-01 已停止扩充】芯片厂商已转成 chip_vendor 表(后台「芯片管理」页自助增删改,
|
|
//见 modules/console/model_chipvendor.go)。DBSolutionProvider.vendor 存的是那张表的 id,
|
|
//表 id 与下面这几个枚举值一一对应(启动时幂等补种),故存量数据无需迁移。
|
|
//新增厂商请到后台加,**不要再往这个枚举里加值**——加了也没人读,反而会让人以为还得改代码发版。
|
|
//本枚举保留是为了字段类型不变(proto3 开放枚举按数值收发,表 id ≥5 也能正常传输)。
|
|
enum SolutionVendor {
|
|
VENDOR_UNKNOWN = 0; //未指定
|
|
VENDOR_JIELI = 1; //杰里
|
|
VENDOR_LANXUN = 2; //蓝汛
|
|
VENDOR_HENGXUAN = 3; //恒玄
|
|
VENDOR_BOTONG = 4; //博通
|
|
}
|
|
|
|
//方案商(芯片/整体方案提供方)
|
|
//id 是「手工指定的有含义编码」,不是自增:十六进制看,如 0xABEF=杰里老方案、0xC101=杰里01方案。
|
|
//历史 ID(ABEF/ABF0~ABF4/AB21)已烧录进设备,不可变更;新增方案商一律用 C 开头段(C1xx…)。
|
|
message DBSolutionProvider{
|
|
uint32 id = 1; //@go_tags(`gorm:"id;primaryKey" json:"id"`) 方案商id(手工指定,不自增)
|
|
string name = 2; //@go_tags(`gorm:"name;index" json:"name"`) 方案商公司名称
|
|
string description = 3; //@go_tags(`gorm:"description" json:"description"`) 方案说明(这套方案做什么)
|
|
string contactmails = 4; //@go_tags(`gorm:"contactmails" json:"contactmails"`) 联系人邮箱
|
|
int64 createtime = 5; //@go_tags(`gorm:"createtime" json:"createtime"`) 创建时间
|
|
SolutionVendor vendor = 6; //@go_tags(`gorm:"vendor;index" json:"vendor"`) 所属芯片厂商分组(杰里/蓝汛/恒玄/博通)
|
|
}
|
|
|
|
//品牌商(原厂家;归属一个方案商)
|
|
message DBBrand{
|
|
uint32 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 品牌商id
|
|
string brand = 2; //@go_tags(`gorm:"brand" json:"brand"`) 品牌商名称
|
|
//【已废弃】品牌商不归属方案商——方案商是「产品用了哪套芯片方案」,同一品牌不同产品可以用不同方案,
|
|
//所以归属挂在 DBProduct.providerid 上。本字段与 brand.providerid 列均已停写,仅为兼容旧数据保留,勿再使用。
|
|
uint32 providerid = 3; //@go_tags(`gorm:"providerid;index" json:"providerid"`) [已废弃]原「归属方案商id」
|
|
string description = 4; //@go_tags(`gorm:"description" json:"description"`) 描述
|
|
string contactmails = 5; //@go_tags(`gorm:"contactmails" json:"contactmails"`) 联系人邮箱 xxx@qq.com,xxx@gmail.com
|
|
string productlists = 7; //@go_tags(`gorm:"productlists" json:"productlists"`) 产品列表 1,2,3
|
|
int32 sharerate = 8; //@go_tags(`gorm:"sharerate" json:"sharerate"`) 分成比例(万分比):平台从订单实付里分给品牌商的总提成,渠道商再从这份里切
|
|
int64 createtime = 9; //@go_tags(`gorm:"createtime" json:"createtime"`) 创建时间(秒);历史品牌商为0
|
|
}
|
|
|
|
//渠道商(挂在品牌商下,一个品牌商可绑定多个渠道商)
|
|
//id 用 8 位可读短码而非自增:会印在生产台账/结算单上并对外沟通,短码可读、不暴露规模,
|
|
//且作为统计与结算的维度键(string)跨库不冲突。新增走审批:status=0 时不可用于生产。
|
|
message DBChannel{
|
|
string id = 1; //@go_tags(`gorm:"column:id;size:16;primaryKey" json:"id"`) 渠道商id(短码)
|
|
//归属品牌商id。**0 = 不归属任何品牌商**(后台新增渠道商时已不再要求选品牌商,
|
|
//渠道商是全局实体)。仅 addOfficialChannel 生成的「品牌官方渠道」才带非 0 值。
|
|
uint32 brandid = 2; //@go_tags(`gorm:"brandid;index" json:"brandid"`) 归属品牌商id(0=全局渠道商)
|
|
string name = 3; //@go_tags(`gorm:"name;index" json:"name"`) 渠道商名称
|
|
string contact = 4; //@go_tags(`gorm:"contact" json:"contact"`) 联系人/电话
|
|
string contactmails = 5; //@go_tags(`gorm:"contactmails" json:"contactmails"`) 联系人邮箱 xxx@qq.com,xxx@gmail.com
|
|
string remark = 6; //@go_tags(`gorm:"remark" json:"remark"`) 备注
|
|
//【已停止在后台维护,2026-09-02】分成比例改为按【生产批次】设置(production_batch.sharerate),
|
|
//因为同一渠道商不同批次的比例可能不同。本列保留存量值,月结算暂时仍读它(见 api_settlement.go),
|
|
//新建渠道商一律为 0。别再在渠道商表单里加回这个字段。
|
|
int32 sharerate = 7; //@go_tags(`gorm:"sharerate" json:"sharerate"`) [遗留]渠道商级分成比例(万分比)
|
|
int32 status = 8; //@go_tags(`gorm:"status;index" json:"status"`) 状态 0:待审核 1:启用 2:停用 3:驳回
|
|
string applyaccount = 9; //@go_tags(`gorm:"applyaccount" json:"applyaccount"`) 申请人账号(品牌商自助添加时记录)
|
|
string auditaccount = 10; //@go_tags(`gorm:"auditaccount" json:"auditaccount"`) 审核人账号
|
|
string auditremark = 11; //@go_tags(`gorm:"auditremark" json:"auditremark"`) 审核意见(驳回原因)
|
|
int64 audittime = 12; //@go_tags(`gorm:"audittime" json:"audittime"`) 审核时间
|
|
int64 createtime = 13; //@go_tags(`gorm:"createtime" json:"createtime"`) 创建时间
|
|
int64 updatetime = 14; //@go_tags(`gorm:"updatetime" json:"updatetime"`) 更新时间
|
|
bool official = 15; //@go_tags(`gorm:"official;index" json:"official"`) 品牌官方渠道:随品牌商创建自动生成、直接启用,不可删除(品牌自营的那条销售线)
|
|
}
|
|
|
|
//月结算单(每 结算月×渠道商×生产批次 一行)
|
|
//
|
|
//分成算法(2026-09-02 起):
|
|
// base = 该月归属该 (渠道商, 批次) 的订单实付金额之和(分)
|
|
// channel_amount = base * channel_rate 渠道商分成
|
|
// platform_amount = base - channel_amount 平台留存
|
|
//
|
|
//⚠️ 为什么按【批次】而不是按渠道商出行:分成比例是一批一谈的,存在
|
|
// production_batch.sharerate 上(见「MAC生成管理 → 生成MAC」的表单)。同一家渠道商
|
|
// 不同批次比例可以不同,一个渠道商一行只能装一个比例,装不下。
|
|
//
|
|
//订单如何落到批次:payorder 下单时冻结了来源设备快照(src_license / src_mac / src_productid),
|
|
//拿它去 license_<pid> 分表反查到 batchno。查不到(用户没绑过设备、批次被撤销)的订单
|
|
//落 batchno='' 的行,比例 0、全归平台。
|
|
//
|
|
//比例按【结算时快照】存进本行,事后改批次比例不影响已确认的月份。
|
|
//
|
|
//⚠️ 品牌商维度已移除:生产链路不再涉及品牌商(生成MAC 表单已去掉该字段),
|
|
// 留着只会产出一堆 brandid=0 的行。字段号 2/6/7/10 保留不复用。
|
|
message DBSettlementMonth{
|
|
reserved 2, 6, 7, 10; //【已废弃】brandid / brand_rate / brand_gross / brand_net
|
|
uint32 period = 1; //@go_tags(`gorm:"period;primaryKey;index" json:"period"`) 结算月 YYYYMM
|
|
string channelid = 3; //@go_tags(`gorm:"channelid;size:16;primaryKey;index" json:"channelid"`) 渠道商id(空=无渠道归属)
|
|
string batchno = 17; //@go_tags(`gorm:"batchno;size:16;primaryKey;index" json:"batchno"`) 生产批次号(空=无法归到批次)
|
|
uint32 productid = 18; //@go_tags(`gorm:"productid;index" json:"productid"`) 该批次的产品id(展示用,0=未知)
|
|
int64 order_count = 4; //@go_tags(`gorm:"order_count" json:"order_count"`) 已支付订单数
|
|
int64 base_amount = 5; //@go_tags(`gorm:"base_amount" json:"base_amount"`) 结算基数=订单实付金额合计(分)
|
|
int32 channel_rate = 8; //@go_tags(`gorm:"channel_rate" json:"channel_rate"`) 渠道分成比例快照(万分比,取自该批次)
|
|
int64 channel_amount = 9; //@go_tags(`gorm:"channel_amount" json:"channel_amount"`) 渠道商分成金额(分)
|
|
int64 platform_amount = 11; //@go_tags(`gorm:"platform_amount" json:"platform_amount"`) 平台留存(分)=基数-渠道分成
|
|
int32 status = 12; //@go_tags(`gorm:"status;index" json:"status"`) 状态 0:草稿(可重算) 1:已确认(锁定) 2:已支付
|
|
int64 gen_time = 13; //@go_tags(`gorm:"gen_time" json:"gen_time"`) 生成/重算时间
|
|
string confirm_account = 14; //@go_tags(`gorm:"confirm_account" json:"confirm_account"`) 确认人账号
|
|
int64 confirm_time = 15; //@go_tags(`gorm:"confirm_time" json:"confirm_time"`) 确认时间
|
|
string remark = 16; //@go_tags(`gorm:"remark" json:"remark"`) 备注
|
|
}
|
|
|
|
//生产批次(每次生产一条,记录产品/时间/数量/序号区间/MAC区间;替代原出货单)
|
|
message DBProductionBatch{
|
|
uint32 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 批次id
|
|
int64 ts =2; //@go_tags(`gorm:"ts;index" json:"ts"`) 生产时间戳
|
|
uint32 brandid = 3; //@go_tags(`gorm:"brandid;index" json:"brandid"`) 品牌商id
|
|
uint32 productid = 4; //@go_tags(`gorm:"productid;index" json:"productid"`) 产品id
|
|
int64 serialstart = 5; //@go_tags(`gorm:"serialstart" json:"serialstart"`) 序号区间起
|
|
int64 serialend = 6; //@go_tags(`gorm:"serialend" json:"serialend"`) 序号区间止
|
|
string startmac = 7; //@go_tags(`gorm:"startmac:50" json:"startmac"`) 开始设备地址
|
|
string endmac = 8; //@go_tags(`gorm:"endmac:50" json:"endmac"`) 结束设备地址
|
|
uint32 devicenum = 9; //@go_tags(`gorm:"devicenum" json:"devicenum"`) 设备数量
|
|
string batchno = 10; //@go_tags(`gorm:"batchno;size:16;uniqueIndex" json:"batchno"`) 可读批次号(短码,全局唯一)
|
|
string remark = 11; //@go_tags(`gorm:"remark" json:"remark"`) 备注
|
|
string channelid = 12; //@go_tags(`gorm:"channelid;size:16;index" json:"channelid"`) 渠道商id(短码,空=未分配渠道)
|
|
//这批货由哪家代工厂生产(oem_factory.id,0=未指定)。与 brandid「挂谁的牌子卖」是两回事:
|
|
//同一品牌可以换厂、同一家厂也给多个品牌代工,故独立成维度。存量批次为 0(当时还没有工厂档案)。
|
|
uint32 factoryid = 13; //@go_tags(`gorm:"factoryid;index" json:"factoryid"`) 代工厂id(0=未指定)
|
|
//这一批货给渠道商的分成比例(万分比,0~10000)。放在批次而不是渠道商上:
|
|
//同一家渠道商不同批次谈的比例可能不同,挂在渠道商上只能存一个值。
|
|
//⚠️ 生产时冻结,事后改批次比例不影响已算完的结算单。
|
|
int32 sharerate = 14; //@go_tags(`gorm:"sharerate" json:"sharerate"`) 本批次渠道分成比例(万分比)
|
|
//这一批设备的「绑定赠送」。放在批次而不是产品上:同一款产品不同批次(不同渠道/不同活动)
|
|
//送的东西经常不一样,挂在产品上只能存一套,改一次会连带改掉已发出去的货的权益。
|
|
//绑定时按设备所属批次发放,批次三项全为 0 才回退到产品上的旧字段(见 api_binddevice.go)。
|
|
uint32 rewardvip = 15; //@go_tags(`gorm:"rewardvip" json:"rewardvip"`) 绑定赠送VIP天数(0=不送)
|
|
uint32 rewardtranslate = 16; //@go_tags(`gorm:"rewardtranslate" json:"rewardtranslate"`) 绑定赠送翻译时长(分钟,0=不送)
|
|
uint32 rewardmeeting = 17; //@go_tags(`gorm:"rewardmeeting" json:"rewardmeeting"`) 绑定赠送会议时长(分钟,0=不送)
|
|
// 2026-09 起绑定赠送只剩「VIP 天数 + VIP 等级 + 算力」三项:rewardvip 复用为天数,
|
|
// rewardtranslate/rewardmeeting **不再读写**(列保留,避免存量批次表结构变动)。
|
|
int32 viplevel = 18; //@go_tags(`gorm:"viplevel" json:"viplevel"`) 绑定赠送VIP等级(1=VIP 2=VIP-Pro,默认1)
|
|
int64 computegrant = 19; //@go_tags(`gorm:"computegrant" json:"computegrant"`) 绑定赠送算力(0=不送)
|
|
}
|
|
|
|
//工厂产品
|
|
message DBProduct{
|
|
uint32 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 设备编码
|
|
uint32 brandid = 2; //@go_tags(`gorm:"brandid;index" json:"brandid"`) 品牌商id
|
|
//【已废弃 2026-09-08】产品上的「设备类型」已删除:服务端没有任何逻辑读它,
|
|
//后台表单也已去掉这一项。枚举把「连接方式」(经典/BLE单双端)和「产品形态」(录音笔/眼镜/卡片)
|
|
//混在一根轴上,客户端早已另建 DeviceCategories 做品类,这里只剩误配来源。
|
|
//⚠️ 字段保留为**纯下发兼容字段**,理由同下面的 factoryid:已发布的 App 包按「非空 int」解析
|
|
//devicetype,字段一旦不下发,整个 user_getappconfig 响应就抛 TypeError(产品表、设备列表全废)。
|
|
//gorm:"-" 不建列、不参与读写,恒为 0 下发。老包淘汰干净后可整条删除。
|
|
//⚠️ 字段号 3 不要复用。
|
|
DeviceType devicetype = 3; //@go_tags(`gorm:"-" json:"devicetype"`) [兼容]已废弃,恒为0
|
|
string devicename = 4; //@go_tags(`gorm:"devicename" json:"devicename"`) 设备名称
|
|
string productimage = 5; //@go_tags(`gorm:"productimage" json:"productimage"`) 产品图片
|
|
//【已废弃 2026-09-08】设备扫描UUID 已删除:设备校验早就换成按 MAC 走(device_mac 全局表,
|
|
//见 comm.TableDeviceMac),绑定奖励也是按 MAC 判「这台设备有没有被绑过」(codestate),
|
|
//跟这个 UUID 没有任何关系。后台产品表单里那一栏也已去掉。
|
|
//⚠️ 字段保留为**纯下发兼容字段**,理由同 devicetype / factoryid:已发布的 App 包按
|
|
//「非空 String」解析 scanuuid(`json['scanuuid'] as String`),字段一旦不下发,
|
|
//整个 user_getappconfig 响应就抛 TypeError(产品表、设备列表全废)。
|
|
//gorm:"-" 不建列、不参与读写,恒为空串下发。老包淘汰干净后可整条删除。
|
|
//⚠️ 字段号 6 不要复用。
|
|
string scanuuid = 6; //@go_tags(`gorm:"-" json:"scanuuid"`) [兼容]已废弃,恒为空
|
|
string version = 7; //@go_tags(`gorm:"version" json:"version"`) 版本
|
|
string updatedescription = 9; //@go_tags(`gorm:"updatedescription" json:"updatedescription"`) 描述
|
|
string updatepackageaddress = 10; //@go_tags(`gorm:"updatepackageaddress" json:"updatepackageaddress"`) 更新包地址=url
|
|
uint32 versionid = 11; //@go_tags(`gorm:"versionid" json:"versionid"`) 版本id
|
|
bool iscanbindagain = 12; //@go_tags(`gorm:"iscanbindagain" json:"iscanbindagain"`) 是否可以反复下发奖励
|
|
uint32 bindrewardvpitime = 13; //@go_tags(`gorm:"bindrewardvpitime" json:"bindrewardvpitime"`) 是否奖励vip时间
|
|
uint32 bindrewardtranslate = 14; //@go_tags(`gorm:"bindrewardtranslate" json:"bindrewardtranslate"`) 绑定奖励翻译次数
|
|
uint32 bindrewardmeeting = 15; //@go_tags(`gorm:"bindrewardmeeting" json:"bindrewardmeeting"`) 绑定奖励会议次数
|
|
bool iscontinuouschat = 16; //@go_tags(`gorm:"iscontinuouschat" json:"iscontinuouschat"`) 是否连续对话
|
|
bool eqenable = 17; //@go_tags(`gorm:"eqenable" json:"eqenable"`) EQ是否启用
|
|
bool keyenable = 18; //@go_tags(`gorm:"keyenable" json:"keyenable"`) 按键是否启用
|
|
bool workmodeenable = 19; //@go_tags(`gorm:"workmodeenable" json:"workmodeenable"`) 工作模式是否启用
|
|
bool callmodeenable = 20; //@go_tags(`gorm:"callmodeenable" json:"callmodeenable"`) 通话模式是否启用
|
|
bool ledenable = 21; //@go_tags(`gorm:"ledenable" json:"ledenable"`) 闪灯开关是否启用
|
|
bool finddeviceenable = 22; //@go_tags(`gorm:"finddeviceenable" json:"finddeviceenable"`) 查找设备开关是否启用
|
|
bool noisereductionenable = 23; //@go_tags(`gorm:"noisereductionenable" json:"noisereductionenable"`) 降噪开关是否启用
|
|
bool shutdownenable = 24; //@go_tags(`gorm:"shutdownenable" json:"shutdownenable"`) 定时关机开关是否启用
|
|
bool showcasebattery = 25; //@go_tags(`gorm:"showcasebattery" json:"showcasebattery"`) 是否显示仓盒电量
|
|
bool wakeupenable = 26; //@go_tags(`gorm:"wakeupenable" json:"wakeupenable"`) 唤醒控制开关是否启用
|
|
bool broadcastpeertranslate = 27; //@go_tags(`gorm:"broadcastpeertranslate" json:"broadcastpeertranslate"`) 是否播报对方翻译内容
|
|
string channel = 28; //@go_tags(`gorm:"channel" json:"channel"`) 产品渠道方 official/mobile
|
|
string channelextra = 29; //@go_tags(`gorm:"channelextra" json:"channelextra"`) 渠道附加数据(JSON字符串)
|
|
bool hideaiassistant = 30; //@go_tags(`gorm:"hideaiassistant" json:"hideaiassistant"`) 是否隐藏AI助手功能
|
|
uint32 devicecodecount = 31; //@go_tags(`gorm:"devicecodecount" json:"devicecodecount"`) 每副产品生产的设备码数量(0或1=单份,2=双份)
|
|
uint32 bassfilter = 32; //@go_tags(`gorm:"bassfilter" json:"bassfilter"`) 过滤低音音频参数(0-1000)
|
|
int64 serialcursor = 33; //@go_tags(`gorm:"serialcursor" json:"serialcursor"`) 产品级授权码序号游标(累加分配)
|
|
//【老客户端兼容】厂家→品牌商改名前发布的 App 包按「非空 int」解析 factoryid,
|
|
//字段一旦缺失,整个 user_getappconfig / user_getproduct 响应解析就抛 TypeError(设备列表、应用配置全废)。
|
|
//此字段只出不入:gorm:"-" 不建列、不参与读写,由 user 模块读取层统一填成 brandid 的值下发。
|
|
//服务端与新端一律以 brandid 为准,勿往这里写值。老包全部淘汰后可删。
|
|
uint32 factoryid = 34; //@go_tags(`gorm:"-" json:"factoryid"`) [兼容]老客户端字段,值同 brandid
|
|
//产品归属的应用(应用中心 app_product.name,如 Voitrans,Lumi),CSV 可多选、空=未绑定。
|
|
//品牌商/渠道商账号的「应用」下拉即由本字段推导:只列出自己品牌名下产品绑定过的应用。
|
|
string appnames = 35; //@go_tags(`gorm:"appnames;size:255" json:"appnames"`) 绑定应用名CSV(空=未绑定)
|
|
//产品用的是哪套芯片方案(DBSolutionProvider.id),也就是**方案ID(BID)**。
|
|
//三个烧进固件的标识口径固定:CID=芯片公司(chip_vendor.id) / BID=方案公司(本字段) / PID=产品(本表 id);
|
|
//CID 由本字段 → solution_provider.vendor 推出,不在产品上另存(另存会在方案商换芯片时变成对不上的旧值)。
|
|
//以前从品牌商推导,但同一品牌的不同产品可能用不同方案商的方案,推导会串号,故改为产品级绑定,新建产品必填。
|
|
uint32 providerid = 36; //@go_tags(`gorm:"providerid;index" json:"providerid"`) 归属方案商id(CID)
|
|
int64 createtime = 37; //@go_tags(`gorm:"createtime" json:"createtime"`) 创建时间(秒);历史产品为0
|
|
//产品说明:这款产品是什么、有什么特性,给后台运营与客户看的,与版本更新说明(updatedescription)无关。
|
|
string description = 38; //@go_tags(`gorm:"description" json:"description"`) 产品说明(特性描述)
|
|
//这款产品由哪家代工厂生产(oem_factory.id,0=未指定)。产品级是「默认由谁生产」,
|
|
//生产批次上还有一个 factoryid,那个是「这一批实际由谁生产」——换厂时批次能覆盖,产品不用改。
|
|
//⚠️ 字段名不能叫 factoryid:上面 34 号已被【老客户端兼容字段】占着,那个 factoryid 是
|
|
//「厂家→品牌商」改名前老 App 解析用的,值恒等于 brandid、由 user 模块读取层填充,
|
|
//复用它会让代工厂 id 被 brandid 覆盖掉。
|
|
//注意芯片没有产品级字段:芯片由 providerid → solution_provider.vendor 推导,
|
|
//存一份到产品上会在方案商换芯片时变成对不上的旧值,而 CID 是要烧进固件的。
|
|
uint32 oemfactoryid = 39; //@go_tags(`gorm:"oemfactoryid;index" json:"oemfactoryid"`) 代工厂id(0=未指定)
|
|
//固件升级判定放宽:开着时「设备版本 != 服务端版本」就允许升级,而不是只允许升到更高版本。
|
|
//给开发/测试环境用——测试机的固件常常比后台挂的还新,按「更高才升级」会永远点不动升级按钮,
|
|
//也没法把耳机刷回旧固件反复验证 OTA 流程。
|
|
//⚠️ 正式产品别开:一次配置失误(比如后台挂了个旧版固件)就会把全量用户降级。
|
|
bool updateonmismatch = 40; //@go_tags(`gorm:"updateonmismatch" json:"updateonmismatch"`) 版本不一致即可升级(开发用,默认关)
|
|
// 批次未配置赠送时的回退(与 production_batch 同语义)。bindrewardvpitime 复用为 VIP 天数,
|
|
// bindrewardtranslate/bindrewardmeeting 不再读写。
|
|
int32 bindviplevel = 60; //@go_tags(`gorm:"bindviplevel" json:"bindviplevel"`) 绑定赠送VIP等级回退值(默认1)
|
|
int64 bindcompute = 61; //@go_tags(`gorm:"bindcompute" json:"bindcompute"`) 绑定赠送算力回退值(0=不送)
|
|
}
|
|
|
|
|
|
message DBProductVersion{
|
|
uint32 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 版本id
|
|
uint32 productid = 2; //@go_tags(`gorm:"productid;index" json:"productid"`) 产品id
|
|
string version = 3; //@go_tags(`gorm:"version;index" json:"version"`) 版本
|
|
string description = 4; //@go_tags(`gorm:"description" json:"description"`) 描述
|
|
string updatepackageaddress = 5; //@go_tags(`gorm:"updatepackageaddress" json:"updatepackageaddress"`) 更新包地址
|
|
}
|
|
|
|
//渠道分发配置(下发客户端)。后台数据源已从各应用业务库的 channelapp 表迁到
|
|
//console 主库的 channel_app 表(comm.ChannelApp,按 app_name 作用域),此消息只作下发结构。
|
|
message DBChannelApp{
|
|
int32 channel = 1; //@go_tags(`gorm:"channel;primaryKey" json:"channel"`) 渠道
|
|
string version = 2; //@go_tags(`gorm:"version" json:"version"`) 当前线上版本
|
|
string description = 3; //@go_tags(`gorm:"description" json:"description"`) 描述
|
|
string address = 4; //@go_tags(`gorm:"address" json:"address"`) 下载地址
|
|
bool tourists = 5; //@go_tags(`gorm:"tourists" json:"tourists"`) 是否开启游客登录
|
|
bool allowskipdevicebinding = 6; //@go_tags(`gorm:"allowskipdevicebinding" json:"allowskipdevicebinding"`) 是否允许跳过设备绑定
|
|
string paychannels = 7; //@go_tags(`gorm:"paychannels" json:"paychannels"`) 支付渠道 wxpay,alipay,paypal,google,apple
|
|
string minversion = 8; //@go_tags(`gorm:"minversion" json:"minversion"`) 最低支持版本,低于它需更新
|
|
bool forceupdate = 9; //@go_tags(`gorm:"forceupdate" json:"forceupdate"`) 强制更新开关(配合 minversion)
|
|
string changelog = 10; //@go_tags(`gorm:"changelog" json:"changelog"`) 更新日志
|
|
string reviewversion = 11; //@go_tags(`gorm:"reviewversion" json:"reviewversion"`) 审核中的版本号,客户端报此版本时可隐藏未过审功能
|
|
int32 status = 12; //@go_tags(`gorm:"status" json:"status"`) 上架状态 0草稿 1已上架 2审核中 3已下架
|
|
string touristsversion = 13; //@go_tags(`gorm:"touristsversion" json:"touristsversion"`) 游客登录生效版本号;非空时仅该版本客户端可见游客登录,其余版本一律隐藏
|
|
bool idverify = 14; //@go_tags(`gorm:"-" json:"idverify"`) 这一版客户端是否显示实名认证并按实名限制功能(服务端算好的结论,目前与 tourists 同值,见 comm.AppRelease.ShowIdVerify)
|
|
}
|
|
|
|
|
|
//授权码数据(按产品分表 license_<pid十六进制>;核心=productid+number 产品级全局序号)
|
|
message DBAuthCode {
|
|
string code = 1; //@go_tags(`gorm:"code;primaryKey" json:"code"`) 授权码ID
|
|
Codetype codetype = 2; //@go_tags(`gorm:"codetype" json:"codetype"`) 授权码类型 0:认证码 1:设备码
|
|
uint32 brandid = 3; //@go_tags(`gorm:"brandid;index" json:"brandid"`) 品牌商id
|
|
uint32 productid = 4; //@go_tags(`gorm:"productid;index:idx_product_mac" json:"productid"`) 产品id
|
|
int64 number = 5; //@go_tags(`gorm:"number;index" json:"number"`) 产品级全局序号
|
|
string batchno = 6; //@go_tags(`gorm:"batchno;size:16;index" json:"batchno"`) 生产批次号(短码,引用 production_batch.batchno)
|
|
int64 createtime = 7; //@go_tags(`gorm:"createtime" json:"createtime"`) 创建时间
|
|
int64 usedtime = 9; //@go_tags(`gorm:"usedtime" json:"usedtime"`) 使用时间
|
|
int32 status = 10; //@go_tags(`gorm:"status;index" json:"status"`) 状态 0:未使用 1:已使用 2:已过期
|
|
string uid = 11; //@go_tags(`gorm:"uid:50;index" json:"uid"`) 用户ID
|
|
string devicemac = 12; //@go_tags(`gorm:"devicemac;index:idx_product_mac" json:"devicemac"`) 地址
|
|
int32 disabled = 13; //@go_tags(`gorm:"disabled;index" json:"disabled"`) 封禁状态 0:正常 -1:禁用
|
|
string channelid = 14; //@go_tags(`gorm:"channelid;size:16;index" json:"channelid"`) 渠道商id(短码,生产时随批次落库;空=未分配渠道)
|
|
// ── 设备权益快照(首次绑定=激活时从生产批次固化,此后改批次不影响已激活设备)──
|
|
// 设备 VIP 期 = [usedtime, usedtime + vipdays*86400),按日历天连续走、解绑不暂停;
|
|
// 判定时按「当前绑定着且未到期」算,**不写用户表**,解绑无需回收。
|
|
int32 vipdays = 15; //@go_tags(`gorm:"vipdays" json:"vipdays"`) 设备赠送VIP天数(激活时快照,0=不送)
|
|
int32 viplevel = 16; //@go_tags(`gorm:"viplevel" json:"viplevel"`) 设备赠送VIP等级(1=VIP 2=VIP-Pro,激活时快照)
|
|
// 设备赠送算力:总量快照 + 已消耗。剩余 = computegrant - computeused。
|
|
// computeused 解绑**不重置**:设备算力是共用一份、随设备流转,重置等于换个账号就能无限刷。
|
|
int64 computegrant = 17; //@go_tags(`gorm:"computegrant" json:"computegrant"`) 设备赠送算力总量(激活时快照,0=不送)
|
|
int64 computeused = 18; //@go_tags(`gorm:"computeused" json:"computeused"`) 设备算力已消耗(解绑不重置)
|
|
}
|
|
|
|
|
|
//厂家公码(一厂家可有多码,每码独立启停且独立配置奖励;新用户扫码领奖励)
|
|
message DBFactoryPublicCode {
|
|
string code = 1; //@go_tags(`gorm:"column:code;size:32;primaryKey" json:"code"`) 公码(主键)
|
|
uint32 brandid = 2; //@go_tags(`gorm:"brandid;index" json:"brandid"`) 品牌商id
|
|
uint32 productid = 3; //@go_tags(`gorm:"productid;index" json:"productid"`) 关联产品id(仅作分类标识,奖励读本表字段)
|
|
string remark = 4; //@go_tags(`gorm:"remark" json:"remark"`) 备注(如批次/渠道说明)
|
|
int32 status = 5; //@go_tags(`gorm:"status;index" json:"status"`) 状态 0:启用 1:停用
|
|
uint32 maxuses = 6; //@go_tags(`gorm:"maxuses" json:"maxuses"`) 最大核销人数 0=不限
|
|
uint32 useduses = 7; //@go_tags(`gorm:"useduses" json:"useduses"`) 已核销人数
|
|
int64 expiretime = 8; //@go_tags(`gorm:"expiretime" json:"expiretime"`) 失效时间戳 0=永久
|
|
uint32 bindrewardvpitime = 9; //@go_tags(`gorm:"bindrewardvpitime" json:"bindrewardvpitime"`) 奖励VIP天数
|
|
uint32 bindrewardtranslate = 10; //@go_tags(`gorm:"bindrewardtranslate" json:"bindrewardtranslate"`) 奖励翻译分钟数
|
|
uint32 bindrewardmeeting = 11; //@go_tags(`gorm:"bindrewardmeeting" json:"bindrewardmeeting"`) 奖励会议分钟数
|
|
int64 createtime = 12; //@go_tags(`gorm:"createtime" json:"createtime"`) 创建时间
|
|
int64 updatetime = 13; //@go_tags(`gorm:"updatetime" json:"updatetime"`) 更新时间
|
|
}
|
|
|
|
//本地化商品名称
|
|
message DBGoodsLocal {
|
|
string lang = 1; //@go_tags(`gorm:"lang" json:"lang"`) 语言
|
|
string name = 2; //@go_tags(`gorm:"name" json:"name"`) 产品名称
|
|
string currency = 3; //@go_tags(`gorm:"currency" json:"currency"`) 货币符号
|
|
double price = 6; //@go_tags(`gorm:"price" json:"price"`) 产品价格
|
|
}
|
|
|
|
//支付商品
|
|
message DBGoods{
|
|
string id = 1; //@go_tags(`gorm:"id;primaryKey" json:"id"`) 产品id
|
|
bool enable = 2; //@go_tags(`gorm:"enable" json:"enable"`) 是否启用
|
|
string name = 3; //@go_tags(`gorm:"name" json:"name"`) 产品名称
|
|
string localname = 4; //@go_tags(`gorm:"localname" json:"localname"`) 产品本地名称 采用json存储 {"zh-CN":{"name":"中文名称","currency":"¥","price":100}}
|
|
int32 price = 6; //@go_tags(`gorm:"price" json:"price"`) 产品价格
|
|
UsageType usagetype = 7; //@go_tags(`gorm:"usagetype" json:"usagetype"`) 产品类型 0:普通产品 1:会员产品
|
|
int64 ainum = 8; //@go_tags(`gorm:"ainum" json:"ainum"`) AI资源点
|
|
int64 meetnum = 9; //@go_tags(`gorm:"meetnum" json:"meetnum"`) 会议使用量资源点
|
|
int64 tradenum = 10; //@go_tags(`gorm:"tradenum" json:"tradenum"`) 翻译资源点
|
|
int32 viptime = 11; //@go_tags(`gorm:"viptime" json:"viptime"`) 会员时间
|
|
int64 compute = 12; //@go_tags(`gorm:"compute" json:"compute"`) 发放算力(2026-09 起 ainum/meetnum/tradenum 不再发放)
|
|
}
|
|
|
|
//语音包管理
|
|
message DBWakeupVoice{
|
|
uint32 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 唤醒语音id
|
|
bool enable = 2; //@go_tags(`gorm:"enable" json:"enable"`) 是否启用
|
|
string name = 3; //@go_tags(`gorm:"name" json:"name"`) 唤醒语音名称
|
|
string desc = 4; //@go_tags(`gorm:"desc" json:"desc"`) 唤醒语音描述
|
|
string version = 5; //@go_tags(`gorm:"version;index" json:"version"`) 版本
|
|
string packagaddress = 6; //@go_tags(`gorm:"packagaddress" json:"packagaddress"`) 唤醒语音地址
|
|
}
|
|
|
|
//用户日志
|
|
message DBUserUseLog {
|
|
uint64 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 积分日志id
|
|
string uid = 2; //@go_tags(`gorm:"uid:50;index" json:"uid"`) 用户ID
|
|
int64 ts = 3; //@go_tags(`gorm:"ts;index" json:"ts"`) 记录时间
|
|
UserLogType logtype = 4; //@go_tags(`gorm:"logtype;index" json:"logtype"`) 日志类型
|
|
int64 addvipday = 5; //@go_tags(`gorm:"viptime" json:"addvipday"`) 会员时间
|
|
int64 addagentintegral = 6; //@go_tags(`gorm:"addagentintegral" json:"addagentintegral"`) 智能体资源点
|
|
int64 addtradesecond = 7; //@go_tags(`gorm:"addtradesecond" json:"addtradesecond"`) 翻译资源点使用时常
|
|
int64 addmeetsecond = 8; //@go_tags(`gorm:"addmeetsecond" json:"addmeetsecond"`) 会议使用时常
|
|
string extra = 9; //@go_tags(`gorm:"extra" json:"extra"`) 附加数据
|
|
// ── 算力记账(2026-09 起)。消耗为负、发放/调整为正;来源拆分三列之和 = compute 的绝对值 ──
|
|
int64 compute = 10; //@go_tags(`gorm:"compute" json:"compute"`) 本次算力变动(消耗为负)
|
|
int64 computedevice = 11; //@go_tags(`gorm:"computedevice" json:"computedevice"`) 从设备赠送额度扣的部分
|
|
int64 computeuser = 12; //@go_tags(`gorm:"computeuser" json:"computeuser"`) 从用户余额扣的部分
|
|
int64 computeover = 13; //@go_tags(`gorm:"computeover" json:"computeover"`) 超额部分(闸门关时余额不足仍放行的量)
|
|
string devicemac = 14; //@go_tags(`gorm:"devicemac;size:50" json:"devicemac"`) 扣了哪台设备(为空=未动设备额度)
|
|
}
|
|
|
|
//用户统计数据
|
|
message DBUserStatistics{
|
|
string uid = 1; //@go_tags(`gorm:"uid:50;primaryKey" json:"uid"`) 用户ID
|
|
int64 aichatnum = 2; //@go_tags(`gorm:"aichatnum" json:"aichatnum"`) AI聊天次数
|
|
int64 aichatuptoken = 3; //@go_tags(`gorm:"aichatuptoken" json:"aichatuptoken"`) AI聊天上报token
|
|
int64 aichatdowntoken = 4; //@go_tags(`gorm:"aichatdowntoken" json:"aichatdowntoken"`) AI聊天下行token
|
|
int64 meetnum = 5; //@go_tags(`gorm:"meetnum" json:"meetnum"`) 会议使用量资源点
|
|
int64 meettime = 6; //@go_tags(`gorm:"meettime" json:"meettime"`) 会议使用时常
|
|
int64 trademodel1num = 7; //@go_tags(`gorm:"trademodel1num" json:"trademodel1num"`) 翻译模式1次数
|
|
int64 trademodel1time = 8; //@go_tags(`gorm:"trademodel1time" json:"trademodel1time"`) 翻译模式1时常
|
|
int64 trademodel2num = 9; //@go_tags(`gorm:"trademodel2num" json:"trademodel2num"`) 翻译模式2次数
|
|
int64 trademodel2time = 10; //@go_tags(`gorm:"trademodel2time" json:"trademodel2time"`) 翻译模式2时常
|
|
int32 trademodel3num = 11; //@go_tags(`gorm:"trademodel3num" json:"trademodel3num"`) 翻译模式3次数
|
|
int64 trademodel3time = 12; //@go_tags(`gorm:"trademodel3time" json:"trademodel3time"`) 翻译模式3时常
|
|
int32 trademodel4num = 13; //@go_tags(`gorm:"trademodel4num" json:"trademodel4num"`) 翻译模式4次数
|
|
int64 trademodel4time = 14; //@go_tags(`gorm:"trademodel4time" json:"trademodel4time"`) 翻译模式4时常
|
|
int32 trademodel5num = 15; //@go_tags(`gorm:"trademodel5num" json:"trademodel5num"`) 翻译模式5次数
|
|
int32 tradewordcount = 16; //@go_tags(`gorm:"tradewordcount" json:"tradewordcount"`) 翻译文本长度
|
|
int64 computetotal = 17; //@go_tags(`gorm:"computetotal" json:"computetotal"`) 累计消耗算力
|
|
}
|
|
|
|
// App综合统计(日/月/年三张表共用同一结构)
|
|
message DBAppStat {
|
|
uint64 id = 1; //@go_tags(`gorm:"id;primaryKey;autoIncrement" json:"id"`) 主键
|
|
string stat_date = 2; //@go_tags(`gorm:"type:varchar(20);uniqueIndex" json:"stat_date"`) 统计日期 日:2006-01-02 月:2006-01 年:2006
|
|
// 支付统计
|
|
int64 pay_amount = 3; //@go_tags(`gorm:"pay_amount" json:"pay_amount"`) 支付金额(分)
|
|
int32 order_count = 22; //@go_tags(`gorm:"order_count" json:"order_count"`) 创建订单数
|
|
int32 pay_count = 4; //@go_tags(`gorm:"pay_count" json:"pay_count"`) 有效订单数(已支付)
|
|
int32 failed_order_count = 23; //@go_tags(`gorm:"failed_order_count" json:"failed_order_count"`) 失败订单数
|
|
int32 pay_user_count = 5; //@go_tags(`gorm:"pay_user_count" json:"pay_user_count"`) 付费用户数
|
|
// 发放资源统计
|
|
int64 add_vip_days = 6; //@go_tags(`gorm:"add_vip_days" json:"add_vip_days"`) 发放VIP天数
|
|
int64 add_ai_integral = 7; //@go_tags(`gorm:"add_ai_integral" json:"add_ai_integral"`) 发放AI积分
|
|
int64 add_trade_second = 8; //@go_tags(`gorm:"add_trade_second" json:"add_trade_second"`) 发放翻译时长(秒)
|
|
int64 add_meet_second = 9; //@go_tags(`gorm:"add_meet_second" json:"add_meet_second"`) 发放会议时长(秒)
|
|
// AI聊天消耗统计
|
|
int64 ai_chat_count = 10; //@go_tags(`gorm:"ai_chat_count" json:"ai_chat_count"`) AI聊天次数
|
|
int64 ai_up_token = 11; //@go_tags(`gorm:"ai_up_token" json:"ai_up_token"`) AI上行token
|
|
int64 ai_down_token = 12; //@go_tags(`gorm:"ai_down_token" json:"ai_down_token"`) AI下行token
|
|
// 翻译消耗统计
|
|
int64 trade_count = 13; //@go_tags(`gorm:"trade_count" json:"trade_count"`) 翻译次数
|
|
int64 trade_time = 14; //@go_tags(`gorm:"trade_time" json:"trade_time"`) 翻译时长消耗(秒)
|
|
int64 trade_words = 15; //@go_tags(`gorm:"trade_words" json:"trade_words"`) 翻译字数
|
|
// 会议消耗统计
|
|
int64 meet_count = 16; //@go_tags(`gorm:"meet_count" json:"meet_count"`) 会议次数
|
|
int64 meet_time = 17; //@go_tags(`gorm:"meet_time" json:"meet_time"`) 会议时长消耗(秒)
|
|
// 用户统计
|
|
int32 new_user_count = 18; //@go_tags(`gorm:"new_user_count" json:"new_user_count"`) 新增注册用户数
|
|
int32 login_count = 19; //@go_tags(`gorm:"login_count" json:"login_count"`) 登录次数
|
|
int32 active_user_count = 24; //@go_tags(`gorm:"active_user_count" json:"active_user_count"`) 活跃用户数(当期有登录行为)
|
|
int64 total_user_count = 25; //@go_tags(`gorm:"total_user_count" json:"total_user_count"`) 累计用户总数(快照)
|
|
int32 vip_user_count = 26; //@go_tags(`gorm:"vip_user_count" json:"vip_user_count"`) 当期新增VIP用户数
|
|
// 设备统计
|
|
int32 bind_device_count = 20; //@go_tags(`gorm:"bind_device_count" json:"bind_device_count"`) 绑定设备数(激活)
|
|
int32 active_device_count = 27; //@go_tags(`gorm:"active_device_count" json:"active_device_count"`) 活跃设备数(当期有使用)
|
|
int64 update_time = 21; //@go_tags(`gorm:"update_time" json:"update_time"`) 更新时间
|
|
}
|
|
|