mirror of
https://gitee.com/qqtt-ah/ai-crm.git
synced 2026-11-24 21:49:20 +08:00
65 lines
927 B
TypeScript
65 lines
927 B
TypeScript
import {
|
|
IsArray,
|
|
IsDateString,
|
|
IsInt,
|
|
IsNotEmpty,
|
|
IsOptional,
|
|
IsString,
|
|
Min,
|
|
} from 'class-validator';
|
|
import { Type } from 'class-transformer';
|
|
|
|
export class GenerateLicenseDto {
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
customerId!: number;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
company!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
machineFingerprint!: string;
|
|
|
|
@IsString()
|
|
@IsNotEmpty()
|
|
edition!: string;
|
|
|
|
@IsDateString()
|
|
expiresAt!: string;
|
|
|
|
@IsArray()
|
|
@IsString({ each: true })
|
|
features!: string[];
|
|
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@IsOptional()
|
|
maxCompanies?: number;
|
|
}
|
|
|
|
export class LicenseQueryDto {
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@IsOptional()
|
|
page?: number = 1;
|
|
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@Min(1)
|
|
@IsOptional()
|
|
size?: number = 20;
|
|
|
|
@Type(() => Number)
|
|
@IsInt()
|
|
@IsOptional()
|
|
customerId?: number;
|
|
|
|
@IsString()
|
|
@IsOptional()
|
|
status?: string;
|
|
}
|