SubjectDimensionStarDictController.java 2.75 KB
package com.meishu.controller;


import com.meishu.common.ResponseData;
import com.meishu.common.ResponseVO;
import com.meishu.common.interceptor.LoginRequired;
import com.meishu.dto.dimension.AddStarDTO;
import com.meishu.dto.dimension.DeleteStarByIdDTO;
import com.meishu.model.SubjectDimensionStarDictDO;
import com.meishu.service.SubjectDimensionStarDictService;
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("/subjectDimensionStartDict")
public class SubjectDimensionStarDictController {

    @Autowired
    private SubjectDimensionStarDictService subjectDimensionStartDictService;

    @PostMapping("getAllDimensionStars")
    @ApiOperation("获取某个维度下所有的星级  {dimensionId:维度id  star星级 }")
//    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO getAllDimensionStars(@RequestBody SubjectDimensionStarDictDO subjectDimensionStartDictDO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.getAllDimensionStars(subjectDimensionStartDictDO));
    }

    @PostMapping("deleteStarById")
    @ApiOperation("删除某个星级  ids:id数组")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO deleteStarById(@RequestBody DeleteStarByIdDTO deleteDimensionByIdDTO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.deleteStarById(deleteDimensionByIdDTO));
    }

    @PostMapping("addStar")
    @ApiOperation("新建星级 treeIds:多个知识点的数组  dimensionId:维度i1111d  star:星级  description:评析")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO addStar(@RequestBody AddStarDTO addStarDTO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.addStar(addStarDTO));
    }

    @PostMapping("updateStar")
    @ApiOperation("修改星级 id treeIds:多个知识点的数组  dimensionId:维度id  star:星级  description:评析")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateStar(@RequestBody AddStarDTO addStarDTO){
        return ResponseData.generateCreatedResponse(0,subjectDimensionStartDictService.updateStar(addStarDTO));
    }

}