feat: 实现批量生码、二维码导出与公开溯源激活计数
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user