Blame view

SubjectDimensionStarDictController.java 2.75 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
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));
    }

}