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
53
54
55
56
import type { PageParam, PageResult } from '..\..\..\..\packages\effects\request\src';
 
import { requestClient } from '#/api/request';
 
export namespace IotProductCategoryApi {
  /** 产品分类 */
  export interface ProductCategory {
    id?: number; // 分类 ID
    name: string; // 分类名称
    sort?: number; // 分类排序
    status?: number; // 分类状态
    description?: string; // 分类描述
    createTime?: Date; // 创建时间
  }
}
 
/** 查询产品分类分页 */
export function getProductCategoryPage(params: PageParam) {
  return requestClient.get<PageResult<IotProductCategoryApi.ProductCategory>>(
    '/iot/product-category/page',
    { params },
  );
}
 
/** 查询产品分类详情 */
export function getProductCategory(id: number) {
  return requestClient.get<IotProductCategoryApi.ProductCategory>(
    `/iot/product-category/get?id=${id}`,
  );
}
 
/** 新增产品分类 */
export function createProductCategory(
  data: IotProductCategoryApi.ProductCategory,
) {
  return requestClient.post('/iot/product-category/create', data);
}
 
/** 修改产品分类 */
export function updateProductCategory(
  data: IotProductCategoryApi.ProductCategory,
) {
  return requestClient.put('/iot/product-category/update', data);
}
 
/** 刪除产品分类 */
export function deleteProductCategory(id: number) {
  return requestClient.delete(`/iot/product-category/delete?id=${id}`);
}
 
/** 获取产品分类精简列表 */
export function getSimpleProductCategoryList() {
  return requestClient.get<IotProductCategoryApi.ProductCategory[]>(
    '/iot/product-category/simple-list',
  );
}