mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-24 12:29:19 +08:00
50 lines
1.1 KiB
TypeScript
50 lines
1.1 KiB
TypeScript
import type { PlatformDTO, PlatformVO } from './types';
|
|
|
|
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
|
|
|
import { requestClient } from '#/api/request';
|
|
|
|
/**
|
|
* 平台管理API
|
|
*/
|
|
|
|
/**
|
|
* 分页获取平台列表
|
|
*/
|
|
export async function getPlatformPageApi(
|
|
params: PageQueryDTO<PlatformDTO.Filters>,
|
|
) {
|
|
return requestClient.post<PageResultVO<PlatformVO.Info>>(
|
|
'/ec/platform/list',
|
|
params,
|
|
);
|
|
}
|
|
|
|
/**
|
|
* 创建平台
|
|
*/
|
|
export async function createPlatformApi(data: PlatformDTO.Create) {
|
|
return requestClient.post<PlatformVO.Info>('/ec/platform/create', data);
|
|
}
|
|
|
|
/**
|
|
* 更新平台
|
|
*/
|
|
export async function updatePlatformApi(id: number, data: PlatformDTO.Update) {
|
|
return requestClient.put<PlatformVO.Info>(`/ec/platform/update/${id}`, data);
|
|
}
|
|
|
|
/**
|
|
* 删除平台
|
|
*/
|
|
export async function deletePlatformApi(id: number) {
|
|
return requestClient.delete(`/ec/platform/delete/${id}`);
|
|
}
|
|
|
|
/**
|
|
* 获取所有启用的平台列表
|
|
*/
|
|
export async function getActivePlatformsApi() {
|
|
return requestClient.get<PlatformVO.Info[]>('/ec/platform/active');
|
|
}
|