CourseHandoutsController.java 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566
  1. package com.zhongzheng.controller.course;
  2. import com.zhongzheng.common.annotation.Log;
  3. import com.zhongzheng.common.core.controller.BaseController;
  4. import com.zhongzheng.common.core.domain.AjaxResult;
  5. import com.zhongzheng.common.core.page.TableDataInfo;
  6. import com.zhongzheng.common.enums.BusinessType;
  7. import com.zhongzheng.modules.course.bo.CourseHandoutsAddBo;
  8. import com.zhongzheng.modules.course.bo.CourseHandoutsEditBo;
  9. import com.zhongzheng.modules.course.bo.CourseHandoutsQueryBo;
  10. import com.zhongzheng.modules.course.service.ICourseHandoutsService;
  11. import com.zhongzheng.modules.course.vo.CourseHandoutsVo;
  12. import io.swagger.annotations.Api;
  13. import io.swagger.annotations.ApiOperation;
  14. import lombok.RequiredArgsConstructor;
  15. import org.springframework.beans.factory.annotation.Autowired;
  16. import org.springframework.security.access.prepost.PreAuthorize;
  17. import org.springframework.web.bind.annotation.*;
  18. import java.util.List;
  19. /**
  20. * 讲义列Controller
  21. *
  22. * @author ruoyi
  23. * @date 2021-11-02
  24. */
  25. @Api(value = "讲义列控制器", tags = {"讲义列管理"})
  26. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  27. @RestController
  28. @RequestMapping("/course/handouts")
  29. public class CourseHandoutsController extends BaseController {
  30. private final ICourseHandoutsService iCourseHandoutsService;
  31. /**
  32. * 查询讲义列列表
  33. */
  34. @ApiOperation("查询讲义列列表")
  35. @GetMapping("/list")
  36. public TableDataInfo<CourseHandoutsVo> list(CourseHandoutsQueryBo bo) {
  37. startPage();
  38. List<CourseHandoutsVo> list = iCourseHandoutsService.queryList(bo);
  39. return getDataTable(list);
  40. }
  41. /**
  42. * 查询讲义列列表
  43. */
  44. @ApiOperation("查询商品讲义列列表")
  45. @GetMapping("/listByGoods")
  46. public TableDataInfo<CourseHandoutsVo> listByGoods(CourseHandoutsQueryBo bo) {
  47. startPage();
  48. List<CourseHandoutsVo> list = iCourseHandoutsService.queryByGoodsList(bo);
  49. return getDataTable(list);
  50. }
  51. /**
  52. * 获取讲义列详细信息
  53. */
  54. @ApiOperation("获取讲义列详细信息")
  55. @GetMapping("/{handoutsId}")
  56. public AjaxResult<CourseHandoutsVo> getInfo(@PathVariable("handoutsId" ) Long handoutsId) {
  57. return AjaxResult.success(iCourseHandoutsService.queryById(handoutsId));
  58. }
  59. }