FlowPacs/yudao-ui-admin-vue3/src/api/pay/merchant/index.ts

53 lines
1.4 KiB
TypeScript
Raw Normal View History

2022-07-19 22:33:54 +08:00
import { useAxios } from '@/hooks/web/useAxios'
2022-07-18 19:06:37 +08:00
import type { MerchantVO } from './types'
2022-07-19 22:33:54 +08:00
const request = useAxios()
2022-07-18 19:06:37 +08:00
// 查询列表支付商户
2022-07-19 22:33:54 +08:00
export const getMerchantPageApi = (params) => {
return request.get({ url: '/pay/merchant/page', params })
2022-07-18 19:06:37 +08:00
}
// 查询详情支付商户
export const getMerchantApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.get({ url: '/pay/merchant/get?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 根据商户名称搜索商户列表
export const getMerchantListByNameApi = (name: string) => {
2022-07-19 22:33:54 +08:00
return request.get({
2022-07-18 19:06:37 +08:00
url: '/pay/merchant/list-by-name?id=',
params: {
name: name
}
})
}
// 新增支付商户
2022-07-19 22:33:54 +08:00
export const createMerchantApi = (data: MerchantVO) => {
return request.post({ url: '/pay/merchant/create', data })
2022-07-18 19:06:37 +08:00
}
// 修改支付商户
2022-07-19 22:33:54 +08:00
export const updateMerchantApi = (data: MerchantVO) => {
return request.put({ url: '/pay/merchant/update', data })
2022-07-18 19:06:37 +08:00
}
// 删除支付商户
export const deleteMerchantApi = (id: number) => {
2022-07-19 22:33:54 +08:00
return request.delete({ url: '/pay/merchant/delete?id=' + id })
2022-07-18 19:06:37 +08:00
}
// 导出支付商户
export const exportMerchantApi = (params) => {
2022-07-25 21:03:14 +08:00
return request.download({ url: '/pay/merchant/export-excel', params })
2022-07-18 19:06:37 +08:00
}
// 支付商户状态修改
export const changeMerchantStatusApi = (id: number, status: number) => {
const data = {
id,
status
}
2022-07-19 22:33:54 +08:00
return request.put({ url: '/pay/merchant/update-status', data: data })
2022-07-18 19:06:37 +08:00
}