user_http_pb.ts 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406
  1. // @ts-ignore
  2. import request from '@/libs/request';
  3. import {UserInfo,UserBalance,UserFindChatListReply,CreateScripRequest,DeleteScripRequest,UserFindScripRequest,PersonLookScripRequest,ReplyScripRequest,KeyRequest,InformationStatus,UserRechargeRequest,PayInfo,RechargeList,VipRechargeList,FindPayOrderListRequest,PayOrderList,FindMatchingAvatarAndNumReply,UserFreeNum,GetRandomMatchingRequest,SendMessageRequest,VipInfo,GetUserLookHandPickNumReply,IsCanGetReturnRewordReply,UserPrivacyStatusInfo,FindRecommendHighQualityUserRequest,FindRecommendHighQualityUserReply,GetUserDBMsgFromWebsocketReply,SendMsgReduceCreditRequest,UpdateUserMatchedNumRequest,UpdateUserMatchedNumAndReturnUserMsgReply,GetRecommendUserDBRequest,ReportUserBlackRequest,AddUserCreditRequest,UserGetInformationAwardByActivityRequest,UserGetInformationAwardByActivityReply,FindUserVipListDBReply,MatchUserDBWithoutMapRequest,UpdateTodayRequest,UpdateLastSendTemplateTimeRequest} from "./user_pb";
  4. import {SendPhoneCodeRequest,CheckPhoneCodeRequest,UpdateInformationRequest,CreateChatRoomParam,PersonParam,HomeInfo,LookedAndLikedNum,ListPageRequest,SexReq,TagListReply,ListPage2Request,RecommendPersonListReply,FindChatRecordListRequest,ChatRecordListReply,FindChatRoomMsgRequest,ChatRoomMsg,IsLike,MemeRequest,MemeList,FindChatTopicRequest,ChatTopicList,RandomNum,CommonTextList,RandomNumAndSex,MemeTitleList,ChatCardInfo,ReportChatRequest,FindOverSevenDayAvatarReply,UpdateLastScripIDRequest,ScripID,ScripReply,FindScripRequest,ScripInfo,ChatRecordInfo,RoomIDRequest,PartnerIDParam,AddFriendMessageInfo,SendMessageReply,HandpickPersonListReply,PersonIDParam,ScripIdRequest,CheckIdentifyRequest,CheckIdentifyReply,PersonMsg,PersonIDList,PersonDBReply,UpdateLastScripIDDBRequest,IDParam,PersonDB,GetUserDBAndInitReq,PersonDBDetails} from "../common/common_pb";
  5. import {RoomReply,UnreadNumReply,UserRoomInfo,CheckUserPartnerIsRelationshipReply,WindowInfo,GetRandomMatchingReply} from "../chat/chat_pb";
  6. import {LookAndLikeListReply,LookAndLikeMessageReply,LookMessageReply} from "../statistics/statistics_pb";
  7. const UserService = {
  8. /** 1、获取用户详情 */
  9. GetUserInfo: async (req?: undefined) => {
  10. const res = await request.post<{ data: UserInfo, code: string, message: string }>('/api/user/info', req);
  11. return res.data.data;
  12. },
  13. GetUserInfo1: async (req?: undefined) => {
  14. const res = await request.post<{ data: UserInfo, code: string, message: string }>('/api/user/info1', req);
  15. return res.data.data;
  16. },
  17. /** 2、用户发送验证码 */
  18. SendPhoneCode: async (req?: SendPhoneCodeRequest) => {
  19. const res = await request.post('/api/user/code/send', req);
  20. return res.data.data;
  21. },
  22. /** 3、用户验证验证码 */
  23. CheckPhoneCode: async (req?: CheckPhoneCodeRequest) => {
  24. const res = await request.post('/api/user/code/check', req);
  25. return res.data.data;
  26. },
  27. /** 4、更新用户信息 */
  28. UpdateUserInformation: async (req?: UpdateInformationRequest) => {
  29. const res = await request.post('/api/user/update/information', req);
  30. return res.data.data;
  31. },
  32. /** 5、创建用户与某人的关联 */
  33. CreateUserPersonRoom: async (req?: CreateChatRoomParam) => {
  34. const res = await request.post<{ data: RoomReply, code: string, message: string }>('/api/user/create/room', req);
  35. return res.data.data;
  36. },
  37. /** 6、获取用户的金额信息 */
  38. GetUserBalance: async (req?: undefined) => {
  39. const res = await request.post<{ data: UserBalance, code: string, message: string }>('/api/user/balance', req);
  40. return res.data.data;
  41. },
  42. /** 7、用户获取ta的主页信息 */
  43. UserGetHomeInfo: async (req?: PersonParam) => {
  44. const res = await request.post<{ data: HomeInfo, code: string, message: string }>('/api/user/home', req);
  45. return res.data.data;
  46. },
  47. /** 8、用户获取ta的主页访客、关注数 */
  48. UserGetPersonLikedAndLooked: async (req?: PersonParam) => {
  49. const res = await request.post<{ data: LookedAndLikedNum, code: string, message: string }>('/api/user/num', req);
  50. return res.data.data;
  51. },
  52. /** 9、查看看过我的列表 */
  53. FindLookList: async (req?: ListPageRequest) => {
  54. const res = await request.post<{ data: LookAndLikeListReply, code: string, message: string }>('/api/user/list/look', req);
  55. return res.data.data;
  56. },
  57. /** 11、获取标签列表 */
  58. FindTagListBySex: async (req?: SexReq) => {
  59. const res = await request.post<{ data: TagListReply, code: string, message: string }>('/api/user/list/tag', req);
  60. return res.data.data;
  61. },
  62. /** 12、获取在线列表 */
  63. FindOnlineList: async (req?: ListPage2Request) => {
  64. const res = await request.post<{ data: RecommendPersonListReply, code: string, message: string }>('/api/user/list/online', req);
  65. return res.data.data;
  66. },
  67. /** 13、七天内列表(当前会话) */
  68. FindWithinSevenDayRoomList: async (req?: ListPageRequest) => {
  69. const res = await request.post<{ data: UserFindChatListReply, code: string, message: string }>('/api/user/list/chat/within', req);
  70. return res.data.data;
  71. },
  72. /** 14、七天外列表(更早的聊天记录) */
  73. FindOverSevenDayRoomList: async (req?: ListPageRequest) => {
  74. const res = await request.post<{ data: UserFindChatListReply, code: string, message: string }>('/api/user/list/chat/over', req);
  75. return res.data.data;
  76. },
  77. /** 15、密友列表 */
  78. FindCloseFriendRoomList: async (req?: ListPageRequest) => {
  79. const res = await request.post<{ data: UserFindChatListReply, code: string, message: string }>('/api/user/list/chat/friend', req);
  80. return res.data.data;
  81. },
  82. /** 16、用户查询聊天记录 */
  83. FindChatRecordList: async (req?: FindChatRecordListRequest) => {
  84. const res = await request.post<{ data: ChatRecordListReply, code: string, message: string }>('/api/user/chat/record', req);
  85. return res.data.data;
  86. },
  87. /** 17、用户查询房间信息 */
  88. FindChatRoomMsg: async (req?: FindChatRoomMsgRequest) => {
  89. const res = await request.post<{ data: ChatRoomMsg, code: string, message: string }>('/api/user/chat/room/msg', req);
  90. return res.data.data;
  91. },
  92. /** 18、用户查询是否关注某人 */
  93. GetUserIsLike: async (req?: PersonParam) => {
  94. const res = await request.post<{ data: IsLike, code: string, message: string }>('/api/user/islike', req);
  95. return res.data.data;
  96. },
  97. /** 19、通过类型获取表情包列表 */
  98. FindMemeByType: async (req?: MemeRequest) => {
  99. const res = await request.post<{ data: MemeList, code: string, message: string }>('/api/user/find/meme/type', req);
  100. return res.data.data;
  101. },
  102. /** 20、获取对方性别的聊天话题 */
  103. FindChatTopic: async (req?: FindChatTopicRequest) => {
  104. const res = await request.post<{ data: ChatTopicList, code: string, message: string }>('/api/user/find/topic', req);
  105. return res.data.data;
  106. },
  107. /** 21、随机表情包 */
  108. RandomMeme: async (req?: RandomNum) => {
  109. const res = await request.post<{ data: CommonTextList, code: string, message: string }>('/api/user/find/meme/random', req);
  110. return res.data.data;
  111. },
  112. /** 22、随机打招呼 */
  113. RandomSwiftMessage: async (req?: RandomNumAndSex) => {
  114. const res = await request.post<{ data: CommonTextList, code: string, message: string }>('/api/user/find/topic/random', req);
  115. return res.data.data;
  116. },
  117. /** 23、表情包分类名 */
  118. FindMemeTitle: async (req?: undefined) => {
  119. const res = await request.post<{ data: MemeTitleList, code: string, message: string }>('/api/user/find/meme/title', req);
  120. return res.data.data;
  121. },
  122. /** 24、用户获取聊天对象的资料卡片 */
  123. UserGetChatCard: async (req?: PersonParam) => {
  124. const res = await request.post<{ data: ChatCardInfo, code: string, message: string }>('/api/user/chat/card', req);
  125. return res.data.data;
  126. },
  127. /** 25、聊天话题分类名 */
  128. FindChatTopicTitle: async (req?: undefined) => {
  129. const res = await request.post<{ data: MemeTitleList, code: string, message: string }>('/api/user/find/chat/title', req);
  130. return res.data.data;
  131. },
  132. /** 26、用户关注某人 */
  133. UserLike: async (req?: PersonParam) => {
  134. const res = await request.post('/api/user/like', req);
  135. return res.data.data;
  136. },
  137. /** 27、用户取关某人 */
  138. UserUnLike: async (req?: PersonParam) => {
  139. const res = await request.post('/api/user/unlike', req);
  140. return res.data.data;
  141. },
  142. /** 28、举报某人 */
  143. Report: async (req?: ReportChatRequest) => {
  144. const res = await request.post('/api/user/report', req);
  145. return res.data.data;
  146. },
  147. /** 29、超过七天的头像列表 */
  148. FindOverSevenDayAvatar: async (req?: undefined) => {
  149. const res = await request.post<{ data: FindOverSevenDayAvatarReply, code: string, message: string }>('/api/user/over/avatar/list', req);
  150. return res.data.data;
  151. },
  152. /** 30、更新上次访问的小纸条 */
  153. UpdateLastScripID: async (req?: UpdateLastScripIDRequest) => {
  154. const res = await request.post('/api/user/scrip/last/update', req);
  155. return res.data.data;
  156. },
  157. /** 31、创建纸条 */
  158. CreateScrip: async (req?: CreateScripRequest) => {
  159. const res = await request.post<{ data: ScripID, code: string, message: string }>('/api/user/scrip/create', req);
  160. return res.data.data;
  161. },
  162. /** 32、删除纸条 */
  163. DeleteScrip: async (req?: DeleteScripRequest) => {
  164. const res = await request.post('/api/user/scrip/delete', req);
  165. return res.data.data;
  166. },
  167. /** 33、查询自己的小纸条 */
  168. FindMyScrip: async (req?: UserFindScripRequest) => {
  169. const res = await request.post<{ data: ScripReply, code: string, message: string }>('/api/user/scrip/find/self', req);
  170. return res.data.data;
  171. },
  172. /** 34、查询别人的小纸条 */
  173. FindOtherScrip: async (req?: FindScripRequest) => {
  174. const res = await request.post<{ data: ScripReply, code: string, message: string }>('/api/user/scrip/find/other', req);
  175. return res.data.data;
  176. },
  177. /** 35、查询随机纸条列表 */
  178. FindRecommendScrip: async (req?: UserFindScripRequest) => {
  179. const res = await request.post<{ data: ScripReply, code: string, message: string }>('/api/user/scrip/find/recommend', req);
  180. return res.data.data;
  181. },
  182. /** 36、用户查看纸条 */
  183. PersonLookScrip: async (req?: PersonLookScripRequest) => {
  184. const res = await request.post('/api/user/scrip/look', req);
  185. return res.data.data;
  186. },
  187. /** 37、用户点击回看 */
  188. PersonClickLookBack: async (req?: undefined) => {
  189. const res = await request.post<{ data: ScripInfo, code: string, message: string }>('/api/user/scrip/look/back', req);
  190. return res.data.data;
  191. },
  192. /** 38、用户回复小纸条 */
  193. PersonReplyScrip: async (req?: ReplyScripRequest) => {
  194. const res = await request.post<{ data: ChatRecordInfo, code: string, message: string }>('/api/user/scrip/reply', req);
  195. return res.data.data;
  196. },
  197. /** 39、用户删除房间 */
  198. UserDeleteChat: async (req?: RoomIDRequest) => {
  199. const res = await request.post('/api/user/chat/delete', req);
  200. return res.data.data;
  201. },
  202. /** 40、获取用户的总未读数 */
  203. GetUserAllUnreadNum: async (req?: undefined) => {
  204. const res = await request.post<{ data: UnreadNumReply, code: string, message: string }>('/api/user/chat/unread/num', req);
  205. return res.data.data;
  206. },
  207. /** 41、用户查询与某人的房间 */
  208. GetUserRoomByPerson: async (req?: PersonParam) => {
  209. const res = await request.post<{ data: UserRoomInfo, code: string, message: string }>('/api/user/room/info', req);
  210. return res.data.data;
  211. },
  212. /** 42、查看我喜欢的列表 */
  213. FindLikeList: async (req?: ListPageRequest) => {
  214. const res = await request.post<{ data: LookAndLikeListReply, code: string, message: string }>('/api/user/list/like', req);
  215. return res.data.data;
  216. },
  217. /** 43、查看喜欢我的列表 */
  218. FindLikedList: async (req?: ListPageRequest) => {
  219. const res = await request.post<{ data: LookAndLikeListReply, code: string, message: string }>('/api/user/list/liked', req);
  220. return res.data.data;
  221. },
  222. /** 44、用户拉黑某人 */
  223. UserSetBlackChat: async (req?: RoomIDRequest) => {
  224. const res = await request.post('/api/user/set/black', req);
  225. return res.data.data;
  226. },
  227. /** 45、检查用户是否与接待员关联 */
  228. CheckUserPartnerIsRelationship: async (req?: PartnerIDParam) => {
  229. const res = await request.post<{ data: CheckUserPartnerIsRelationshipReply, code: string, message: string }>('/api/user/check/relationship', req);
  230. return res.data.data;
  231. },
  232. /** 46、获取接待员的确认通过页面信息 */
  233. GetPartnerCircleInfo: async (req?: KeyRequest) => {
  234. const res = await request.post<{ data: AddFriendMessageInfo, code: string, message: string }>('/api/user/circle/info', req);
  235. return res.data.data;
  236. },
  237. /** 47、获取用户的访客数以及关注数 */
  238. GetLookAndLikeStatisticsMessage: async (req?: undefined) => {
  239. const res = await request.post<{ data: LookAndLikeMessageReply, code: string, message: string }>('/api/user/num/like_look', req);
  240. return res.data.data;
  241. },
  242. /** 48、获取用户访问数详情 */
  243. GetUserLookNum: async (req?: undefined) => {
  244. const res = await request.post<{ data: LookMessageReply, code: string, message: string }>('/api/user/look/num', req);
  245. return res.data.data;
  246. },
  247. /** 49、用户完善资料 */
  248. UserFinishInformation: async (req?: undefined) => {
  249. const res = await request.post('/api/user/information/finish', req);
  250. return res.data.data;
  251. },
  252. /** 50、用户完善情况 */
  253. UserInformationStatus: async (req?: undefined) => {
  254. const res = await request.post<{ data: InformationStatus, code: string, message: string }>('/api/user/information/status', req);
  255. return res.data.data;
  256. },
  257. /** 51、用户获取完善资料奖励 */
  258. UserGetInformationAward: async (req?: undefined) => {
  259. const res = await request.post('/api/user/information/award', req);
  260. return res.data.data;
  261. },
  262. /** 52、解锁"看过我的"的记录 */
  263. UnlockLookRecord: async (req?: PersonParam) => {
  264. const res = await request.post('/api/user/look/unlock', req);
  265. return res.data.data;
  266. },
  267. /** 53、用户充值 */
  268. UserRecharge: async (req?: UserRechargeRequest) => {
  269. const res = await request.post<{ data: PayInfo, code: string, message: string }>('/api/user/recharge', req);
  270. return res.data.data;
  271. },
  272. /** 54、用户充值vip */
  273. UserRechargeVip: async (req?: UserRechargeRequest) => {
  274. const res = await request.post<{ data: PayInfo, code: string, message: string }>('/api/user/recharge/vip', req);
  275. return res.data.data;
  276. },
  277. /** 55、充值套餐列表 */
  278. FindRechargeList: async (req?: undefined) => {
  279. const res = await request.post<{ data: RechargeList, code: string, message: string }>('/api/user/recharge/list', req);
  280. return res.data.data;
  281. },
  282. /** 56、充值Vip套餐列表 */
  283. FindVipRechargeList: async (req?: undefined) => {
  284. const res = await request.post<{ data: VipRechargeList, code: string, message: string }>('/api/user/recharge/vip/list', req);
  285. return res.data.data;
  286. },
  287. /** 57、用户充值记录列表 */
  288. FindPayList: async (req?: FindPayOrderListRequest) => {
  289. const res = await request.post<{ data: PayOrderList, code: string, message: string }>('/api/user/pay/list', req);
  290. return res.data.data;
  291. },
  292. /** 58、查询推荐人的列表 */
  293. FindRecommendPersonList: async (req?: undefined) => {
  294. const res = await request.post<{ data: RecommendPersonListReply, code: string, message: string }>('/api/user/list/recommend', req);
  295. return res.data.data;
  296. },
  297. /** 59、获取匹配的头像数组以及数量 */
  298. FindMatchingAvatarAndNum: async (req?: undefined) => {
  299. const res = await request.post<{ data: FindMatchingAvatarAndNumReply, code: string, message: string }>('/api/user/matching/message', req);
  300. return res.data.data;
  301. },
  302. /** 60、获取假弹窗 */
  303. GetWindowInfo: async (req?: undefined) => {
  304. const res = await request.post<{ data: WindowInfo, code: string, message: string }>('/api/user/chat/window/get', req);
  305. return res.data.data;
  306. },
  307. /** 61、用户的每日免费数 */
  308. GetUserFreeNum: async (req?: undefined) => {
  309. const res = await request.post<{ data: UserFreeNum, code: string, message: string }>('/api/user/free/num', req);
  310. return res.data.data;
  311. },
  312. /** 62、随机速配 */
  313. GetRandomMatching: async (req?: GetRandomMatchingRequest) => {
  314. const res = await request.post<{ data: GetRandomMatchingReply, code: string, message: string }>('/api/user/random/matching', req);
  315. return res.data.data;
  316. },
  317. /** 63、解锁语音扣费 */
  318. UnlockVoice: async (req?: RoomIDRequest) => {
  319. const res = await request.post('/api/user/unlock/voice', req);
  320. return res.data.data;
  321. },
  322. /** 64、解锁图片扣费 */
  323. UnlockPicture: async (req?: RoomIDRequest) => {
  324. const res = await request.post('/api/user/unlock/picture', req);
  325. return res.data.data;
  326. },
  327. /** 65、更新用户注册状态 */
  328. UpdateUserIsRegister: async (req?: undefined) => {
  329. const res = await request.post('/api/user/update/register', req);
  330. return res.data.data;
  331. },
  332. /** 66、创建用户与接待员的关联 */
  333. CreateUserPartnerRoom: async (req?: CreateChatRoomParam) => {
  334. const res = await request.post<{ data: RoomReply, code: string, message: string }>('/api/user/create/room/partner', req);
  335. return res.data.data;
  336. },
  337. /** 67、用户发送消息 */
  338. SendMessage: async (req?: SendMessageRequest) => {
  339. const res = await request.post<{ data: SendMessageReply, code: string, message: string }>('/api/user/message/send', req);
  340. return res.data.data;
  341. },
  342. /** 68、获取用户vip信息 */
  343. GetVipInfo: async (req?: undefined) => {
  344. const res = await request.post<{ data: VipInfo, code: string, message: string }>('/api/vip/info', req);
  345. return res.data.data;
  346. },
  347. /** 69、精选列表 */
  348. FindHandpickUser: async (req?: undefined) => {
  349. const res = await request.post<{ data: HandpickPersonListReply, code: string, message: string }>('/api/handpick/list', req);
  350. return res.data.data;
  351. },
  352. /** 70、查询用户查看精选表的次数 */
  353. GetUserLookHandPickNum: async (req?: undefined) => {
  354. const res = await request.post<{ data: GetUserLookHandPickNumReply, code: string, message: string }>('/api/user/look/handpick/num', req);
  355. return res.data.data;
  356. },
  357. /** 71、设置用户查看精选表的次数 */
  358. SetUserLookHandPickNum: async (req?: PersonIDParam) => {
  359. const res = await request.post('/api/user/look/handpick/num/set', req);
  360. return res.data.data;
  361. },
  362. /** 72、获取用户是能否领取回归奖励 */
  363. IsCanGetReturnReword: async (req?: undefined) => {
  364. const res = await request.post<{ data: IsCanGetReturnRewordReply, code: string, message: string }>('/api/user/return/reword/status', req);
  365. return res.data.data;
  366. },
  367. /** 73、用户领取回归奖励 */
  368. UserGetReturnReword: async (req?: undefined) => {
  369. const res = await request.post('/api/user/return/reword/get', req);
  370. return res.data.data;
  371. },
  372. /** 74、用户隐私状态 */
  373. UserPrivacyStatus: async (req?: undefined) => {
  374. const res = await request.post<{ data: UserPrivacyStatusInfo, code: string, message: string }>('/api/user/privacy/status', req);
  375. return res.data.data;
  376. },
  377. /** 75、用户设置隐私状态 */
  378. UserSetPrivacyStatus: async (req?: UserPrivacyStatusInfo) => {
  379. const res = await request.post('/api/user/privacy/set', req);
  380. return res.data.data;
  381. },
  382. /** 用户点赞小纸条 */
  383. PersonStarScrip: async (req?: ScripIdRequest) => {
  384. const res = await request.post<{ data: ChatRecordInfo, code: string, message: string }>('/api/user/scrip/star', req);
  385. return res.data.data;
  386. },
  387. /** 用户更新手机号 */
  388. UpdateUserPhone: async (req?: CheckPhoneCodeRequest) => {
  389. const res = await request.post('/api/user/update/phone', req);
  390. return res.data.data;
  391. },
  392. /** 清除用户的未读数 */
  393. CleanUserUnReadNum: async (req?: undefined) => {
  394. const res = await request.post('/api/user/chat/clean/unread', req);
  395. return res.data.data;
  396. },
  397. /** 实名认证 */
  398. Certification: async (req?: CheckIdentifyRequest) => {
  399. const res = await request.post<{ data: CheckIdentifyReply, code: string, message: string }>('/api/user/certification', req);
  400. return res.data.data;
  401. },
  402. };
  403. export default UserService;