// 商品管理模块

// // 商品相关

// 查询商品类目
export const categoryList = {
  url: '/category/categoryPermission/list',
  method: 'GET'
}
// 删除商品类目
export const categoryDelete = {
  url: '/category/categoryPermission/delete',
  method: 'DELETE',
  dealUrl: (url, categoryId) => {
    return `${url}/${categoryId}`
  }
}
// 新增商品类目
export const categorySave = {
  url: '/category/categoryPermission/save',
  method: 'POST',
  dealReqData: (addCate) => {
    return addCate
  }
}
// 修改商品类目
export const categoryUpdate = {
  url: '/category/categoryPermission/update',
  method: 'PUT',
  dealReqData: (eidtCate) => {
    return eidtCate
  }
}
// 获取快递模板列表
export const templateList = {
  url: '/template/templatePermission/list',
  method: 'GET'
}
// 获取外部未绑定token
export const unbindToken = {
  url: '/goods/unbindToken',
  method: 'GET'
}
// 获取商品Token前缀
export const getMerchantPrefix = {
  url: '/goods/merchantPrefix',
  method: 'GET'
}
// 新增商品
export const addGood = {
  url: '/goods/releaseGoods/add',
  method: 'POST',
  // dealReqData: ({ auctionDTO, categoryId, description, detail, imgList, name, note, pointsExchangeDTO, preSaleDTO, prop, returnReason, returnType, skuList, templateId, thumb, type, video, videoPoster }) => {
  //     return { auctionDTO, categoryId, description, detail, imgList, name, note, pointsExchangeDTO, preSaleDTO, prop, returnReason, returnType, skuList, templateId, thumb, type, video, videoPoster }
  // }
  dealReqData: (form) => {
    return form
  }
}
// 存为草稿
export const draftGood = {
  url: '/goods/releaseGoods/draft',
  method: 'POST',
  dealReqData: (form) => {
    return form
  }
}
// 获取商品列表
export const getGoodList = {
  url: '/goodsList/page',
  method: 'GET',
  dealReqData: ({ goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }) => {
    return { goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }
  }
}
// 获取商品审核列表
export const getGoodCheckList = {
  url: '/goods/goodsList/pagecheck',
  method: 'GET',
  dealReqData: ({ goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }) => {
    return { goodsId, goodsName, goodsType, status, addTimeHead, addTimeTail, pageNum, pageSize }
  }
}

// 上下架商品系列
export const onOffSeries = {
  url: '/goodsList/onOff',
  method: 'PUT',
  dealReqData: ({ goodsId, type }) => {
    return { goodsId, type }
  }
}

// 删除商品
export const deleteGood = {
  url: '/goodsList/deleteBatch',
  method: 'DELETE'
}

// 获取商品详情
export const getGoodDetail = {
  url: '/goodsList/detail',
  method: 'GET',
  dealReqData: ({ goodsId }) => {
    return { goodsId }
  }
}
// 查询是否已建模板或店铺
export const templateorshopquery = {
  url: '/goods/releaseGoods/templateorshopquery',
  method: 'GET'
}
// 打包商品-根据商品编号或名称获取商品信息
export const spugetbyvague = {
  url: '/goods/releaseGoods/spugetbyvague',
  method: 'GET',
  dealUrl: (url, goodsInfo) => {
    return `${url}?goodsInfo=${goodsInfo}`
  }
}
// 打包商品-根据商品编号获取商品规格
export const skugetbygoodsId = {
  url: '/goods/releaseGoods/skugetbygoodsId',
  method: 'GET',
  dealUrl: (url, goodsId) => {
    return `${url}?goodsId=${goodsId}`
  }
}
// 编辑商品
export const updateGood = {
  url: '/goods/goodsList/edit',
  method: 'PUT',
  dealReqData: (form) => {
    return form
  }
}
// 重新发布商品
export const republishGood = {
  url: '/goods/goodsList/republish',
  method: 'PUT',
  dealReqData: (form) => {
    return form
  }
}

// 商品审核
export const checkGood = {
  url: '/goods/goodsList/check',
  method: 'PUT',
  dealReqData: ({ checkFailReason, goodsId, status }) => {
    return { checkFailReason, goodsId, status }
  }
}
// 商品批量审核
export const checkAllGood = {
  url: '/goods/goodsList/checkBatch',
  method: 'PUT',
  dealReqData: (form) => {
    return form
  }
}

// 取消审核
export const cancelCheckGood = {
  url: '/goodsList/cancelCheck',
  method: 'PUT',
  dealUrl: (url, goodsId) => {
    return `${url}/${goodsId}`
  }
}

