SubjectDimensionDictController.java 2.91 KB
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));
    }
}