packages/api/src/modules/{module-name}/
├── {module-name}.module.ts
├── controllers/
│ ├── console/
│ └── web/
├── services/
└── dto/@ConsoleController(path, groupName)/consoleapi/{path}@ConsoleController("user", "用户管理")
export class UserController {}@WebController(path | options)/api/{path}@WebController("article")
export class ArticleController {}@Playground()@Post()
create(@Body() dto: CreateDto, @Playground() user: UserPlayground) {
return this.service.create(dto, user.id);
}@Public()@Public()
@Get("config")
config() {
return {};
}@Permissions(...)@Permissions({
code: "role:create",
name: "创建角色",
action: "创建",
})
@Post()
create() {}@MemberOnly(...)@MemberOnly({
code: "advanced:export",
name: "高级导出",
})
@Post("export")
export() {}@BuildFileUrl([...fields])@BuildFileUrl(["avatar", "items.*.cover"])
@Get(":id")
detail() {}@SkipTransform()UUIDValidationPipe:@Get(":id")
detail(@Param("id", UUIDValidationPipe) id: string) {}