feat: 追溯码新增分组管理与批量分组/启停接口
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -1,8 +1,10 @@
|
||||
import {
|
||||
Body,
|
||||
Controller,
|
||||
Delete,
|
||||
Get,
|
||||
Param,
|
||||
ParseIntPipe,
|
||||
Post,
|
||||
Put,
|
||||
Query,
|
||||
@@ -13,8 +15,11 @@ import { Response } from 'express';
|
||||
import { RoleType } from '@artveris/shared';
|
||||
import { TraceCodeService } from './trace-code.service';
|
||||
import {
|
||||
BatchGroupDto,
|
||||
BatchStatusDto,
|
||||
BindArtworkDto,
|
||||
GenerateBatchDto,
|
||||
GroupDto,
|
||||
QueryBatchDto,
|
||||
QueryTraceCodeDto,
|
||||
} from './dto/trace-code.dto';
|
||||
@@ -41,6 +46,47 @@ export class TraceCodeController {
|
||||
return this.service.listBatches(query);
|
||||
}
|
||||
|
||||
@Get('trace-code-groups')
|
||||
@ApiOperation({ summary: '分组列表' })
|
||||
groups() {
|
||||
return this.service.listGroups();
|
||||
}
|
||||
|
||||
@Post('trace-code-groups')
|
||||
@Roles(RoleType.OPERATOR)
|
||||
@ApiOperation({ summary: '创建分组' })
|
||||
createGroup(@Body() dto: GroupDto) {
|
||||
return this.service.createGroup(dto);
|
||||
}
|
||||
|
||||
@Put('trace-code-groups/:id')
|
||||
@Roles(RoleType.OPERATOR)
|
||||
@ApiOperation({ summary: '更新分组' })
|
||||
updateGroup(@Param('id', ParseIntPipe) id: number, @Body() dto: GroupDto) {
|
||||
return this.service.updateGroup(id, dto);
|
||||
}
|
||||
|
||||
@Delete('trace-code-groups/:id')
|
||||
@Roles(RoleType.OPERATOR)
|
||||
@ApiOperation({ summary: '删除分组' })
|
||||
removeGroup(@Param('id', ParseIntPipe) id: number) {
|
||||
return this.service.removeGroup(id);
|
||||
}
|
||||
|
||||
@Put('trace-codes/batch/group')
|
||||
@Roles(RoleType.OPERATOR)
|
||||
@ApiOperation({ summary: '批量设置分组' })
|
||||
batchGroup(@Body() dto: BatchGroupDto) {
|
||||
return this.service.batchSetGroup(dto);
|
||||
}
|
||||
|
||||
@Put('trace-codes/batch/status')
|
||||
@Roles(RoleType.OPERATOR)
|
||||
@ApiOperation({ summary: '批量启用/停用' })
|
||||
batchStatus(@Body() dto: BatchStatusDto) {
|
||||
return this.service.batchSetStatus(dto);
|
||||
}
|
||||
|
||||
@Get('trace-codes')
|
||||
@ApiOperation({ summary: '追溯码列表' })
|
||||
list(@Query() query: QueryTraceCodeDto) {
|
||||
|
||||
Reference in New Issue
Block a user