3166467518
HQ 上传底图与码栏;合伙人单选写入 partner_account.activity_poster_id,用户管理下次登录仍显示同一张图。 Co-authored-by: Cursor <cursoragent@cursor.com>
79 lines
1.3 KiB
TypeScript
79 lines
1.3 KiB
TypeScript
import { Type } from 'class-transformer';
|
|
import {
|
|
IsIn,
|
|
IsInt,
|
|
IsNumber,
|
|
IsOptional,
|
|
IsString,
|
|
Max,
|
|
MaxLength,
|
|
Min,
|
|
MinLength,
|
|
ValidateIf,
|
|
} from 'class-validator';
|
|
import { 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;
|
|
}
|