init studio admin backend

This commit is contained in:
2026-07-01 17:30:04 +09:00
commit 4437d9980d
144 changed files with 44964 additions and 0 deletions
+58
View File
@@ -0,0 +1,58 @@
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common';
import {
CreateAdminSshKeyDto,
CreateAdminDto,
ResetAdminPasswordDto,
UpdateAdminRoleDto,
UpdateAdminStatusDto,
} from './dto';
import { AdminRoles } from '../admin-auth/decorators/admin-auth.decorators';
import { AdminRole } from './admin-role';
import { AdminsService } from './admins.service';
@AdminRoles(AdminRole.OWNER)
@Controller('admins')
export class AdminsController {
constructor(private readonly adminsService: AdminsService) {}
@Get('roles')
listRoles() {
return this.adminsService.listRoles();
}
@Get()
list() {
return this.adminsService.list();
}
@Post()
create(@Body() body: CreateAdminDto) {
return this.adminsService.create(body);
}
@Patch(':id/status')
updateStatus(@Param('id') id: string, @Body() body: UpdateAdminStatusDto) {
return this.adminsService.updateStatus(id, body);
}
@Patch(':id/role')
updateRole(@Param('id') id: string, @Body() body: UpdateAdminRoleDto) {
return this.adminsService.updateRole(id, body);
}
@Patch(':id/password')
resetPassword(@Param('id') id: string, @Body() body: ResetAdminPasswordDto) {
return this.adminsService.resetPassword(id, body);
}
@Post(':id/ssh-keys')
createSshKey(@Param('id') id: string, @Body() body: CreateAdminSshKeyDto) {
return this.adminsService.createSshKey(id, body);
}
@Delete(':id/ssh-keys/:keyId')
deleteSshKey(@Param('id') id: string, @Param('keyId') keyId: string) {
return this.adminsService.deleteSshKey(id, keyId);
}
}