|
|
@ -1,13 +1,13 @@
|
|
|
|
package com.zhiyun.zhiyun03.course.controller;
|
|
|
|
package com.zhiyun.zhiyun03.course.controller;
|
|
|
|
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageHelper;
|
|
|
|
|
|
|
|
import com.github.pagehelper.PageInfo;
|
|
|
|
|
|
|
|
import com.zhiyun.zhiyun03.course.common.JsonResult;
|
|
|
|
|
|
|
|
import com.zhiyun.zhiyun03.course.entity.Course;
|
|
|
|
import com.zhiyun.zhiyun03.course.entity.Course;
|
|
|
|
|
|
|
|
|
|
|
|
import com.zhiyun.zhiyun03.course.service.CourseService;
|
|
|
|
import com.zhiyun.zhiyun03.course.service.CourseService;
|
|
|
|
import com.zhiyun.zhiyun03.course.vo.CourseVo;
|
|
|
|
import com.zhiyun.zhiyun03.course.vo.CourseVo;
|
|
|
|
import com.zhiyun.zhiyun03.course.vo.PageVO;
|
|
|
|
import com.zhiyun.zhiyun03.course.vo.PageVO;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import com.zhiyun.zhiyun03.utils.common.JsonResult;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.Api;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
|
import io.swagger.annotations.ApiParam;
|
|
|
@ -28,18 +28,19 @@ public class CourseController {
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("查询课程")
|
|
|
|
@ApiOperation("查询课程")
|
|
|
|
@GetMapping("/selectAll")
|
|
|
|
@GetMapping("/selectAll")
|
|
|
|
public List<CourseVo> queryCourse(){
|
|
|
|
public JsonResult<CourseVo> queryCourse(){
|
|
|
|
|
|
|
|
|
|
|
|
List<CourseVo> lists = courseService.queryCourse();
|
|
|
|
List<CourseVo> lists = courseService.queryCourse();
|
|
|
|
return lists;
|
|
|
|
|
|
|
|
|
|
|
|
return JsonResult.success(lists);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("课程添加")
|
|
|
|
@ApiOperation("课程添加")
|
|
|
|
@PostMapping("/add")
|
|
|
|
@PostMapping("/add")
|
|
|
|
public String addCourse(Course course){
|
|
|
|
public JsonResult addCourse(Course course){
|
|
|
|
courseService.addCourse(course);
|
|
|
|
courseService.addCourse(course);
|
|
|
|
return "success";
|
|
|
|
return JsonResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//
|
|
|
|
//
|
|
|
|
//// @ApiOperation("查询目录")
|
|
|
|
//// @ApiOperation("查询目录")
|
|
|
@ -51,16 +52,16 @@ public class CourseController {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
@ApiOperation("删除课程")
|
|
|
|
@ApiOperation("删除课程")
|
|
|
|
@DeleteMapping("delById")
|
|
|
|
@DeleteMapping("delById")
|
|
|
|
public String delCourseById(Integer id){
|
|
|
|
public JsonResult delCourseById(Integer id){
|
|
|
|
courseService.delCourseById(id);
|
|
|
|
courseService.delCourseById(id);
|
|
|
|
return "success";
|
|
|
|
return JsonResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
@ApiOperation("更新课程")
|
|
|
|
@ApiOperation("更新课程")
|
|
|
|
@PostMapping("update")
|
|
|
|
@PostMapping("update")
|
|
|
|
public String updateById(Course course){
|
|
|
|
public JsonResult updateById(Course course){
|
|
|
|
courseService.update(course);
|
|
|
|
courseService.update(course);
|
|
|
|
return "success";
|
|
|
|
return JsonResult.success();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|