user.proto 15 KB

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