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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import type { PageParam, PageResult } from '..\..\..\..\packages\effects\request\src';
 
import { requestClient } from '#/api/request';
 
export namespace MallPropertyApi {
  /** 商品属性 */
  export interface Property {
    id?: number; // 属性编号
    name: string; // 名称
    remark?: string; // 备注
  }
 
  /** 属性值 */
  export interface PropertyValue {
    id?: number; // 属性值编号
    propertyId?: number; // 属性项的编号
    name: string; // 名称
    remark?: string; // 备注
  }
}
 
/** 创建属性项 */
export function createProperty(data: MallPropertyApi.Property) {
  return requestClient.post('/product/property/create', data);
}
 
/** 更新属性项 */
export function updateProperty(data: MallPropertyApi.Property) {
  return requestClient.put('/product/property/update', data);
}
 
/** 删除属性项 */
export function deleteProperty(id: number) {
  return requestClient.delete(`/product/property/delete?id=${id}`);
}
 
/** 获得属性项 */
export function getProperty(id: number) {
  return requestClient.get<MallPropertyApi.Property>(
    `/product/property/get?id=${id}`,
  );
}
 
/** 获得属性项分页 */
export function getPropertyPage(params: PageParam) {
  return requestClient.get<PageResult<MallPropertyApi.Property>>(
    '/product/property/page',
    { params },
  );
}
 
/** 获得属性项精简列表 */
export function getPropertySimpleList() {
  return requestClient.get<MallPropertyApi.Property[]>(
    '/product/property/simple-list',
  );
}
 
/** 获得属性值分页 */
export function getPropertyValuePage(params: PageParam) {
  return requestClient.get<PageResult<MallPropertyApi.PropertyValue>>(
    '/product/property/value/page',
    { params },
  );
}
 
/** 获得属性值 */
export function getPropertyValue(id: number) {
  return requestClient.get<MallPropertyApi.PropertyValue>(
    `/product/property/value/get?id=${id}`,
  );
}
 
/** 创建属性值 */
export function createPropertyValue(data: MallPropertyApi.PropertyValue) {
  return requestClient.post('/product/property/value/create', data);
}
 
/** 更新属性值 */
export function updatePropertyValue(data: MallPropertyApi.PropertyValue) {
  return requestClient.put('/product/property/value/update', data);
}
 
/** 删除属性值 */
export function deletePropertyValue(id: number) {
  return requestClient.delete(`/product/property/value/delete?id=${id}`);
}
 
/** 获得属性值精简列表 */
export function getPropertyValueSimpleList(propertyId: number) {
  return requestClient.get<MallPropertyApi.PropertyValue[]>(
    '/product/property/value/simple-list',
    {
      params: { propertyId },
    },
  );
}