mirror of
https://gitee.com/qqtt-ah/ecom-dmb.git
synced 2026-11-25 02:29:19 +08:00
wip: 新增电商模块
This commit is contained in:
@@ -0,0 +1,68 @@
|
||||
import { requestClient } from '#/api/request';
|
||||
|
||||
import type { PageQueryDTO, PageResultVO } from '#/types/common';
|
||||
import type { ShopDTO, ShopVO, ProductDTO, ProductVO } from './types';
|
||||
|
||||
/**
|
||||
* 店铺管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取店铺列表
|
||||
*/
|
||||
export async function getShopPageApi(params: PageQueryDTO<ShopDTO.ShopFiltersDTO>) {
|
||||
return requestClient.post<PageResultVO<ShopVO.ShopInfoVO>>('/ec/shop/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建店铺
|
||||
*/
|
||||
export async function createShopApi(data: ShopDTO.CreateShopDTO) {
|
||||
return requestClient.post<ShopVO.ShopInfoVO>('/ec/shop/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新店铺
|
||||
*/
|
||||
export async function updateShopApi(id: number, data: ShopDTO.UpdateShopDTO) {
|
||||
return requestClient.put<ShopVO.ShopInfoVO>(`/ec/shop/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除店铺
|
||||
*/
|
||||
export async function deleteShopApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/shop/delete/${id}`);
|
||||
}
|
||||
|
||||
/**
|
||||
* 商品管理API
|
||||
*/
|
||||
|
||||
/**
|
||||
* 分页获取商品列表
|
||||
*/
|
||||
export async function getProductPageApi(params: PageQueryDTO<ProductDTO.ProductFiltersDTO>) {
|
||||
return requestClient.post<PageResultVO<ProductVO.ProductInfoVO>>('/ec/product/page', params);
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建商品
|
||||
*/
|
||||
export async function createProductApi(data: ProductDTO.CreateProductDTO) {
|
||||
return requestClient.post<ProductVO.ProductInfoVO>('/ec/product/create', data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 更新商品
|
||||
*/
|
||||
export async function updateProductApi(id: number, data: ProductDTO.UpdateProductDTO) {
|
||||
return requestClient.put<ProductVO.ProductInfoVO>(`/ec/product/update/${id}`, data);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除商品
|
||||
*/
|
||||
export async function deleteProductApi(id: number) {
|
||||
return requestClient.delete<void>(`/ec/product/delete/${id}`);
|
||||
}
|
||||
Reference in New Issue
Block a user