| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360 |
- syntax = "proto3";
- package api.ai;
- import "google/api/annotations.proto";
- import "google/protobuf/struct.proto";
- import "google/protobuf/empty.proto";
- option go_package = "git.ikuban.com/server/pw-protobuf/api/ai;ai";
- option java_multiple_files = true;
- option java_package = "api.ai";
- service Ai {
- // 查询AI模板
- rpc FindAITemplate (FindAITemplateRequest) returns (FindAITemplateReply){
- option (google.api.http) = {
- post: "/api/ai/template/list",
- body:"*"
- };
- };
- // 创建AI
- rpc CreateAIRobot (CreateAIRobotRequest) returns (AIRobotIDReply){
- option (google.api.http) = {
- post: "/api/ai/create",
- body:"*"
- };
- };
- // 销毁AI
- rpc DeleteAIRobot (AIRobotIDRequest) returns (google.protobuf.Empty){
- option (google.api.http) = {
- post: "/api/ai/delete",
- body:"*"
- };
- };
- // 更新AI
- rpc UpdateAIRobot (UpdateAIRobotRequest) returns (AIRobotIDReply){
- option (google.api.http) = {
- post: "/api/ai/update",
- body:"*"
- };
- };
- // 查询AI机器人列表
- rpc FindAIRobotList (FindAIRobotListRequest) returns (AIRobotList){
- option (google.api.http) = {
- post: "/api/ai/find/list",
- body:"*"
- };
- };
- // 查询AI机器人
- rpc GetAIRobot (AIRobotIDRequest) returns (AIRobotInfo){
- option (google.api.http) = {
- post: "/api/ai/find/info",
- body:"*"
- };
- };
- // 查询AI聊天记录
- rpc FindAIChatRecordList (FindAIChatRecordListRequest) returns (AIRecordListReply){
- option (google.api.http) = {
- post: "/api/ai/chat/record",
- body:"*"
- };
- };
- // 发送消息给ai
- rpc SendAIChat (SendAIChatRequest) returns (google.protobuf.Empty){
- option (google.api.http) = {
- post: "/api/ai/send",
- body:"*"
- };
- };
- // 查询额外服务列表
- rpc FindAdditionalServiceTemplateList (google.protobuf.Empty) returns (FindAdditionalServiceTemplateListReply){
- option (google.api.http) = {
- post: "/api/ai/service/list",
- body:"*"
- };
- };
- // 获取额外服务
- rpc GetAdditionalService (GetAdditionalServiceRequest) returns (GetAdditionalServiceReply){
- option (google.api.http) = {
- post: "/api/ai/service/get",
- body:"*"
- };
- };
- // 更新并创建额外服务
- rpc UpdateAdditionalService (UpdateAdditionalServiceRequest) returns (google.protobuf.Empty){
- option (google.api.http) = {
- post: "/api/ai/service/update",
- body:"*"
- };
- };
- // 查询用户的ai信息
- rpc FindUserAIMessage (google.protobuf.Empty) returns (FindUserAIMessageReply){
- option (google.api.http) = {
- post: "/api/ai/message",
- body:"*"
- };
- };
- // 定时执行服务
- rpc CronAdditionalService (google.protobuf.Empty) returns (google.protobuf.Empty){};
- // 用户已读
- rpc GetIsRead (GetIsReadRequest) returns (google.protobuf.Empty){};
-
- // 获取AI升级信息
- rpc GetAIShareMessage (GetAIShareMessageRequest) returns (GetAIShareMessageReply){
- option (google.api.http) = {
- post: "/api/share/ai/message",
- body:"*"
- };
- };
- // 获取二维码
- rpc GetShareQrcode (GetAIShareMessageRequest) returns (GetShareQrcodeReply){
- option (google.api.http) = {
- post: "/api/share/ai/qrcode",
- body:"*"
- };
- };
- // 保存视频链接
- rpc SetVideoLink (SetVideoLinkRequest) returns (google.protobuf.Empty){
- option (google.api.http) = {
- post: "/api/share/ai/link",
- body:"*"
- };
- };
- // vip直接升级
- rpc VipUpAI (GetAIShareMessageRequest) returns (google.protobuf.Empty){
- option (google.api.http) = {
- post: "/api/share/ai/vip",
- body:"*"
- };
- };
- // 用户受到邀请
- rpc ShareUserInto (ShareUserIntoRequest) returns (google.protobuf.Empty){};
- // vip直接升级
- rpc GetMiniProgramConf (google.protobuf.Empty) returns (GetMiniProgramConfReply){
- option (google.api.http) = {
- post: "/api/ai/share/conf",
- body:"*"
- };
- };
- // 获取ai订阅消息模板
- rpc GetAISubscribeMessage (google.protobuf.Empty) returns (GetAISubscribeMessageReply){
- option (google.api.http) = {
- post: "/api/ai/subscribe/id",
- body:"*"
- };
- };
- rpc CronSendAIMessage (google.protobuf.Empty) returns (google.protobuf.Empty){};
- }
- message GetAISubscribeMessageReply{
- repeated string linkSubscribeTemplateIds = 2;// 点击【提交链接】按钮收集
- repeated string shareSubscribeTemplateIds = 3;// 点击【立即邀请】按钮收集
- }
- message GetMiniProgramConfReply{
- string appid = 1;
- string path = 2;
- }
- message ShareUserIntoRequest{
- string openId = 1;// 用户openID
- int64 shareId = 2;// 分享ID
- }
- message SetVideoLinkRequest{
- string videoUrl = 1;
- string pictureUrl = 2;
- int64 robotId = 3;
- }
- message GetShareQrcodeReply{
- repeated string qrcodeUrl = 1;
- }
- message GetAIShareMessageRequest{
- string userId = 1;// 用户ID
- int64 robotId = 2;// 机器人ID
- }
- message GetAIShareMessageReply{
- int64 expirationTime = 1;// 过期时间
- repeated AIShareInfo list = 2;
- }
- message AIShareInfo{
- string title = 1;// 标题
- int64 price = 2;// 价格
- int64 originPrice = 3;// 原价
- string description = 4;// 描述
- string topLabel = 5;// 上面的标签 (例:限时免费)
- string underShowLabel = 6;// 下面的标签 (例:发短视频)
- string underHideLabel = 7;// 下面的标签 (例:点赞两次)
- bool isVip = 8;// 是否是vip
- int64 num = 9; // 分享数、点赞数
- int64 allNum = 10;// 总数
- string numDescription = 11;// num的描述
- bool isFinish = 12;// 是否完成
- int64 id = 13;
- string type = 14;
- bool isStart = 15;// 是否开启任务
- }
- message FindUserAIMessageReply{
- bool isFree = 1;// 创建是否免费
- int64 unreadNum = 2;// 未读数
- }
- message GetIsReadRequest{
- string userId = 1;
- int64 robotId = 2;
- }
- message UpdateAdditionalServiceRequest{
- int64 robotId = 1;// 机器人ID
- int64 templateId = 2;
- string word = 3;// 关键词
- bool isOpen = 4;// 是否开启
- repeated int64 day = 5;// 定时的天
- int64 hour = 6;// 定时小时
- }
- message GetAdditionalServiceRequest{
- int64 templateId = 1;// 对应列表的ID
- int64 robotId = 2;// 机器人ID
- }
- message GetAdditionalServiceReply{
- int64 id = 1;
- int64 robotId = 2;// 机器人ID
- string word = 3;// 关键词
- bool isOpen = 4;// 是否开启
- repeated int64 day = 5;// 定时的天
- int64 hour = 6;// 定时小时
- int64 templateId = 7;
- }
- message FindAdditionalServiceTemplateListReply{
- repeated AdditionalServiceTemplate list = 1;
- }
- message AdditionalServiceTemplate{
- int64 id = 1;// id
- string title = 2;// 名称
- string pictureUrl = 3;// 图片链接
- }
- message AIRobotIDReply{
- int64 id = 1;
- }
- message AIRecordListReply{
- repeated AIRecordInfo list = 1;
- int64 nextId = 2;
- }
- message AIRecordInfo{
- int64 messageId = 1; // 消息的ID
- string msgType = 2; // 消息类型
- Message message = 3; // 消息的结构
- int64 robotId = 4; // 机器人ID
- bool isSelf = 5; // 是否是自己
- int64 sendTime = 6; // 发送时间
- string status = 7; // 消息状态
- string statusMsg = 8;// 状态说明
- }
- message Message{
- string content = 1; // 文本内容
- }
- message SendAIChatRequest{
- int64 robotId = 1;
- Message message = 2; // 消息
- string msgType = 3;// 消息类型
- string websocketTag = 4;
- }
- message FindAIChatRecordListRequest{
- int64 nextId = 1;
- int64 offset = 2;
- int64 id = 3;
- }
- message AIRobotList{
- int64 nextId = 1;
- repeated AIRobotInfo list = 2;
- }
- message AIRobotInfo{
- int64 id = 1;
- string name = 2;// ai名称
- string avatarUrl = 3;// ai头像
- int64 sex = 4;// ai性别
- int64 age = 5;// ai年龄
- string constellation = 6;// ai星座
- int64 lastTime = 7;// 上次发送时间
- string lastContent = 8;// 上次发送的内容
- int64 unreadNum = 9;// 未读
- string status = 10;// 状态
- int64 createTime = 11;// 创建时间
- string userName = 12;// 用户名
- int64 expirationTime = 13;// 过期时间
- }
- message FindAIRobotListRequest{
- int64 nextId = 1;
- int64 offset = 2;
- }
- message UpdateAIRobotRequest{
- int64 id = 1;
- string aiName = 2;// 自定义ai名称
- string userName = 3;// ai对我的称呼
- }
- message AIRobotIDRequest{
- int64 id = 1;
- }
- message FindAITemplateRequest{
- int64 nextId = 1;
- int64 offset = 2;
- int64 sex = 3;// 性别
- }
- message FindAITemplateReply{
- int64 nextId = 1;
- repeated AITemplateInfo list= 2;
- }
- message AITemplateInfo{
- int64 id = 1;// ai模板ID
- string name = 2;// ai名称
- string avatarUrl = 3;// ai头像
- int64 sex = 4;// ai性别
- int64 age = 5;// ai年龄
- repeated string label = 6;// ai标签
- string description = 7;// ai描述
- string constellation = 8;// ai星座
- repeated Relation relationList = 9;// ai关系列表
- string introduceVoice = 10; // 介绍语音
- }
- message Relation{
- int64 id = 1;// 关系ID
- string picture = 2;// 图片
- string relation = 3;// 关系
- }
- message CreateAIRobotRequest{
- int64 templateId = 1;// ai模板ID
- string aiName = 2;// 自定义ai名称
- string userName = 3;// ai对我的称呼
- int64 relationId = 4;// 关系ID
- }
- message SendNextNeedPayMessage{
- int64 robotId = 2;// 机器人ID
- }
|