2025-04-09 01:23:23 +08:00

57 lines
1.0 KiB
TypeScript

import { BaseQuery } from '@kevisual/query';
export class TradeQuery extends BaseQuery {
constructor(options: { query: any }) {
super(options);
}
async getList(params?: any, dataOpts?: any) {
return this.query.post(
{
path: 'trade',
key: 'list',
...params,
},
dataOpts,
);
}
async getDetail(id?: string, dataOpts?: any) {
return this.query.post(
{
path: 'trade',
key: 'get',
data: { id },
},
dataOpts,
);
}
async update(data?: any, dataOpts?: any) {
return this.query.post(
{
path: 'trade',
key: 'update',
data,
},
dataOpts,
);
}
async delete(id?: string, dataOpts?: any) {
return this.query.post(
{
path: 'trade',
key: 'delete',
data: { id },
},
dataOpts,
);
}
async getMe(dataOpts?: any) {
return this.query.post<{ id: string }>(
{
path: 'user',
key: 'me',
},
dataOpts,
);
}
}