返回 AiToEarn
tools.dto.ts
根目录 / project / aitoearn-electron / server / src / modules / tools / dto / tools.dto.ts
1 /*
2 * @Author: nevin
3 * @Date: 2024-08-19 15:58:47
4 * @LastEditTime: 2024-10-17 19:07:10
5 * @LastEditors: nevin
6 * @Description: AI工具
7 */
8 import { ApiProperty } from '@nestjs/swagger';
9 import { Expose } from 'class-transformer';
10 import { IsEnum, IsObject, IsString } from 'class-validator';
11
12 export class TextModerationDto {
13 @ApiProperty({ title: '内容', required: true })
14 @IsString({ message: '内容' })
15 @Expose()
16 readonly content: string;
17 }
18
19 export class KwaiSignDto {
20 @ApiProperty({
21 description: '请求体的 JSON 内容',
22 type: 'object',
23 additionalProperties: true,
24 example: { key1: 'value1', key2: 123 },
25 })
26 @IsObject()
27 @Expose()
28 json: Record<string, any>;
29
30 @ApiProperty({
31 description: '请求类型,form-data 或 json',
32 enum: ['form-data', 'json'],
33 example: 'json',
34 })
35 @IsEnum(['form-data', 'json'])
36 @Expose()
37 type: 'form-data' | 'json';
38 }
39
39 lines TYPESCRIPT