index.ts 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. import { defHttp } from '@/config/axios'
  2. import type { MerchantVO } from './types'
  3. // 查询列表支付商户
  4. export const getMerchantPageApi = ({ params }) => {
  5. return defHttp.get<PageResult<MerchantVO>>({ url: '/pay/merchant/page', params })
  6. }
  7. // 查询详情支付商户
  8. export const getMerchantApi = (id: number) => {
  9. return defHttp.get<MerchantVO>({ url: '/pay/merchant/get?id=' + id })
  10. }
  11. // 根据商户名称搜索商户列表
  12. export const getMerchantListByNameApi = (name: string) => {
  13. return defHttp.get<MerchantVO>({
  14. url: '/pay/merchant/list-by-name?id=',
  15. params: {
  16. name: name
  17. }
  18. })
  19. }
  20. // 新增支付商户
  21. export const createMerchantApi = (params: MerchantVO) => {
  22. return defHttp.post({ url: '/pay/merchant/create', params })
  23. }
  24. // 修改支付商户
  25. export const updateMerchantApi = (params: MerchantVO) => {
  26. return defHttp.put({ url: '/pay/merchant/update', params })
  27. }
  28. // 删除支付商户
  29. export const deleteMerchantApi = (id: number) => {
  30. return defHttp.delete({ url: '/pay/merchant/delete?id=' + id })
  31. }
  32. // 导出支付商户
  33. export const exportMerchantApi = (params) => {
  34. return defHttp.get({ url: '/pay/merchant/export-excel', params, responseType: 'blob' })
  35. }
  36. // 支付商户状态修改
  37. export const changeMerchantStatusApi = (id: number, status: number) => {
  38. const data = {
  39. id,
  40. status
  41. }
  42. return defHttp.put({ url: '/pay/merchant/update-status', data: data })
  43. }