interfaces

    1. export interface RegisterInterface {
    2. readonly username: string;
    3. readonly password: string;
    4. readonly firstName?: string;
    5. readonly lastName?: string;
    6. readonly fullName?: string;
    7. }

    dto

    1. import { IsString, IsInt } from 'class-validator';
    2. import { ApiProperty } from '@nestjs/swagger';
    3. export class CreateCatDto {
    4. @ApiProperty({
    5. example: 'fuguoqiang',
    6. description: 'The age of the Cat',
    7. })
    8. @IsString()
    9. readonly name: string;
    10. @ApiProperty({ example: 28, description: 'The age of the Cat' })
    11. @IsInt()
    12. readonly age: number;
    13. @ApiProperty({ example: '猫', description: 'The age of the Cat' })
    14. @IsString()
    15. readonly breed: string;
    16. }

    classes

    1. import { ApiProperty } from '@nestjs/swagger';
    2. export class RegisterClasses {
    3. @ApiProperty({ example: 'MaineMaine', description: 'The age of the Cat' })
    4. username: string;
    5. @ApiProperty({
    6. example: 'Maine',
    7. description: 'The breed of the Cat',
    8. })
    9. password: string;
    10. @ApiProperty({
    11. example: 'Maine',
    12. description: 'The breed of the Cat',
    13. })
    14. firstName?: string;
    15. @ApiProperty({
    16. example: 'Coon',
    17. description: 'The breed of the Cat',
    18. })
    19. lastName?: string;
    20. @ApiProperty({
    21. example: 'Maine Coon',
    22. description: 'The breed of the Cat',
    23. })
    24. fullName?: string;
    25. }