xxx
This commit is contained in:
50
api/src/modules/system/system.controller.ts
Normal file
50
api/src/modules/system/system.controller.ts
Normal file
@@ -0,0 +1,50 @@
|
||||
import {
|
||||
Controller,
|
||||
Get,
|
||||
Post,
|
||||
Body,
|
||||
Patch,
|
||||
Param,
|
||||
Delete,
|
||||
Req,
|
||||
UseGuards,
|
||||
} from '@nestjs/common';
|
||||
import { SystemService } from './system.service';
|
||||
import { CreateSystemDto } from './dto/create-system.dto';
|
||||
import { UpdateSystemDto } from './dto/update-system.dto';
|
||||
import { AuthenticatedRequest } from 'src/model/interface/authenticated-request.interface';
|
||||
import { AuthGuard } from 'src/core/guards/auth.guard';
|
||||
|
||||
@UseGuards(AuthGuard)
|
||||
@Controller('system')
|
||||
export class SystemController {
|
||||
constructor(private readonly systemService: SystemService) {}
|
||||
|
||||
@Post()
|
||||
create(
|
||||
@Req() req: AuthenticatedRequest,
|
||||
@Body() createSystemDto: CreateSystemDto,
|
||||
) {
|
||||
return this.systemService.create(req.user, createSystemDto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll(@Req() req: AuthenticatedRequest) {
|
||||
return this.systemService.findAll(req.user);
|
||||
}
|
||||
|
||||
@Get(':id')
|
||||
findOne(@Param('id') id: string) {
|
||||
return this.systemService.findOne(id);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('id') id: string, @Body() updateSystemDto: UpdateSystemDto) {
|
||||
return this.systemService.update(id, updateSystemDto);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('id') id: string) {
|
||||
return this.systemService.remove(id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user