user.proto 11 KB

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