import request from "@/utils/request.js";
/**
 *
 * @param {*} data
 * @returns
 */
// 发布找款
export function findFundsAPI(data) {
  return request.post("findmoney/create", data);
}
// 找款列表
export function findFundsListAPI(data) {
  return request.get("findmoney/list/pending", data);
}
// 点赞/取消点赞找款订单
export function likeFundsAPI(orderId) {
  return request.get(`findmoney/like/${orderId}`);
}
// 获取用户找款订单
export function getUserFindFundsAPI(params) {
  return request.get(`findmoney/list/user`, params);
}
// 接单功能
export function acceptFindFundsAPI(orderId) {
  return request.get(`findmoney/accept/${orderId}`);
}

// 提交找款订单
export function submitFindFundsAPI(data) {
  return request.post(`findmoney/submit`, data);
}
// 取消找款订单
export function cancelFindFundsAPI(orderId) {
  return request.get(`findmoney/cancel/${orderId}`);
}
// 余料支付
export function paylFindFundsBalanceAPI(orderId, type = false, transport) {
  return request.get(`findmoney/pay/balance/${orderId}/${type}/${transport}`);
}
// 余额支付
export function BalanceMoneyAPI(orderId, addressId, isGold) {
  return request.get(`findmoney/pay/money/${orderId}/${addressId}/${isGold}`);
}
// 找款订单评分
export function submitFindFundsRateAPI(data) {
  return request.post(`findmoney/rate`, data);
}
// 获取找款订单详情
export function getFindFundsDetailAPI(orderId) {
  return request.get(`findmoney/detail/${orderId}`);
}
// 找款创建评论
export function addFundsComment(data) {
  return request.post(`find-money-order-comment/create`, data);
}
// 查询评论列表
export function getCommentOne(data) {
  return request.post(`find-money-order-comment/list`, data);
}
// 点爱心
export function setUserState(data) {
  return request.post(`find-money-order-comment/like`, data);
}
// 删除评论
export function deleteComment(commentId) {
  return request.get(`find-money-order-comment/delete/${commentId}`);
}
// 关注用户
export function followPublisher(orderId) {
  return request.get(`findmoney/follow/publisher/${orderId}`);
}
