Blame view

SubjectDimensionDictController.java 2.91 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
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.model.SubjectDimensionDictDO;
import com.meishu.model.SubjectTestPublishGradeDO;
import com.meishu.service.SubjectDimensionDictService;
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-06
 */
@RestController
@Api(tags = "测评表")
@RequestMapping("/subjectDimensionDict")
public class SubjectDimensionDictController {

    @Autowired
    private SubjectDimensionDictService subjectDimensionDictService;

    @PostMapping("getAllDimensions")
    @ApiOperation("获取所有的维度  {ruleId 规则id}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getAllDimensions(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensions(subjectDimensionDictDO));
    }

    @PostMapping("deleteDimensionById")
    @ApiOperation("删除某个维度   {id}")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO deleteDimensionById(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.deleteDimensionById(subjectDimensionDictDO));
    }

    @PostMapping("updateDimension")
    @ApiOperation("编辑维度  {id  dimension:维度名称 }")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.updateDimension(subjectDimensionDictDO));
    }

    @PostMapping("addDimension")
    @ApiOperation("新增维度  {id  ruleId: }")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO addDimension(@RequestBody SubjectDimensionDictDO subjectDimensionDictDO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.addDimension(subjectDimensionDictDO));
    }

    @PostMapping("getAllDimensionStar")
    @ApiOperation("获取某个【规则】下的全部权限星级  publishId 规则id")
    public ResponseVO getAllDimensionStar(@RequestBody SubjectTestPublishGradeDO subjectTestPublishGradeDO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionDictService.getAllDimensionStar(subjectTestPublishGradeDO));
    }
}