initial commit
This commit is contained in:
56
mock/product.mock.ts
Normal file
56
mock/product.mock.ts
Normal file
@@ -0,0 +1,56 @@
|
||||
|
||||
const attributes = [
|
||||
{
|
||||
id: '1',
|
||||
name: '主体颜色',
|
||||
code: 'color',
|
||||
type: 'select',
|
||||
isRequired: true,
|
||||
options: ['星空灰', '珍珠白', '午夜蓝'],
|
||||
sort: 1,
|
||||
status: 'active',
|
||||
createdAt: '2024-02-14 10:00:00',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
name: '重量 (g)',
|
||||
code: 'weight',
|
||||
type: 'number',
|
||||
isRequired: false,
|
||||
sort: 2,
|
||||
status: 'active',
|
||||
createdAt: '2024-02-14 10:05:00',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
name: '无线连接',
|
||||
code: 'wireless',
|
||||
type: 'boolean',
|
||||
isRequired: true,
|
||||
sort: 3,
|
||||
status: 'disabled',
|
||||
createdAt: '2024-02-14 10:10:00',
|
||||
},
|
||||
];
|
||||
|
||||
export default {
|
||||
'GET /api/product/attributes': (req: any, res: any) => {
|
||||
res.send({
|
||||
success: true,
|
||||
data: attributes,
|
||||
total: attributes.length,
|
||||
});
|
||||
},
|
||||
'POST /api/product/attribute': (req: any, res: any) => {
|
||||
res.send({
|
||||
success: true,
|
||||
message: '操作成功',
|
||||
});
|
||||
},
|
||||
'DELETE /api/product/attribute/:id': (req: any, res: any) => {
|
||||
res.send({
|
||||
success: true,
|
||||
message: '删除成功',
|
||||
});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user