// 添加积分商品
export const addIntegralGood = {
  url: '/integralExchange/releaseIntegral/add',
  method: 'POST',
  dealReqData: (form) => {
    return form
  }
}

// 积分商品列表
export const getIntegralList = {
  url: '/integralExchange/integralList/page',
  method: 'GET',
  dealReqData: ({ goodsId, goodsName, addTimeHead, addTimeTail, pageNum, pageSize }) => {
    return { goodsId, goodsName, addTimeHead, addTimeTail, pageNum, pageSize }
  }
}

// 删除积分商品
export const delIntegralGood = {
  url: '/integralExchange/integralList/deleteBatch',
  method: 'DELETE'
}

// 修改积分值
export const updateIntegralValue = {
  url: '/integralExchange/integralList/repairIntegral',
  method: 'PUT',
  dealReqData: ({ goodsId, integral }) => {
    return { goodsId, integral }
  }
}

// 修改库存
export const undateIntegralStock = {
  url: '/integralExchange/integralList/repairStock',
  method: 'PUT',
  dealReqData: ({ goodsId, stock }) => {
    return { goodsId, stock }
  }
}

// 上下架积分商品
export const undateIntegralStatus = {
  url: '/integralExchange/integralList/onOff',
  method: 'PUT',
  dealReqData: ({ goodsId, type }) => {
    return { goodsId, type }
  }
}
// 分页查询-商品评论
export const getGoodsCommentList = {
  url: '/goodsComment/page',
  method: 'GET',
  dealReqData: ({ evaluateType, goodsId, goodsName, replyStatus, pageNum, pageSize }) => {
    return { evaluateType, goodsId, goodsName, replyStatus, pageNum, pageSize }
  }
}
// 商品评价详情
export const commentDetail = {
  url: '/goodsComment/commentDetail',
  method: 'GET',
  dealReqData: ({ commentId }) => {
    return { commentId }
  }
}
// 商品追评详情
export const appendCommentDetail = {
  url: '/goodsComment/appendCommentDetail',
  method: 'GET',
  dealReqData: ({ commentId }) => {
    return { commentId }
  }
}
// 商品回复
export const reply = {
  url: '/goodsComment/reply',
  method: 'PUT',
  dealReqData: ({ commentId, replyContent }) => {
    return { commentId, replyContent }
  }
}
// 商品追评
export const appendReply = {
  url: '/goodsComment/appendReply',
  method: 'PUT',
  dealReqData: ({ commentId, replyContent }) => {
    return { commentId, replyContent }
  }
}
// 删除商品回复
export const deleteReply = {
  url: '/goodsComment/delete',
  method: 'DELETE',
  dealUrl: (url, commentId) => {
    return `${url}/${commentId}`
  }
}
// 删除商品追评
export const appendDelete = {
  url: '/goodsComment/appendDelete',
  method: 'DELETE',
  dealUrl: (url, commentId) => {
    return `${url}/${commentId}`
  }
}

// 外部商品通证--列表
export const externalTokenList = {
  url: '/externalToken/list',
  method: 'GET'
}

// 外部商品通证--交易记录
export const externalTokenTradeList = {
  url: '/externalTokenTrade/list',
  method: 'GET'
}

// 外部商品通证--地址--二维码
export const externalTokenRead = {
  url: '/externalToken/read',
  method: 'GET'
}

// 商品配置--商户详情
export const goodsConfigureMerchantDetail = {
  url: '/goodsConfigure/merchantDetail',
  method: 'GET'
}
// 商品配置--商户
export const goodsConfigureMerchantConfigure = {
  url: '/goodsConfigure/merchantConfigure',
  method: 'PUT',
  dealUrl: (url, { delayDelivery }) => {
    return `${url}?delayDelivery=${delayDelivery}`
  }
}

// 商品配置--平台详情
export const goodsConfigurePlatDetail = {
  url: '/goodsConfigure/platDetail',
  method: 'GET'
}
// 商品配置--平台
export const goodsConfigurePlatConfigure = {
  url: '/goodsConfigure/platConfigure',
  method: 'PUT',
  dealUrl: (url, { delayDelivery }) => {
    return `${url}?delayDelivery=${delayDelivery}`
  }
}
// 商户发布商品是否允许延后提货
export const merchantDelayDelivery = {
  url: '/goods/releaseGoods/merchantDelayDelivery',
  method: 'GET'
}
// 查询外部nft
export const externnftlist = {
  url: '/goods/releaseGoods/externnftlist',
  method: 'GET'
}
