feat(v2.4): 切换计划与开发任务主写
This commit is contained in:
57
apps/server/src/modules/dev-task/dev-task.controller.ts
Normal file
57
apps/server/src/modules/dev-task/dev-task.controller.ts
Normal file
@@ -0,0 +1,57 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common';
|
||||
import { CreateDevTaskDto } from './dto/create-dev-task.dto';
|
||||
import { UpdateDevTaskDto } from './dto/update-dev-task.dto';
|
||||
import { DevTaskService } from './dev-task.service';
|
||||
|
||||
@Controller('versions/:versionId/dev-tasks')
|
||||
export class DevTaskController {
|
||||
constructor(private readonly devTaskService: DevTaskService) {}
|
||||
|
||||
@Post()
|
||||
create(@Param('versionId') versionId: string, @Body() dto: CreateDevTaskDto) {
|
||||
return this.devTaskService.create(versionId, dto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll(@Param('versionId') versionId: string) {
|
||||
return this.devTaskService.findAll(versionId);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('versionId') versionId: string, @Param('id') id: string, @Body() dto: UpdateDevTaskDto) {
|
||||
return this.devTaskService.update(versionId, id, dto);
|
||||
}
|
||||
|
||||
@Patch(':id/status')
|
||||
updateStatus(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@Body('status') status: string,
|
||||
) {
|
||||
return this.devTaskService.updateStatus(versionId, id, status);
|
||||
}
|
||||
|
||||
@Patch(':id/block')
|
||||
setBlocked(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@Body('blocked') blocked: boolean,
|
||||
@Body('reason') reason?: string,
|
||||
) {
|
||||
return this.devTaskService.setBlocked(versionId, id, blocked, reason);
|
||||
}
|
||||
|
||||
@Patch(':id/transfer')
|
||||
transfer(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@Body('assigneeId') assigneeId: string,
|
||||
) {
|
||||
return this.devTaskService.transfer(versionId, id, assigneeId);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('versionId') versionId: string, @Param('id') id: string) {
|
||||
return this.devTaskService.remove(versionId, id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user