package cn.com.qmth.examcloud.core.questions.api.controller;
/*package cn.com.qmth.examcloud.core.questions.api;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import cn.com.qmth.examcloud.commons.web.security.enums.RoleMeta;
import com.google.gson.Gson;
import cn.com.qmth.examcloud.core.questions.dao.CourseRepo;
import cn.com.qmth.examcloud.core.questions.dao.entity.Course;
import cn.com.qmth.examcloud.core.questions.service.impl.CourseService;

import io.swagger.annotations.ApiOperation;

*//**
 * Created by songyue on 16/12/26.
 * <p>
 * 获取全部课程
 *
 * @return 更新课程
 * @param course
 * @return 新增课程
 * @param course
 * @return 删除课程
 * @param coruse_id
 * @return 根据课程名称或者课程编号获取课程信息
 * @param keyword
 * @return 根据课程编号获取课程信息
 * @param courseNo
 * @return 查询所有课程
 * @return 获取全部课程
 * @return 更新课程
 * @param course
 * @return 新增课程
 * @param course
 * @return 删除课程
 * @param coruse_id
 * @return 根据课程名称或者课程编号获取课程信息
 * @param keyword
 * @return 根据课程编号获取课程信息
 * @param courseNo
 * @return 查询所有课程
 * @return 获取全部课程
 * @return 更新课程
 * @param course
 * @return 新增课程
 * @param course
 * @return 删除课程
 * @param coruse_id
 * @return 根据课程名称或者课程编号获取课程信息
 * @param keyword
 * @return 根据课程编号获取课程信息
 * @param courseNo
 * @return 查询所有课程
 * @return
 *//*

@RestController
@RequestMapping("${api_cqb}/")
public class CourseController {

    @Autowired
    Gson gson;

    @Autowired
    CourseRepo courseRepo;

    @Autowired
    CourseService courseService;

    *//**
 * 获取全部课程
 *
 * @return
 *//*
    @ApiOperation(value = "获取全部课程", notes = "获取全部课程")
    @GetMapping(value = "/course/{curPage}/{pageSize}")
    public ResponseEntity getAllCourse(@ModelAttribute Course searchCondition, @PathVariable int curPage,
            @PathVariable int pageSize) {
        return new ResponseEntity(courseService.findAll(searchCondition, curPage, pageSize), HttpStatus.OK);
    }

    *//**
 * 更新课程
 *
 * @param course
 * @return
 *//*
    @ApiOperation(value = "更新课程", notes = "更新课程")
    @PutMapping(value = "/course")
    public ResponseEntity updateCourse(@ModelAttribute Course course) {
        return new ResponseEntity(courseRepo.save(course), HttpStatus.OK);
    }

    *//**
 * 新增课程
 *
 * @param course
 * @return
 *//*
    @ApiOperation(value = "新增课程", notes = "新增课程")
    @PostMapping(value = "/course")
    public ResponseEntity addCourse(@ModelAttribute Course course) {
        return new ResponseEntity(courseRepo.save(course), HttpStatus.OK);
    }

    *//**
 * 删除课程
 *
 * @param coruse_id
 * @return
 *//*
    @ApiOperation(value = "删除课程", notes = "删除课程")
    @DeleteMapping(value = "/course/{coruse_id}")
    public ResponseEntity removeCourse(@PathVariable String coruse_id) {
        courseRepo.delete(coruse_id);
        return new ResponseEntity(HttpStatus.OK);
    }

    *//**
 * 根据课程名称或者课程编号获取课程信息
 *
 * @param keyword
 * @return
 *//*
    @ApiOperation(value = "根据课程名称或者课程编号获取课程信息", notes = "根据课程名称或者课程编号获取课程信息")
    @GetMapping(value = "/course")
    public ResponseEntity getCourseByKeyword(@RequestParam String keyword) {
        return new ResponseEntity(courseService.findCoursesByKeyword(keyword), HttpStatus.OK);
    }

    *//**
 * 根据课程编号获取课程信息
 *
 * @param courseNo
 * @return
 *//*
    @ApiOperation(value = "根据课程编号获取课程信息", notes = "根据课程编号获取课程信息")
    @GetMapping(value = "/course/{courseNo}")
    public ResponseEntity getCourseByNo(@PathVariable String courseNo) {
        return new ResponseEntity(courseRepo.findFirstByCode(courseNo), HttpStatus.OK);
    }

    *//**
 * 查询所有课程
 *
 * @return
 *//*
    @ApiOperation(value = " 查询所有课程", notes = "查询所有课程")
    @GetMapping(value = "/course/allCourses")
    public ResponseEntity getAllCourses() {
        List<Course> courses = courseRepo.findAll();
        return new ResponseEntity(courses, HttpStatus.OK);
    }

}
*/