| 1 | /* |
| 2 | * @Author: nevin |
| 3 | * @Date: 2024-06-17 20:12:31 |
| 4 | * @LastEditTime: 2025-03-03 19:00:31 |
| 5 | * @LastEditors: nevin |
| 6 | * @Description: |
| 7 | */ |
| 8 | import { ApiProperty } from '@nestjs/swagger'; |
| 9 | import { Expose } from 'class-transformer'; |
| 10 | import { IsObject, IsString } from 'class-validator'; |
| 11 | |
| 12 | export class CreateCfgDto { |
| 13 | @ApiProperty({ required: true }) |
| 14 | @IsString({ message: 'key' }) |
| 15 | @Expose() |
| 16 | readonly key: string; |
| 17 | |
| 18 | @ApiProperty({ required: true }) |
| 19 | @IsString({ message: '标题必须填写' }) |
| 20 | @Expose() |
| 21 | readonly title: string; |
| 22 | |
| 23 | @ApiProperty({ required: true }) |
| 24 | @IsObject({ message: '内容' }) |
| 25 | @Expose() |
| 26 | readonly content: any; |
| 27 | } |
| 28 | |
| 29 | export class UpdateCfgDto { |
| 30 | @ApiProperty({ required: true }) |
| 31 | @IsString({ message: '内容' }) |
| 32 | @Expose() |
| 33 | readonly content: string; |
| 34 | } |
| 35 | |
| 36 | export class CfgIdDto { |
| 37 | @ApiProperty({ title: 'ID', required: true }) |
| 38 | @IsString({ message: 'ID' }) |
| 39 | @Expose() |
| 40 | id: string; |
| 41 | } |
| 42 | |
| 43 | export class CfgKeyDto { |
| 44 | @ApiProperty({ title: 'key', required: true }) |
| 45 | @IsString({ message: 'key' }) |
| 46 | @Expose() |
| 47 | key: string; |
| 48 | } |
| 49 |