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.
 
 
 
 
 
 

429 lines
18 KiB

syntax = "proto3";
option go_package = ".;pb";
import "user/user_db.proto";
import "db.proto";
import "enum.proto";
//登录请求
message UserSginReq{
SginTyoe stype = 1; //@go_tags(`json:"stype" example:"0" description:"登录方式“`) 登录方式
string mail = 2; //@go_tags(`json:"mail" example:"" description:"邮箱地址"`) 邮箱地址
string phone = 3; //@go_tags(`json:"phone" example:"" description:"手机号码“`) 手机号
string ttoken = 4; //@go_tags(`json:"ttoken" example:"" description:"第三方token"`) 第三方token
string vcode = 5; //@go_tags(`json:"vcode" example:"" description:"验证码"`) 验证码
string phonemodel = 10; //@go_tags(`json:"phonemodel" example:"" description:"设备型号"`) 手机型号
string phonemac = 11; //@go_tags(`json:"phonemac" example:"" description:"手机硬件id"`) 手机硬件id
string name = 20; //@go_tags(`gorm:"name:50" json:"name" example:"" description:"用户名"`) 用户名
string avatar = 21; //@go_tags(`gorm:"avatar" json:"avatar" example:"" description:"头像连接"`) 头像连接
string language = 22; //@go_tags(`json:"language" example:"en" description:"语言"`)
UserChannel channel = 23; //渠道
string version = 24; //版本号
}
message UserSginResp{
// 认证token
// 缓存在本地 可以通过token 登录
// example: 认证token
string token = 1; //@go_tags(`json:"token" example:"认证token" description:"认证token"`)
// 用户信息
// example:
DBUser user = 2; //@go_tags(`json:"user" description:"用户信息"`)
// 用户设备列表
// example:
repeated DBUserDivice devices = 3; //@go_tags(`json:"devices" description:"用户设备列表"`)
}
//验证码请求
message UserVerificationReq {
// 验证码类型“
// 选填,长度 11
// example: 0 邮箱验证 1 手机验证
int32 vtype = 1; //@go_tags(`json:"vtype" example:"0" description:"验证码类型 0 手机验证 1 邮箱验证“`)
// 目标地址
// 选填,长度 11
// example: 手机号/邮箱
string addr = 2; //@go_tags(`json:"addr" example:"" description:"手机号/邮箱"`)
}
//验证码请求
message UserVerificationResp {
}
//通过toke 登录 同意设备下可以持续登录,当更换设备后 登录会返回错误码,token已过期 需要转 sgin 登录请求
message UserGetInfoReq {
string version = 1; //版本号
UserChannel channel = 2; //渠道
}
message UserGetInfoResp {
// 用户信息
// example:
DBUser user = 1; //@go_tags(`json:"user" description:"用户信息"`)
// 用户设备列表
// example:
repeated DBUserDivice devices = 2; //@go_tags(`json:"devices" description:"用户设备列表"`)
}
//设置请求 此接口由于需要上传头像 只能支持字符串类型的参数
message UserSettingReq {
string name = 1; //@go_tags(`json:"name" example:"" description:"用户名"`) 用户名
string language = 2; //@go_tags(`json:"language" example:"en" description:"语言"`)
string image = 3; //@go_tags(`json:"image" example:"" description:"头像"`) 头像连接
string gender = 4; //@go_tags(`json:"gender" example:"1" description:"性别 1-男 2-女"`) 性别 1-男 2-女
}
message UserSettingResp {
string name = 1; //@go_tags(`json:"name" example:"用户名" description:"用户名"`)
string language = 2; //@go_tags(`json:"language" example:"en" description:"语言"`)
string avatar = 3; //@go_tags(`json:"avatar" example:"" description:"地址"`) 头像连接
int32 gender = 4; //@go_tags(`json:"gender" example:"1" description:"性别 1-男 2-女"`) 性别 1-男 2-女
}
//绑定耳机请求
message UserBindDeviceReq {
int32 pid = 1; //产品id
string code = 2; //授权码
string devicename = 3; //耳机名称
string devicemac = 4; //耳机名称地址
string version = 5; //版本号
}
//绑定耳机请求
message UserBindDeviceResp {
DBUserDivice device = 1; //绑定的耳机信息
bool isgiveaway = 2; //@go_tags(`gorm:"isgiveaway" json:"isgiveaway"`) 是否是第一次绑定
int32 viplv = 3; //@go_tags(`gorm:"viplv:50" json:"viplv"`) viplv
int64 vipexptime = 4; //@go_tags(`gorm:"vipexptime" json:"vipexptime"`) 会员过期时间
int64 aichatintegral = 5; //@go_tags(`gorm:"aichatintegral" json:"aichatintegral"`) ai聊天积分
int64 aichattotalintegral = 6; //@go_tags(`gorm:"aichattotalintegral" json:"aichattotalintegral"`) ai聊天总积分
int64 tradeintegral = 7; //@go_tags(`gorm:"tradeintegral" json:"tradeintegral"`) 翻译积分
int64 tradetotalintegral = 8; //@go_tags(`gorm:"tradetotalintegral" json:"tradetotalintegral"`) 翻译总积分
int64 meetintegral = 9; //@go_tags(`gorm:"meetintegral" json:"meetintegral"`) 会议积分
int64 meettotalintegral = 10; //@go_tags(`gorm:"meettotalintegral" json:"meettotalintegral"`) 会议总积分
int64 devicevipexptime = 11; //这台设备赋予的 VIP 到期时间(0=不送)
int32 deviceviplevel = 12; //这台设备赋予的 VIP 等级
int64 devicecomputeleft = 13; //这台设备剩余算力
}
//解绑定耳机请求
message UserUnBindDeviceReq {
uint64 id = 1; //设备id
}
//解绑定耳机请求
message UserUnBindDeviceResp {
}
//扫激活码(厂家公码)领取奖励请求
//新设计下激活码 = 厂家公码:每个用户一生仅可领取 1 次(任意厂家任意码均算)
message UserBindAuthCodeReq {
string code = 1; //激活码/公码(必填)
string devicename = 2; //[已废弃] 旧的逐设备激活码遗留字段,公码场景下忽略
string devicemac = 3; //[已废弃] 旧的逐设备激活码遗留字段,公码场景下忽略
}
//扫激活码(厂家公码)领取奖励响应
message UserBindAuthCodeResp {
DBUserDivice device = 1; //[已废弃] 公码场景下为空
bool isgiveaway = 2; //本次是否发放奖励
int32 viplv = 3; //VIP等级
int64 vipexptime = 4; //VIP过期时间
int64 tradeintegral = 5; //翻译积分
int64 tradetotalintegral = 6; //翻译总积分
int64 meetintegral = 7; //会议积分
int64 meettotalintegral = 8; //会议总积分
int64 addvipday = 9; //本次发放VIP天数
int64 addtradesecond = 10; //本次发放翻译秒数
int64 addmeetsecond = 11; //本次发放会议秒数
uint32 factoryid = 12; //奖励来源厂家id
uint32 productid = 13; //奖励来源产品id(公码上配置的分类标识)
}
//注销账号
message UserDelReq{
}
message UserDelResp{
}
//用户反馈
message UserFeedbackReq {
string message = 1;
}
message UserFeedbackResp {
}
//获取 app 的环境变量
message UserGetAppConfigReq{
}
message McpServer {
string servername = 1;
string url = 2;
MCPServerType type = 3; //@go_tags(`json:"type"`) 服务类型
string tools = 4; //@go_tags(`json:"tools"`) 工具列表
}
//获取 app 的环境变量
message UserGetAppConfigResp{
map<string,string> env = 1; //@go_tags(`json:"env"`) 時間
repeated DBAgent agents = 2; //@go_tags(`json:"agents"`) 時間
map<string,McpServer> mcps = 3; //@go_tags(`json:"mcps"`) 時間
repeated DBProduct products = 4; //@go_tags(`json:"products"`) 時間
}
//获取设备信息 校验升级
message UserGetProductReq {
int32 id = 1;
}
message UserGetProductResp {
DBProduct product = 1;
}
//获取产品对应的固件版本列表
message UserGetProductVersionsReq {
uint32 pid = 1; //@go_tags(`json:"pid"`) 产品id
}
message UserGetProductVersionsResp {
repeated DBProductVersion versions = 1; //@go_tags(`json:"versions"`) 固件版本列表
}
//举报AI内容
message UserReportAIContentReq{
string reporttype = 1;
string describe =2;
repeated string message = 3;
string reportContent = 4;
}
message UserReportAIContentResp{
}
//获取设备信息 校验升级
message UserGetChannelAppsReq {
string version = 1; //客户端当前版本号(如 1.4.2)。游客登录是否可见由服务端按此版本判定,留空视为不匹配任何「游客登录生效版本」
}
message UserGetChannelAppsResp {
repeated DBChannelApp apps = 1;
}
//获取渠道包信息 + 校验升级
message UserGetChannelAppReq {
int32 channel = 1;
string version = 2; //客户端当前版本号(如 1.4.2);传了才会返回下面的升级判定,留空则判定字段恒为 false
}
message UserGetChannelAppResp {
DBChannelApp app = 1;
bool needupdate = 2; //有更新可用:线上版本高于客户端版本
bool forceupdate = 3; //必须更新:渠道开了强更且客户端版本低于最低支持版本,为 true 时客户端应阻断使用
bool reviewing = 4; //客户端当前版本正处于渠道审核期,可据此隐藏未过审功能
}
//用户上报行为
message UserPushActionReq{
map<string,int32> actions = 1; //行为
}
message UserPushActionResp{
}
//获取设备信息 校验升级
message UserGetDevicesReq {
}
message UserGetDevicesResp {
repeated DBUserDivice devices = 1;
}
//上传资源使用
message UserUsagesReq {
UsageType usagetype = 1; //使用类型
map<string,int64> usages = 2; //用量统计数据(翻译:各模式秒数;会议:MEETING_ASR_AUDIO_SECONDS;AI:可不传,改用下面两项)
int64 upchars = 3; //AI 对话本次输入字符数(Unicode 码点,仅 usagetype=AI 时有效)
int64 downchars = 4; //AI 对话本次输出字符数(同上)
}
message UserUsagesResp {
map<int32,int64> usages = 1; //【兼容】旧三桶剩余量,2026-09 起恒为 0,老客户端仍按此字段解析
int64 compute = 2; //本次扣减的算力
int64 computedeviceleft = 3; //当前绑定设备的剩余算力合计
int64 computeuserleft = 4; //用户自有算力余额
int64 over = 5; //超额(闸门关时余额不足仍放行的部分;闸门开时恒为 0)
}
//获取会员与算力状态(客户端「用量」页一次拿齐,客户端不做任何换算)
message UserGetComputeReq {
}
message UserComputeVipInfo {
int32 level = 1; //实际 VIP 等级 = max(自购, 设备赋予);0 = 无 VIP
int64 exptime = 2; //实际到期时间(自购与各设备取最晚)
int64 selfexptime = 3; //自购 VIP 到期时间
repeated UserDeviceVipInfo devices = 4; //各绑定设备赋予的 VIP
}
message UserDeviceVipInfo {
string devicemac = 1;
string devicename = 2;
int32 level = 3;
int64 exptime = 4; //usedtime + vipdays*86400
int64 computegrant = 5; //设备赠送算力总量
int64 computeused = 6; //已消耗
}
message UserComputeInfo {
int64 deviceleft = 1; //各绑定设备剩余算力合计
int64 userbalance = 2; //用户自有余额
int64 totalused = 3; //累计消耗
int64 monthused = 4; //本月消耗
}
message UserComputeRates {
int64 translate = 1; //算力 / 分钟
int64 meeting = 2; //算力 / 分钟
int64 aichat = 3; //算力 / 100 字
bool gate = 4; //算力闸门是否开启
// 运营阈值(后台可配,客户端据此提前提示;0 = 不提示)
int32 vipwarndays = 5; //VIP 到期前多少天开始提示
int64 computewarn = 6; //算力低于多少时开始提示
}
message UserGetComputeResp {
UserComputeVipInfo vip = 1;
UserComputeInfo compute = 2;
UserComputeRates rates = 3;
}
//获取唤醒词列表
message UserGetWakeupVoicesReq{
}
message UserGetWakeupVoicesResp{
repeated DBWakeupVoice voices = 1;
}
//获取统计数据
message UserGetStatisticsReq{
}
message UserGetStatisticsResp{
DBUserStatistics statistics = 1;
}
//获取应用设置
message UserGetAppSettingReq{
}
message UserGetAppSettingResp{
DBUuserAppSetting setting = 1;
}
//更新应用设置
message UserUpdateAppSettingReq{
DBUuserAppSetting setting = 1;
}
message UserUpdateAppSettingResp{
}
//更新设备设置
message UserUpdateDeviceSettingReq{
uint64 id = 1;
string lxsetting = 2;
}
message UserUpdateDeviceSettingResp{
uint64 id = 1;
string lxsetting = 2;
}
//实名认证:提交姓名+身份证号做二要素核验
//路由 user_idverify
message UserIdVerifyReq{
string realname = 1; //姓名
string idcardno = 2; //身份证号(18位;仅用于向服务商核验,服务端不落库全文)
}
message UserIdVerifyResp{
bool verified = 1; //是否核验通过
string realname = 2; //姓名
string idcardmask = 3; //身份证号掩码,如 4403**********1234
int64 verifytime = 4; //通过时间
int32 gender = 5; //按身份证解析出的真实性别 1-男 2-女(0=解析不出),核验通过后已写入用户资料
}
//查询本账号的实名状态
//路由 user_getidverify
message UserGetIdVerifyReq{
}
message UserGetIdVerifyResp{
bool verified = 1; //是否已实名
string realname = 2; //姓名(未实名为空)
string idcardmask = 3; //身份证号掩码(未实名为空)
int64 verifytime = 4; //通过时间(0=未通过)
}
//实时机器翻译(同声传译 / 面对面翻译用)
//
//由服务端调用后台「第三方服务配置」里启用的 MT 服务(类别3),
//云账号凭据因此不必下发到客户端。
//路由 user_translate
message UserTranslateReq{
string text = 1; //待翻译原文
string from = 2; //源语言(BCP-47,如 zh-CN;服务端会归一成服务商要的短码)。**留空 = 自动检测**
string to = 3; //目标语言(BCP-47)
}
message UserTranslateResp{
string text = 1; //译文
string provider = 2; //实际使用的服务商,便于排查
string svcid = 3; //实际使用的服务配置 id
string detected_from = 4;//from 传空(自动检测)时,服务商检测出的源语种短码;否则为空
}
//请求文件上传地址(录音、聊天图片等一切客户端产生的文件)
//
//客户端**不再持有对象存储的长期密钥**:由服务端读【第三方服务配置 → 存储】
//里启用的阿里云 OSS 配置,签发一个短时效的预签名 PUT URL,客户端拿着它直传。
//object key 由服务端强制拼成 EAIMAR/User/<uid>/<scene>/<日期>/<随机>.<ext>,
//uid 取自会话不采信客户端,所以一个用户传不到别人的目录下。
//路由 user_getuploadurl
message UserGetUploadUrlReq{
string scene = 1; //用途,决定 object key 里那一段目录:LocalAudio(录音) / ChatImages(聊天图片)
string filename = 2; //原文件名,服务端只取它的扩展名,目录部分一律丢弃
string contenttype = 3; //可选。留空则由服务端按扩展名推断,推断结果随响应回带
}
message UserGetUploadUrlResp{
string uploadurl = 1; //预签名 PUT URL,客户端直接 PUT 文件体到这个地址
string url = 2; //上传成功后的访问地址(配了自定义域名就走域名)
string key = 3; //object key,排查用
string contenttype = 4; //⚠️ PUT 时必须带这个 Content-Type,它计入了签名,不一致会 403
int64 expiresec = 5; //预签名有效期(秒),超时要重新申请
}
//申请 MCP 访问令牌
//
//EMAI 助手在百炼那边调我们的 MCP 工具时,需要知道「这是哪个用户」。
//但这条路上没有任何地方能带用户身份:客户端连百炼只带百炼的 API Key,
//百炼调 MCP 的 Authorization 头是控制台里配死的、所有用户共用。
//唯一可行的通道是 Start 指令的 biz_params.user_defined_params(协议里明确说
//「透传给 agent 和 mcp 服务的参数」),它会作为工具参数交到 MCP 手上。
//
//⚠️ 因此这里签发的是**短时效、仅限 MCP 用途**的令牌,绝不能直接把登录 JWT
//丢进去——那东西等价于账号的全部权限,而这条链路要经过百炼(第三方)。
//本令牌即使泄露,也只能读该用户的会议纪要/待办这类只读工具。
//路由 user_getmcptoken
message UserGetMcpTokenReq{
}
message UserGetMcpTokenResp{
string token = 1; //@go_tags(`json:"token"`) 放进 biz_params.user_defined_params 交给百炼
int64 expiresat = 2; //@go_tags(`json:"expiresat"`) 过期时刻(unix秒),客户端据此提前续签
}