feat(v2.4): 切换测试与缺陷主写
This commit is contained in:
49
apps/server/src/modules/bug/bug.controller.ts
Normal file
49
apps/server/src/modules/bug/bug.controller.ts
Normal file
@@ -0,0 +1,49 @@
|
||||
import { Body, Controller, Delete, Get, Param, Patch, Post } from '@nestjs/common';
|
||||
import { CreateBugDto } from './dto/create-bug.dto';
|
||||
import { UpdateBugDto } from './dto/update-bug.dto';
|
||||
import { BugService } from './bug.service';
|
||||
|
||||
@Controller('versions/:versionId/bugs')
|
||||
export class BugController {
|
||||
constructor(private readonly bugService: BugService) {}
|
||||
|
||||
@Post()
|
||||
create(@Param('versionId') versionId: string, @Body() dto: CreateBugDto) {
|
||||
return this.bugService.create(versionId, dto);
|
||||
}
|
||||
|
||||
@Get()
|
||||
findAll(@Param('versionId') versionId: string) {
|
||||
return this.bugService.findAll(versionId);
|
||||
}
|
||||
|
||||
@Patch(':id')
|
||||
update(@Param('versionId') versionId: string, @Param('id') id: string, @Body() dto: UpdateBugDto) {
|
||||
return this.bugService.update(versionId, id, dto);
|
||||
}
|
||||
|
||||
@Patch(':id/status')
|
||||
updateStatus(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@Body('status') status: string,
|
||||
@Body() body: { operator?: string; resolution?: string },
|
||||
) {
|
||||
return this.bugService.updateStatus(versionId, id, status, body);
|
||||
}
|
||||
|
||||
@Patch(':id/transfer')
|
||||
transfer(
|
||||
@Param('versionId') versionId: string,
|
||||
@Param('id') id: string,
|
||||
@Body('assigneeId') assigneeId: string,
|
||||
@Body('operator') operator?: string,
|
||||
) {
|
||||
return this.bugService.transfer(versionId, id, assigneeId, operator);
|
||||
}
|
||||
|
||||
@Delete(':id')
|
||||
remove(@Param('versionId') versionId: string, @Param('id') id: string) {
|
||||
return this.bugService.remove(versionId, id);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user