user.proto 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577
  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.RecommendPersonListReply){
  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. // 发送消息扣费
  229. rpc SendMsgReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
  230. // 回看纸条扣费
  231. rpc LookBackScripReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
  232. // 发纸条扣费
  233. rpc CreateScripReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
  234. // 回纸条扣费
  235. rpc ReplyScripReduceCredit (common.PersonParam) returns (google.protobuf.Empty);
  236. // 解锁语音扣费
  237. rpc UnlockVoiceCredit (common.PersonParam) returns (google.protobuf.Empty);
  238. // 解锁图片扣费
  239. rpc UnlockPictureCredit (common.PersonParam) returns (google.protobuf.Empty);
  240. // 匹配扣费
  241. rpc MatchingCredit (common.PersonParam) returns (google.protobuf.Empty);
  242. // 通过类型获取表情包列表
  243. rpc FindMemeByType (common.MemeRequest) returns (common.MemeList){
  244. option (google.api.http) = {
  245. post: "/api/user/find/meme/type",
  246. body:"*"
  247. };
  248. };
  249. // 获取对方性别的聊天话题
  250. rpc FindChatTopic (common.FindChatTopicRequest) returns (common.ChatTopicList){
  251. option (google.api.http) = {
  252. post: "/api/user/find/topic",
  253. body:"*"
  254. };
  255. };
  256. // 随机表情包
  257. rpc RandomMeme (common.RandomNum) returns (common.CommonTextList){
  258. option (google.api.http) = {
  259. post: "/api/user/find/meme/random",
  260. body:"*"
  261. };
  262. };
  263. // 随机打招呼
  264. rpc RandomSwiftMessage (common.RandomNumAndSex) returns (common.CommonTextList){
  265. option (google.api.http) = {
  266. post: "/api/user/find/topic/random",
  267. body:"*"
  268. };
  269. };
  270. // 表情包分类名
  271. rpc FindMemeTitle (google.protobuf.Empty) returns (common.MemeTitleList){
  272. option (google.api.http) = {
  273. post: "/api/user/find/meme/title",
  274. body:"*"
  275. };
  276. };
  277. // 用户拉黑某人
  278. rpc UserSetBlackChat (common.RoomIDRequest) returns (google.protobuf.Empty){
  279. option (google.api.http) = {
  280. post: "/api/user/set/black",
  281. body:"*"
  282. };
  283. };
  284. // 用户删除房间
  285. rpc UserDeleteChat (common.RoomIDRequest) returns (google.protobuf.Empty){
  286. option (google.api.http) = {
  287. post: "/api/user/chat/delete",
  288. body:"*"
  289. };
  290. };
  291. // 聊天话题分类名
  292. rpc FindChatTopicTitle (google.protobuf.Empty) returns (common.MemeTitleList){
  293. option (google.api.http) = {
  294. post: "/api/user/find/chat/title",
  295. body:"*"
  296. };
  297. };
  298. // 用户充值
  299. rpc UserRecharge (UserRechargeRequest) returns (PayInfo){
  300. option (google.api.http) = {
  301. post: "/api/user/recharge",
  302. body:"*"
  303. };
  304. };
  305. // 充值套餐列表
  306. rpc FindRechargeList (google.protobuf.Empty) returns (RechargeList){
  307. option (google.api.http) = {
  308. post: "/api/user/recharge/list",
  309. body:"*"
  310. };
  311. };
  312. // 用户充值记录列表
  313. rpc FindPayList (FindPayOrderListRequest) returns (PayOrderList){
  314. option (google.api.http) = {
  315. post: "/api/user/pay/list",
  316. body:"*"
  317. };
  318. };
  319. // 举报某人
  320. rpc Report (common.ReportChatRequest) returns (google.protobuf.Empty){
  321. option (google.api.http) = {
  322. post: "/api/user/report",
  323. body:"*"
  324. };
  325. };
  326. // 查询推荐用户的数据
  327. rpc FindRecommendUserDBList (common.FindRecommendRequest) returns (common.PersonDBReply){};
  328. // 查询推荐人的列表
  329. rpc FindRecommendPersonList (FindRecommendPersonListRequest) returns (common.RecommendPersonListReply){
  330. option (google.api.http) = {
  331. post: "/api/user/list/recommend",
  332. body:"*"
  333. };
  334. };
  335. // 超过七天的头像列表
  336. rpc FindOverSevenDayAvatar (google.protobuf.Empty) returns (common.FindOverSevenDayAvatarReply){
  337. option (google.api.http) = {
  338. post: "/api/user/over/avatar/list",
  339. body:"*"
  340. };
  341. };
  342. // 获取匹配的头像数组以及数量
  343. rpc FindMatchingAvatarAndNum (google.protobuf.Empty) returns (FindMatchingAvatarAndNumReply){
  344. option (google.api.http) = {
  345. post: "/api/user/matching/message",
  346. body:"*"
  347. };
  348. };
  349. // 创建纸条
  350. rpc CreateScrip (CreateScripRequest) returns (common.ScripID){
  351. option (google.api.http) = {
  352. post: "/api/user/scrip/create",
  353. body:"*"
  354. };
  355. };
  356. // 删除纸条
  357. rpc DeleteScrip (DeleteScripRequest) returns (google.protobuf.Empty){
  358. option (google.api.http) = {
  359. post: "/api/user/scrip/delete",
  360. body:"*"
  361. };
  362. };
  363. // 查询自己的小纸条
  364. rpc FindMyScrip (UserFindScripRequest) returns (common.ScripReply){
  365. option (google.api.http) = {
  366. post: "/api/user/scrip/find/self",
  367. body:"*"
  368. };
  369. };
  370. // 查询别人的小纸条
  371. rpc FindOtherScrip (common.FindScripRequest) returns (common.ScripReply){
  372. option (google.api.http) = {
  373. post: "/api/user/scrip/find/other",
  374. body:"*"
  375. };
  376. };
  377. // 查询随机纸条列表
  378. rpc FindRecommendScrip (UserFindScripRequest) returns (common.ScripReply){
  379. option (google.api.http) = {
  380. post: "/api/user/scrip/find/recommend",
  381. body:"*"
  382. };
  383. };
  384. // 用户查看纸条
  385. rpc PersonLookScrip (PersonLookScripRequest) returns (google.protobuf.Empty){
  386. option (google.api.http) = {
  387. post: "/api/user/scrip/look",
  388. body:"*"
  389. };
  390. };
  391. // 用户点击回看
  392. rpc PersonClickLookBack (google.protobuf.Empty) returns (common.ScripInfo){
  393. option (google.api.http) = {
  394. post: "/api/user/scrip/look/back",
  395. body:"*"
  396. };
  397. };
  398. // 用户回复小纸条
  399. rpc PersonReplyScrip (ReplyScripRequest) returns (common.ChatRecordInfo){
  400. option (google.api.http) = {
  401. post: "/api/user/scrip/reply",
  402. body:"*"
  403. };
  404. };
  405. // 更新上次访问的小纸条
  406. rpc UpdateLastScripID (common.UpdateLastScripIDRequest) returns (google.protobuf.Empty){};
  407. // 获取假弹窗
  408. rpc GetWindowInfo (google.protobuf.Empty) returns (chat.WindowInfo){
  409. option (google.api.http) = {
  410. post: "/api/user/chat/window/get",
  411. body:"*"
  412. };
  413. };
  414. // 用户的每日免费数
  415. rpc GetUserFreeNum (google.protobuf.Empty) returns (UserFreeNum){
  416. option (google.api.http) = {
  417. post: "/api/user/free/num",
  418. body:"*"
  419. };
  420. };
  421. }
  422. message UserFreeNum{
  423. int64 replyScripNum = 1;// 今日可免费回复纸条的次数
  424. int64 createScripNum = 2;// 今日免费创建纸条的次数
  425. int64 matchingNum = 3;// 今日免费匹配数
  426. }
  427. message ReplyScripRequest {
  428. int64 scripId = 4;// 小纸条ID
  429. common.Message message = 5;// 回复内容 只需要提供 回复小纸条的内容 或 回复小纸条的素材链接
  430. string msgType = 6;
  431. }
  432. message PersonLookScripRequest{
  433. int64 scripId = 3;// 纸条id
  434. }
  435. message UserFindScripRequest {
  436. int64 nextId = 3;
  437. int64 offset = 4;
  438. }
  439. message DeleteScripRequest {
  440. int64 scripId = 1;// 纸条id
  441. }
  442. message CreateScripRequest {
  443. string text = 1;// 纸条内容
  444. string pictureUrl = 2; // 纸条背景图
  445. }
  446. message FindMatchingAvatarAndNumReply{
  447. int64 num = 1;// 匹配人数
  448. repeated string list = 2;// 头像列表
  449. }
  450. message FindRecommendPersonListRequest{
  451. string nextId = 1;
  452. int64 offset = 2;
  453. int64 sex = 5;// 性别(不筛选就是0)
  454. }
  455. message UserRechargeRequest{
  456. int64 RechargeTemplateId = 1;// 充值套餐ID
  457. }
  458. message RechargeList{
  459. repeated RechargeInfo list = 1;
  460. }
  461. message RechargeInfo{
  462. int64 id = 1;
  463. int64 price = 2;
  464. int64 credit = 3;// 积分
  465. int64 giveCredit = 4;// 赠送的积分
  466. string description = 5;// 描述
  467. string title = 6;// 标题
  468. }
  469. message InformationStatus{
  470. bool isFinishInformation = 1;//是否完善资料
  471. bool isGetAward = 2;// 是否领取奖励
  472. }
  473. message UserBalance{
  474. string id = 1; // id
  475. int64 credit = 2;// 积分
  476. }
  477. message UserFindChatListReply{
  478. repeated UserChatInfo list = 1;
  479. int64 nextId = 2;
  480. }
  481. message UserChatInfo{
  482. string personId = 2;// 用户ID
  483. int64 unreadNum = 3;// 用户未读数
  484. string lastContent = 4;// 上次发送内容
  485. int64 lastTime = 5;// 上次发送时间
  486. int64 likeability = 6;// 好感度
  487. int64 sex = 8;// 性别
  488. string avatarUrl = 9;// 头像
  489. string nickname = 10;// 昵称
  490. int64 age = 11;// 年龄
  491. int64 roomId = 12;// 房间号ID
  492. }
  493. message UserInfo{
  494. string id = 1; // id
  495. string nickname = 2;// 昵称
  496. string avatarUrl =3;// 头像链接
  497. int64 age = 4;// 年龄
  498. int64 sex = 5;// 性别
  499. string constellation = 6; // 星座
  500. int64 credit = 7;// 积分
  501. repeated int64 tagList = 8; // 标签
  502. string signature = 9; // 签名
  503. string introduceVoice = 10; // 介绍语音
  504. string province = 11;// 省
  505. string city = 12;// 市
  506. string area = 13;// 区
  507. int64 userId = 14;// 用户ID
  508. bool isBlack = 15;// 是否被封号
  509. }
  510. message KeyRequest{
  511. string key = 1;
  512. }
  513. message CreatePayRequest{
  514. int64 money = 1; // 支付金额 单位 分
  515. string type = 2; // 类型
  516. string openId = 3;
  517. string description = 4;
  518. string attach = 5;
  519. }
  520. message PayInfo{
  521. google.protobuf.Value payInfo = 1;
  522. int64 orderId = 2;
  523. }
  524. message PayOrderInfo{
  525. string userID = 1;
  526. int64 orderID = 2; // 订单的唯一ID
  527. int64 money = 3; // 支付金额 ,单位分
  528. string type = 4; // 类型
  529. string TransactionID = 5;
  530. string openId = 6;
  531. string description = 7;
  532. string status = 9;// 状态
  533. int64 payTime = 10;// 支付时间
  534. int64 createTime = 11;// 创建时间
  535. }
  536. message PayOrderList{
  537. repeated PayOrderInfo list = 1;
  538. int64 nextId = 2;
  539. }
  540. message FindPayOrderListRequest{
  541. int64 nextId = 1;
  542. int64 offset = 2;
  543. string status = 3;
  544. }
  545. message PayCallbackReply{
  546. bytes result = 1;
  547. }