Add NestJS fabric trade API with Prisma and Docker
Provide backend for admin and user apps with Postgres, migrations, seed data, and docker-compose for LiteSpeed reverse-proxy deployment. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
import { Body, Controller, Get, Param, Patch, Post } from '@nestjs/common';
|
||||
import { AdminUsersService } from './admin-users.service';
|
||||
import { AuthType } from '../common/decorators/auth.decorators';
|
||||
import {
|
||||
CreateAdminUserDto,
|
||||
SetAdminActiveDto,
|
||||
UpdateAdminUserDto,
|
||||
} from './dto/admin-user.dto';
|
||||
|
||||
@Controller('admin/users')
|
||||
@AuthType('admin')
|
||||
export class AdminUsersController {
|
||||
constructor(private readonly adminUsersService: AdminUsersService) {}
|
||||
|
||||
@Get()
|
||||
findAll() {
|
||||
return this.adminUsersService.findAll();
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.adminUsersService.findOne(id);
|
||||
}
|
||||
|
||||
@Post()
|
||||
create(@Body() dto: CreateAdminUserDto) {
|
||||
return this.adminUsersService.create(dto);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() dto: UpdateAdminUserDto) {
|
||||
return this.adminUsersService.update(id, dto);
|
||||
}
|
||||
|
||||
@Patch(':id/active')
|
||||
setActive(@Param('id') id: string, @Body() dto: SetAdminActiveDto) {
|
||||
return this.adminUsersService.setActive(id, dto.isActive);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user