account.proto 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  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. // 通过openID和appID查询
  37. rpc GetIdentityByOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  38. // 通过type和PID查询
  39. rpc GetIdentityByTypeAndPID (common.PersonParam) returns (IdentityInfo);
  40. // 通过原公众号openID和appID查询
  41. rpc GetIdentityByFromOpenIDAndAppID (OpenIDAndAppIDRequest) returns (IdentityInfo);
  42. // 通过分组名和性别查询标签
  43. rpc FindTagListBySex (common.SexReq) returns (common.TagListReply);
  44. // 通过标签IDs查询标签
  45. rpc FindTagsByIDs (common.Ids) returns (common.TagListReply);
  46. // 随机介绍接口
  47. rpc RandomIntroduce (common.SexReq) returns (common.RandomIntroduceReply){
  48. option (google.api.http) = {
  49. post: "/api/common/random/introduce",
  50. body:"*"
  51. };
  52. };
  53. // 通过微信下载语音并上传到七牛
  54. rpc UploadMaterialVoice (MediaID) returns (MaterialLink){
  55. option (google.api.http) = {
  56. post: "/api/common/material/upload/voice",
  57. body:"*"
  58. };
  59. };
  60. // 通过类型获取表情包列表
  61. rpc FindMemeByType (common.MemeRequest) returns (common.MemeList){};
  62. // 获取对方性别的聊天话题
  63. rpc FindChatTopic (common.FindChatTopicRequest) returns (common.ChatTopicList){};
  64. // 随机表情包
  65. rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){};
  66. // 随机打招呼
  67. rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){};
  68. }
  69. message MediaID{
  70. string mediaId = 1;
  71. }
  72. message MaterialLink {
  73. string link = 1;
  74. }
  75. message RandomNicknameReply{
  76. string nickname = 1;
  77. }
  78. message RandomAvatarReply{
  79. string avatarUrl = 1;
  80. }
  81. message OpenIDAndAppIDRequest{
  82. string openId = 1;
  83. string appId = 2;
  84. }
  85. message IdentityInfo{
  86. string pid = 1;
  87. string type = 2;
  88. int64 identityID = 3;
  89. string openId = 4;
  90. }
  91. message UserInfoDB{
  92. string id = 1; // id
  93. string nickname = 2;// 昵称
  94. string avatarUrl =3;// 头像链接
  95. string phone = 4;// 手机号
  96. int64 sex = 5;// 性别
  97. int64 credit = 6;// 积分
  98. }
  99. message PartnerInfoDB{
  100. string id = 1; // id
  101. string nickname = 2;// 昵称
  102. string avatarUrl =3;// 头像链接
  103. string phone = 4;// 手机号
  104. int64 sex = 5;// 性别
  105. int64 credit = 6;// 积分
  106. }
  107. message AuthorizationRequest {
  108. string jsCode = 1;
  109. string appId = 2;
  110. string type = 3;
  111. string fromOpenId = 4;
  112. }
  113. message TokenReply {
  114. string token = 1;
  115. string appId = 2;
  116. }
  117. message DebugLoginRequest {
  118. int64 id = 1;
  119. string code = 2;
  120. }
  121. message LoginToken {
  122. string pid = 1;
  123. string type = 2;
  124. }