package com.nms.swspkmas_standalone.controller;
|
|
|
import com.nms.swspkmas_standalone.entity.ExamRoom;
|
import com.nms.swspkmas_standalone.entity.vo.ExamRoomVO;
|
import com.nms.swspkmas_standalone.response.CommonResult;
|
import com.nms.swspkmas_standalone.service.ExamRoomService;
|
import io.swagger.annotations.Api;
|
import io.swagger.annotations.ApiOperation;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.*;
|
|
import javax.validation.Valid;
|
|
/**
|
* <p>
|
* 考场信息 前端控制器
|
* </p>
|
*
|
* @author kzy
|
* @since 2023-09-20 16:13:59
|
*/
|
@Api(tags = "考场信息前端控制器")
|
@RestController
|
@RequestMapping("/api/examroom")
|
public class ExamRoomController {
|
|
@Autowired
|
private ExamRoomService examRoomService;
|
|
@ApiOperation(value = "获取考场")
|
@GetMapping("/getExamRoom")
|
public CommonResult<ExamRoom> getExamRoom(){
|
return CommonResult.success(examRoomService.getExamRoom());
|
}
|
|
@ApiOperation(value = "新增考场")
|
@PostMapping("/addExamRoom")
|
public CommonResult addExamRoom(@RequestBody @Valid ExamRoomVO examRoomVO){
|
examRoomService.addExamRoom(examRoomVO);
|
return CommonResult.success();
|
}
|
|
@ApiOperation(value = "更新考场")
|
@PutMapping("/updateExamRoom/{examRoomId}")
|
public CommonResult updateExamRoom(@PathVariable(value = "examRoomId")Long examRoomId,@RequestBody ExamRoomVO examRoomVO){
|
examRoomService.updateExamRoom(examRoomId,examRoomVO);
|
return CommonResult.success();
|
}
|
|
@ApiOperation(value = "删除考场")
|
@DeleteMapping("/deleteExamRoom")
|
public CommonResult deleteExamRoom(){
|
examRoomService.deleteExamRoom();
|
return CommonResult.success();
|
}
|
|
}
|