实现admin-role

This commit is contained in:
2025-05-08 22:38:50 +08:00
parent 30e1f54a5d
commit 5d72012a59
3 changed files with 43 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
import { Body, Controller, Delete, Get, Param, ParseUUIDPipe, Post } from "@nestjs/common";
import { RoleService } from "src/role/services/role.service";
import { CreateRoleDto } from "../dto/admin-role/create-role.dto";
@Controller('admin/role')
export class AdminRoleController {
constructor(
private readonly roleService: RoleService,
) { }
@Get()
async list() {
return this.roleService.list();
}
@Post()
async create(
@Body() dto: CreateRoleDto
) {
return this.roleService.create(dto);
}
@Delete(':id')
async delete(
@Param('id', new ParseUUIDPipe({ version: '4' })) id: string,
) {
return this.roleService.delete(id);
}
}