实现后端webResource CRUD

This commit is contained in:
2025-05-12 15:30:42 +08:00
parent 7f441f5126
commit eb4301ba98
7 changed files with 94 additions and 9 deletions

View File

@@ -0,0 +1,28 @@
import { Type } from "class-transformer";
import { IsString, ValidateNested } from "class-validator";
class ResourceTagDto {
@IsString()
name: string;
@IsString()
type: string;
}
export class CreateResourceDto {
@IsString()
title: string;
@IsString()
description: string;
@IsString()
imageUrl: string;
@IsString()
link: string;
@ValidateNested({ each: true })
@Type(() => ResourceTagDto)
tags: ResourceTagDto[];
}