Files
dukang/server/dukang-api/src/modules/ops/dto/activity-poster.dto.ts
T
jacy cdc4b82931 feat(ops): v4.0.7 HQ 活动图快链与勾选导出
HQ 指定一张活动图为勾选主合伙人合成 PNG/zip;城市合伙人页增加快链与单下/导出。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 15:12:10 +08:00

90 lines
1.6 KiB
TypeScript

import { Type } from 'class-transformer';
import {
ArrayMaxSize,
ArrayMinSize,
IsArray,
IsIn,
IsInt,
IsNumber,
IsOptional,
IsString,
Max,
MaxLength,
Min,
MinLength,
ValidateIf,
} from 'class-validator';
import { ACTIVITY_POSTER_PACK_MAX_PARTNERS, ACTIVITY_POSTER_STATUSES } from '@dukang/shared-types';
import { PaginationQueryDto } from './admin-query.dto';
export class ActivityPosterQueryDto extends PaginationQueryDto {
@IsOptional()
@IsIn([...ACTIVITY_POSTER_STATUSES])
status?: string;
}
export class UpsertActivityPosterDto {
@IsString()
@MinLength(1)
@MaxLength(128)
title!: string;
@IsOptional()
@IsString()
@MaxLength(4000)
copyText?: string;
@IsString()
@MinLength(1)
@MaxLength(512)
imageUrl!: string;
@Type(() => Number)
@IsNumber()
@Min(0)
@Max(100)
qrXPct!: number;
@Type(() => Number)
@IsNumber()
@Min(0)
@Max(100)
qrYPct!: number;
@Type(() => Number)
@IsNumber()
@Min(5)
@Max(50)
qrSizePct!: number;
@IsOptional()
@Type(() => Number)
@IsInt()
@Min(0)
sortOrder?: number;
@IsOptional()
@IsIn([...ACTIVITY_POSTER_STATUSES])
status?: string;
}
export class UpdateActivityPosterStatusDto {
@IsIn([...ACTIVITY_POSTER_STATUSES])
status!: string;
}
export class ActivityPosterSelectionDto {
@IsOptional()
@ValidateIf((_, value) => value != null)
@IsString()
posterId?: string | null;
}
export class ActivityPosterPackDto {
@IsArray()
@ArrayMinSize(1)
@ArrayMaxSize(ACTIVITY_POSTER_PACK_MAX_PARTNERS)
@IsString({ each: true })
partnerIds!: string[];
}