feat: 实现批量生码、二维码导出与公开溯源激活计数

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Nixevol
2026-06-28 16:12:50 +08:00
co-authored by Cursor
parent b4108d7434
commit 63c0488ff7
11 changed files with 652 additions and 0 deletions
@@ -0,0 +1,52 @@
import { ApiProperty, ApiPropertyOptional } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsEnum, IsInt, IsOptional, IsString, Max, MaxLength, Min } from 'class-validator';
import { TraceCodeStatus } from '@artveris/shared';
import { PaginationDto } from '../../common/dto/pagination.dto';
export class GenerateBatchDto {
@ApiProperty({ description: '生成数量', minimum: 1, maximum: 10000 })
@Type(() => Number)
@IsInt()
@Min(1)
@Max(10000)
quantity!: number;
@ApiPropertyOptional({ description: '批次编号(留空自动生成)' })
@IsOptional()
@IsString()
@MaxLength(50)
batchNo?: string;
}
export class QueryTraceCodeDto extends PaginationDto {
@ApiPropertyOptional({ description: '批次 ID' })
@IsOptional()
@Type(() => Number)
@IsInt()
batchId?: number;
@ApiPropertyOptional({ description: '状态', enum: TraceCodeStatus })
@IsOptional()
@IsEnum(TraceCodeStatus)
status?: TraceCodeStatus;
@ApiPropertyOptional({ description: '关键词(短码/追溯码/SKU/档案号)' })
@IsOptional()
@IsString()
keyword?: string;
}
export class BindArtworkDto {
@ApiProperty({ description: '艺术品 ID' })
@Type(() => Number)
@IsInt()
artworkId!: number;
}
export class QueryBatchDto extends PaginationDto {
@ApiPropertyOptional({ description: '关键词(批次编号)' })
@IsOptional()
@IsString()
keyword?: string;
}