BatchDictController.java
1.89 KB
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.meishu.controller;
import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.dto.batch.AddBatchDTO;
import com.meishu.model.BatchDictDO;
import com.meishu.service.BatchDictService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import io.swagger.annotations.Api;
/**
* <p>
* 批次字典表 前端控制器
* </p>
*
* @author Tuyp
* @since 2023-07-12
*/
@RestController
@Api(tags = "批次字典表")
@RequestMapping("/batchDict")
public class BatchDictController {
@Autowired
private BatchDictService batchDictService;
@PostMapping("addBatch")
@ApiOperation("添加批次 batchName startDate endDate studentIds[studentId examCode]")
public ResponseVO addBatch(@RequestBody AddBatchDTO addBatchDTO){
return ResponseData.generateCreatedResponse(0,batchDictService.addBatch(addBatchDTO));
}
@PostMapping("updateBatch")
@ApiOperation("修改批次 id batchName startDate endDate studentIds[studentId examCode]")
public ResponseVO updateBatch(@RequestBody AddBatchDTO addBatchDTO){
return ResponseData.generateCreatedResponse(0,batchDictService.updateBatch(addBatchDTO));
}
@PostMapping("deleteBatch")
@ApiOperation("删除批次 id ")
public ResponseVO deleteBatch(@RequestBody BatchDictDO batchDictDO){
return ResponseData.generateCreatedResponse(0,batchDictService.deleteBatch(batchDictDO));
}
@PostMapping("batches")
@ApiOperation("查询批次")
public ResponseVO batches(){
return ResponseData.generateCreatedResponse(0,batchDictService.batches());
}
}