friendRelation.ts 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import http from "@/api";
  2. /**
  3. * @name 好友关系管理模块
  4. */
  5. // 获取好友关系列表
  6. export const getFriendRelationList = (params: any) => {
  7. return http.post(`/api/friendRelation/list`, params);
  8. };
  9. // 添加好友
  10. export const addFriendRelation = (params: {
  11. friendName: string;
  12. friendPhone: string;
  13. remark?: string;
  14. relationType: string | number;
  15. couponList?: Array<{ couponId: string | number; quantity: number }>;
  16. }) => {
  17. return http.post(`/api/friendRelation/add`, params);
  18. };
  19. // 编辑好友信息
  20. export const updateFriendRelation = (params: {
  21. id: string | number;
  22. friendName: string;
  23. friendPhone: string;
  24. remark?: string;
  25. relationType: string | number;
  26. couponList?: Array<{ couponId: string | number; quantity: number }>;
  27. }) => {
  28. return http.post(`/api/friendRelation/update`, params);
  29. };
  30. // 删除好友
  31. export const deleteFriendRelation = (params: { id: string | number }) => {
  32. return http.post(`/api/friendRelation/delete`, params);
  33. };
  34. // 同意好友申请
  35. export const approveFriend = (params: { id: string | number }) => {
  36. return http.post(`/api/friendRelation/approve`, params);
  37. };
  38. // 拒绝好友申请
  39. export const rejectFriend = (params: { id: string | number; reason?: string }) => {
  40. return http.post(`/api/friendRelation/reject`, params);
  41. };