user.proto 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336
  1. syntax = "proto3";
  2. package api.user;
  3. import "google/api/annotations.proto";
  4. //import "google/protobuf/struct.proto";
  5. import "google/protobuf/empty.proto";
  6. import "api/chat/chat.proto";
  7. import "api/common/common.proto";
  8. import "api/statistics/statistics.proto";
  9. option go_package = "git.ikuban.com/server/pw-protobuf/api/user;user";
  10. option java_multiple_files = true;
  11. option java_package = "api.user";
  12. service User {
  13. // 更新用户信息
  14. rpc UpdateUserInformation (common.UpdateInformationRequest) returns (google.protobuf.Empty){
  15. option (google.api.http) = {
  16. post: "/api/user/update/information",
  17. body:"*"
  18. };
  19. };
  20. // 获取用户详情
  21. rpc GetUserInfo (google.protobuf.Empty) returns (UserInfo){
  22. option (google.api.http) = {
  23. post: "/api/user/info",
  24. body:"*"
  25. };
  26. };
  27. // 获取用户详情
  28. rpc GetUserDBMsg (common.PersonIDParam) returns (common.PersonMsg);
  29. // 用户发送验证码
  30. rpc SendPhoneCode (common.SendPhoneCodeRequest) returns (google.protobuf.Empty){
  31. option (google.api.http) = {
  32. post: "/api/user/code/send",
  33. body:"*"
  34. };
  35. };
  36. // 用户验证验证码
  37. rpc CheckPhoneCode (common.CheckPhoneCodeRequest) returns (google.protobuf.Empty){
  38. option (google.api.http) = {
  39. post: "/api/user/code/check",
  40. body:"*"
  41. };
  42. };
  43. // 检查用户是否与接待员关联
  44. rpc CheckUserPartnerIsRelationship (common.PartnerIDParam) returns (chat.CheckUserPartnerIsRelationshipReply){
  45. option (google.api.http) = {
  46. post: "/api/user/check/relationship",
  47. body:"*"
  48. };
  49. };
  50. // 创建用户与接待员的关联
  51. rpc CreateUserPersonRoom (common.PersonParam) returns (chat.RoomReply){
  52. option (google.api.http) = {
  53. post: "/api/user/create/room",
  54. body:"*"
  55. };
  56. };
  57. // 获取接待员的确认通过页面信息
  58. rpc GetPartnerCircleInfo (KeyRequest) returns (common.AddFriendMessageInfo){
  59. option (google.api.http) = {
  60. post: "/api/user/circle/info",
  61. body:"*"
  62. };
  63. };
  64. // 用户获取主页信息
  65. rpc UserGetHomeInfo (common.PersonParam) returns (common.HomeInfo){
  66. option (google.api.http) = {
  67. post: "/api/user/home",
  68. body:"*"
  69. };
  70. };
  71. // 通过用户IDs查看用户信息列表
  72. rpc FindUserDBList (common.PersonIDList) returns (common.PersonDBReply);
  73. // 查看看过我的列表
  74. rpc FindLookList (common.ListPageRequest) returns (statistics.LookAndLikeListReply){
  75. option (google.api.http) = {
  76. post: "/api/user/list/look",
  77. body:"*"
  78. };
  79. };
  80. // 查看我喜欢的列表
  81. rpc FindLikeList (common.ListPageRequest) returns (statistics.LookAndLikeListReply){
  82. option (google.api.http) = {
  83. post: "/api/user/list/like",
  84. body:"*"
  85. };
  86. };
  87. // 查看喜欢我的列表
  88. rpc FindLikedList (common.ListPageRequest) returns (statistics.LookAndLikeListReply){
  89. option (google.api.http) = {
  90. post: "/api/user/list/liked",
  91. body:"*"
  92. };
  93. };
  94. // 获取用户的访客数以及关注数
  95. rpc GetLookAndLikeStatisticsMessage (google.protobuf.Empty) returns (statistics.LookAndLikeMessageReply){
  96. option (google.api.http) = {
  97. post: "/api/user/num/like_look",
  98. body:"*"
  99. };
  100. };
  101. // 微信SDK初始化
  102. rpc WxConf (common.WxConfReq) returns (common.WxConfResponse){
  103. option (google.api.http) = {
  104. post: "/api/wx/jssdk/config",
  105. body:"*"
  106. };
  107. };
  108. // 获取标签列表
  109. rpc FindTagListBySex (common.SexReq) returns (common.TagListReply){
  110. option (google.api.http) = {
  111. post: "/api/user/list/tag",
  112. body:"*"
  113. };
  114. };
  115. // 获取在线列表
  116. rpc FindOnlineList (common.ListPage2Request) returns (common.OnlinePersonListReply){
  117. option (google.api.http) = {
  118. post: "/api/user/list/online",
  119. body:"*"
  120. };
  121. };
  122. // 七天内列表(当前会话)
  123. rpc FindWithinSevenDayRoomList (common.ListPageRequest) returns (UserFindChatListReply){
  124. option (google.api.http) = {
  125. post: "/api/user/list/chat/within",
  126. body:"*"
  127. };
  128. };
  129. // 七天外列表(更早的聊天记录)
  130. rpc FindOverSevenDayRoomList (common.ListPageRequest) returns (UserFindChatListReply){
  131. option (google.api.http) = {
  132. post: "/api/user/list/chat/over",
  133. body:"*"
  134. };
  135. };
  136. // 用户获取ta的主页访客、关注数
  137. rpc UserGetPersonLikedAndLooked (common.PersonParam) returns (common.LookedAndLikedNum){
  138. option (google.api.http) = {
  139. post: "/api/user/num",
  140. body:"*"
  141. };
  142. };
  143. // 获取用户的金额信息
  144. rpc GetUserBalance (google.protobuf.Empty) returns (UserBalance){
  145. option (google.api.http) = {
  146. post: "/api/user/balance",
  147. body:"*"
  148. };
  149. };
  150. // 获取用户访问数详情
  151. rpc GetUserLookNum (google.protobuf.Empty) returns (statistics.LookMessageReply){
  152. option (google.api.http) = {
  153. post: "/api/user/look/num",
  154. body:"*"
  155. };
  156. };
  157. // 用户查询聊天记录
  158. rpc FindChatRecordList (common.FindChatRecordListRequest) returns (common.ChatRecordListReply){
  159. option (google.api.http) = {
  160. post: "/api/user/chat/record",
  161. body:"*"
  162. };
  163. };
  164. // 用户查询房间信息
  165. rpc FindChatRoomMsg (common.FindChatRoomMsgRequest) returns (common.ChatRoomMsg){
  166. option (google.api.http) = {
  167. post: "/api/user/chat/room/msg",
  168. body:"*"
  169. };
  170. };
  171. // 用户查询是否关注某人
  172. rpc GetUserIsLike (common.PersonParam) returns (common.IsLike){
  173. option (google.api.http) = {
  174. post: "/api/user/islike",
  175. body:"*"
  176. };
  177. };
  178. // 用户完善资料
  179. rpc UserFinishInformation (google.protobuf.Empty) returns (google.protobuf.Empty){
  180. option (google.api.http) = {
  181. post: "/api/user/information/finish",
  182. body:"*"
  183. };
  184. };
  185. // 用户完善情况
  186. rpc UserInformationStatus (google.protobuf.Empty) returns (InformationStatus){
  187. option (google.api.http) = {
  188. post: "/api/user/information/status",
  189. body:"*"
  190. };
  191. };
  192. // 用户获取完善资料奖励
  193. rpc UserGetInformationAward(google.protobuf.Empty) returns (google.protobuf.Empty){
  194. option (google.api.http) = {
  195. post: "/api/user/information/award",
  196. body:"*"
  197. };
  198. };
  199. // 用户获取聊天对象的资料卡片
  200. rpc UserGetChatCard(common.PersonParam) returns (ChatCardInfo){
  201. option (google.api.http) = {
  202. post: "/api/user/chat/card",
  203. body:"*"
  204. };
  205. };
  206. // 用户关注某人
  207. rpc UserLike(common.PersonParam) returns (google.protobuf.Empty){
  208. option (google.api.http) = {
  209. post: "/api/user/like",
  210. body:"*"
  211. };
  212. };
  213. // 用户取关某人
  214. rpc UserUnLike(common.PersonParam) returns (google.protobuf.Empty){
  215. option (google.api.http) = {
  216. post: "/api/user/unlike",
  217. body:"*"
  218. };
  219. };
  220. // 解锁"看过我的"的记录
  221. rpc UnlockLookRecord (common.PersonParam) returns (google.protobuf.Empty){
  222. option (google.api.http) = {
  223. post: "/api/user/look/unlock",
  224. body:"*"
  225. };
  226. };
  227. rpc SendMsgReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
  228. // 通过类型获取表情包列表
  229. rpc FindMemeByType (common.MemeRequest) returns (common.MemeList){
  230. option (google.api.http) = {
  231. post: "/api/user/find/meme/type",
  232. body:"*"
  233. };
  234. };
  235. // 获取对方性别的聊天话题
  236. rpc FindChatTopic (common.ListPageAndSexRequest) returns (common.ChatTopicList){
  237. option (google.api.http) = {
  238. post: "/api/user/find/topic",
  239. body:"*"
  240. };
  241. };
  242. // 随机表情包
  243. rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){
  244. option (google.api.http) = {
  245. post: "/api/user/find/meme/random",
  246. body:"*"
  247. };
  248. };
  249. // 随机打招呼
  250. rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){
  251. option (google.api.http) = {
  252. post: "/api/user/find/topic/random",
  253. body:"*"
  254. };
  255. };
  256. // 表情包分类名
  257. rpc FindMemeTitle (google.protobuf.Empty) returns (common.MemeTitleList){
  258. option (google.api.http) = {
  259. post: "/api/user/find/meme/title",
  260. body:"*"
  261. };
  262. };
  263. }
  264. message ChatCardInfo{
  265. string id = 1; // id
  266. string nickname = 2;// 昵称
  267. string avatarUrl =3;// 头像链接
  268. int64 sex = 4;// 性别
  269. int64 age = 6; // 年龄
  270. string constellation = 7; // 星座
  271. repeated common.TagList tagList = 9; // 标签列表
  272. string introduceVoice = 10; // 介绍语音
  273. string province = 11;// 省
  274. string city = 12;// 市
  275. string area = 13;// 区
  276. bool isFinishInformation = 14;//是否完善资料
  277. }
  278. message InformationStatus{
  279. bool isFinishInformation = 1;//是否完善资料
  280. bool isGetAward = 2;// 是否领取奖励
  281. }
  282. message UserBalance{
  283. string id = 1; // id
  284. int64 credit = 2;// 积分
  285. }
  286. message UserFindChatListReply{
  287. repeated UserChatInfo list = 1;
  288. int64 nextId = 2;
  289. }
  290. message UserChatInfo{
  291. string personId = 2;// 用户ID
  292. int64 unreadNum = 3;// 用户未读数
  293. string lastContent = 4;// 上次发送内容
  294. int64 lastTime = 5;// 上次发送时间
  295. int64 likeability = 6;// 好感度
  296. int64 sex = 8;// 性别
  297. string avatarUrl = 9;// 头像
  298. string nickname = 10;// 昵称
  299. int64 age = 11;// 年龄
  300. int64 roomId = 12;// 房间号ID
  301. }
  302. message UserInfo{
  303. string id = 1; // id
  304. string nickname = 2;// 昵称
  305. string avatarUrl =3;// 头像链接
  306. int64 age = 4;// 年龄
  307. int64 sex = 5;// 性别
  308. string constellation = 6; // 星座
  309. int64 credit = 7;// 积分
  310. repeated int64 tagList = 8; // 标签
  311. string signature = 9; // 签名
  312. string introduceVoice = 10; // 介绍语音
  313. string province = 11;// 省
  314. string city = 12;// 市
  315. string area = 13;// 区
  316. int64 userId = 14;// 用户ID
  317. }
  318. message KeyRequest{
  319. string key = 1;
  320. }