account.proto 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174
  1. syntax = "proto3";
  2. package api.account;
  3. import "google/api/annotations.proto";
  4. import "api/common/common.proto";
  5. //import "api/base/base.proto";
  6. //import "google/protobuf/struct.proto";
  7. import "google/protobuf/empty.proto";
  8. option go_package = "git.ikuban.com/server/pw-protobuf/api/account;account";
  9. option java_multiple_files = true;
  10. option java_package = "api.account";
  11. service Account {
  12. rpc DebugLogin (DebugLoginRequest) returns (TokenReply){
  13. option (google.api.http) = {
  14. post: "/api/login/debug",
  15. body:"*"
  16. };
  17. };
  18. rpc Authorization (AuthorizationRequest) returns (TokenReply){
  19. option (google.api.http) = {
  20. post: "/api/login/authorization",
  21. body:"*"
  22. };
  23. };
  24. rpc RandomNickname (common.SexReq) returns (RandomNicknameReply){
  25. option (google.api.http) = {
  26. post: "/api/common/random/nickname",
  27. body:"*"
  28. };
  29. };
  30. rpc RandomAvatar (common.SexReq) returns (RandomAvatarReply){
  31. option (google.api.http) = {
  32. post: "/api/common/random/avatar",
  33. body:"*"
  34. };
  35. };
  36. rpc RandomAvatarList (common.SexReq) returns (RandomAvatarListReply){};
  37. // 通过openID和appID查询
  38. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  39. // 通过openID和appID查询 未查到就创建
  40. rpc GetIdentityByOpenIDAndAppIDAndCreate (OpenIDAndAppIDRequest) returns (IdentityInfo);
  41. // 通过分组名和性别查询标签
  42. rpc FindTagListBySex (common.SexReq) returns (common.TagListReply);
  43. // 通过标签IDs查询标签
  44. rpc FindTagsByIDs (common.Ids) returns (common.TagListReply);
  45. // 随机介绍接口
  46. rpc RandomIntroduce (common.SexReq) returns (common.RandomIntroduceReply){
  47. option (google.api.http) = {
  48. post: "/api/common/random/introduce",
  49. body:"*"
  50. };
  51. };
  52. // 通过微信下载语音并上传到七牛
  53. rpc UploadMaterialVoice (MediaID) returns (MaterialLink){
  54. option (google.api.http) = {
  55. post: "/api/common/material/upload/voice",
  56. body:"*"
  57. };
  58. };
  59. // 通过类型获取表情包列表
  60. rpc FindMemeByType (common.MemeRequest) returns (common.MemeList){};
  61. // 获取对方性别的聊天话题
  62. rpc FindChatTopic (common.FindChatTopicRequest) returns (common.ChatTopicList){};
  63. // 随机表情包
  64. rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){};
  65. // 随机打招呼
  66. rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){};
  67. // 检查文本-百度云
  68. rpc CheckText (CheckTextRequest) returns (CheckTextReply){}
  69. // 获取用户登录配置
  70. rpc GetUserLoginConfig (common.GetLoginConfigRequest) returns (common.GetLoginConfigReply){
  71. option (google.api.http) = {
  72. post: "/api/login/config",
  73. body:"*"
  74. };
  75. };
  76. // 通过accountID获取Identify信息
  77. rpc GetIdentifyByAccountID (GetIdentifyByAccountIDRequest) returns (GetIdentifyByAccountIDReply){};
  78. // 用户关注
  79. rpc UserSubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  80. // 用户取关
  81. rpc UserUnsubscribe (OpenIDAndAppIDRequest) returns (google.protobuf.Empty){};
  82. }
  83. message GetIdentifyByAccountIDRequest{
  84. int64 accountId = 1;
  85. string appid = 2;
  86. }
  87. message GetIdentifyByAccountIDReply{
  88. string openId = 1;
  89. string appid = 2;
  90. }
  91. message CheckTextRequest{
  92. string text = 1;// 待审核的文本
  93. }
  94. message CheckTextReply{
  95. bool isPass = 1;// 是否通过
  96. }
  97. message MediaID{
  98. string mediaId = 1;
  99. }
  100. message MaterialLink {
  101. string link = 1;
  102. }
  103. message RandomNicknameReply{
  104. string nickname = 1;
  105. }
  106. message RandomAvatarReply{
  107. string avatarUrl = 1;
  108. }
  109. message RandomAvatarListReply{
  110. repeated string list = 1;
  111. }
  112. message OpenIDAndAppIDRequest{
  113. string openId = 1;
  114. string appId = 2;
  115. }
  116. message IdentityInfo{
  117. string pid = 1;
  118. }
  119. message UserInfoDB{
  120. string id = 1; // id
  121. string nickname = 2;// 昵称
  122. string avatarUrl =3;// 头像链接
  123. string phone = 4;// 手机号
  124. int64 sex = 5;// 性别
  125. int64 credit = 6;// 积分
  126. }
  127. message PartnerInfoDB{
  128. string id = 1; // id
  129. string nickname = 2;// 昵称
  130. string avatarUrl =3;// 头像链接
  131. string phone = 4;// 手机号
  132. int64 sex = 5;// 性别
  133. int64 credit = 6;// 积分
  134. }
  135. message AuthorizationRequest {
  136. string jsCode = 1;
  137. string appId = 2;
  138. string type = 3;
  139. string fromOpenId = 4;
  140. int64 sex = 5;
  141. }
  142. message TokenReply {
  143. string token = 1;
  144. string appId = 2;
  145. }
  146. message DebugLoginRequest {
  147. int64 id = 1;
  148. string code = 2;
  149. }
  150. message LoginToken {
  151. string pid = 1;
  152. string type = 2;
  153. }