kongzy
2023-09-22 3124f3a5b7f45d043b228829b6b3a2e541b31574
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
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();
    }
 
}