ExerciseCourseTreeMappingController.java 1.64 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.exercise.QueryCourseTreeExerciseDTO;
import com.meishu.dto.exercise.UpdateStatusDTO;
import com.meishu.mapper.ExerciseCourseTreeMappingMapper;
import com.meishu.model.ExerciseCourseTreeMappingDO;
import com.meishu.model.ExerciseTreeMappingDO;
import com.meishu.service.ExerciseCourseTreeMappingService;
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-24
 */
@RestController
@Api(tags = "课程知识树--题目字典表")
@RequestMapping("/exerciseCourse")
public class ExerciseCourseTreeMappingController {


    @Autowired
    private ExerciseCourseTreeMappingService exerciseCourseTreeMappingService;

    @PostMapping("updateStatus")
    @ApiOperation("修改题目的开放状态 ids []  题目id   status 0:隐藏 1:开放")
    @LoginRequired(value = {ConstantUtils.ADMINISTER_TERMINATE})
    public ResponseVO updateStatus(@RequestBody UpdateStatusDTO updateStatusDTO){
        return ResponseData.generateCreatedResponse(0,exerciseCourseTreeMappingService.updateStatus(updateStatusDTO));
    }


}