feat: pay api

This commit is contained in:
xingyu4j
2025-04-28 16:27:34 +08:00
parent 6794f1a7f7
commit 023a6ee29a
11 changed files with 626 additions and 0 deletions

View File

@@ -0,0 +1,54 @@
import type { PageParam, PageResult } from '@vben/request';
import { requestClient } from '#/api/request';
export namespace PayChannelApi {
/** 支付渠道信息 */
export interface Channel {
id: number;
code: string;
config: string;
status: number;
remark: string;
feeRate: number;
appId: number;
createTime: Date;
}
}
/** 查询支付渠道列表 */
export function getChannelPage(params: PageParam) {
return requestClient.get<PageResult<PayChannelApi.Channel>>(
'/pay/channel/page',
{
params,
},
);
}
/** 查询支付渠道详情 */
export function getChannel(appId: string, code: string) {
return requestClient.get<PayChannelApi.Channel>('/pay/channel/get', {
params: { appId, code },
});
}
/** 新增支付渠道 */
export function createChannel(data: PayChannelApi.Channel) {
return requestClient.post('/pay/channel/create', data);
}
/** 修改支付渠道 */
export function updateChannel(data: PayChannelApi.Channel) {
return requestClient.put('/pay/channel/update', data);
}
/** 删除支付渠道 */
export function deleteChannel(id: number) {
return requestClient.delete(`/pay/channel/delete?id=${id}`);
}
/** 导出支付渠道 */
export function exportChannel(params: PageParam) {
return requestClient.download('/pay/channel/export-excel', { params });
}