gaoluyang
2026-06-24 712aa51536236d43e87273e4ce45ac5691dffad8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import type { PageParam, PageResult } from '..\..\..\..\packages\effects\request\src';
 
import { requestClient } from '#/api/request';
 
export namespace MallBrandApi {
  /** 商品品牌 */
  export interface Brand {
    id?: number; // 品牌编号
    name: string; // 品牌名称
    picUrl: string; // 品牌图片
    sort?: number; // 品牌排序
    description?: string; // 品牌描述
    status: number; // 开启状态
  }
}
 
/** 创建商品品牌 */
export function createBrand(data: MallBrandApi.Brand) {
  return requestClient.post('/product/brand/create', data);
}
 
/** 更新商品品牌 */
export function updateBrand(data: MallBrandApi.Brand) {
  return requestClient.put('/product/brand/update', data);
}
 
/** 删除商品品牌 */
export function deleteBrand(id: number) {
  return requestClient.delete(`/product/brand/delete?id=${id}`);
}
 
/** 获得商品品牌 */
export function getBrand(id: number) {
  return requestClient.get<MallBrandApi.Brand>(`/product/brand/get?id=${id}`);
}
 
/** 获得商品品牌列表 */
export function getBrandPage(params: PageParam) {
  return requestClient.get<PageResult<MallBrandApi.Brand>>(
    '/product/brand/page',
    {
      params,
    },
  );
}
 
/** 获得商品品牌精简信息列表 */
export function getSimpleBrandList() {
  return requestClient.get<MallBrandApi.Brand[]>(
    '/product/brand/list-all-simple',
  );
}