Files
suke-mp/src/api/goods/index.ts
2024-06-08 17:05:25 +08:00

15 lines
525 B
TypeScript

import { get } from '@/utils';
import { CategoryBean, GoodsBean } from '@/api/goods/types';
enum URL {
categoryList = '/ext/goods/category_list',
goodsList = '/ext/goods/query',
goodsDetail = '/ext/goods/info'
}
export const getCategoryList = () => get<CategoryBean[]>({ url: URL.categoryList });
export const getGoodsList = (params: any) => get<GoodsBean[]>({ url: URL.goodsList, data: params });
export const getGoodsDetail = (goodsId: string) => get<GoodsBean>({ url: URL.goodsDetail + `?goodsId=${goodsId}` });