Blame view

SubjectTestDictController.java 2.81 KB
涂亚平 committed
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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.test.GetAllTestDTO;
import com.meishu.model.SubjectTestDictDO;
import com.meishu.service.SubjectTestDictService;
import com.meishu.util.ConstantUtils;
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 2021-05-20
 */
@RestController
@Api(tags = "测评字典表")
@RequestMapping("/subjectTest")
public class SubjectTestDictController {

    @Autowired
    private SubjectTestDictService subjectTestService;

    @PostMapping("getAllTest")
    @ApiOperation("获取全部测评字典数据 分页   {ruleId   testName  pageSize  pageNum}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getAllTest(@RequestBody GetAllTestDTO getAllTestDTO){
        return ResponseData.generateCreatedResponse(0,subjectTestService.getAllTest(getAllTestDTO));
    }

    @PostMapping("getTest")
    @ApiOperation("获取全不对测评  不分页   {ruleId   testName}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getTest(@RequestBody  GetAllTestDTO getAllTestDTO){
        return ResponseData.generateCreatedResponse(0,subjectTestService.getTest(getAllTestDTO));
    }


    @PostMapping("insertTest")
    @ApiOperation("新增一个测评 {ruleId 规则id  testName:测评名称  examination:卷面}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO insertTest(@RequestBody SubjectTestDictDO subjectTestDictDO){
        return ResponseData.generateCreatedResponse(0,subjectTestService.insertTest(subjectTestDictDO));
    }

    @PostMapping("updateTest")
    @ApiOperation("修改一个测评 {id ruleId 规则id  testName:测评名称   examination:卷面} ")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateTest(@RequestBody SubjectTestDictDO subjectTestDictDO){
        return ResponseData.generateCreatedResponse(0,subjectTestService.updateTest(subjectTestDictDO));
    }

    @PostMapping("deleteByTestId")
    @ApiOperation("删除一个测评 {id}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO deleteByTestId(@RequestBody SubjectTestDictDO subjectTestDictDO){
        return ResponseData.generateCreatedResponse(0,subjectTestService.deleteByTestId(subjectTestDictDO));
    }



}