CommonController.java 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. package com.zhongzheng.controller.cmmon;
  2. import com.zhongzheng.common.core.controller.BaseController;
  3. import com.zhongzheng.common.core.domain.AjaxResult;
  4. import com.zhongzheng.common.core.page.TableDataInfo;
  5. import com.zhongzheng.common.core.redis.RedisCache;
  6. import com.zhongzheng.common.utils.ServletUtils;
  7. import com.zhongzheng.framework.web.service.WxTokenService;
  8. import com.zhongzheng.modules.course.bo.CourseMenuQueryBo;
  9. import com.zhongzheng.modules.course.bo.CourseQueryBo;
  10. import com.zhongzheng.modules.course.service.ICourseChapterSectionService;
  11. import com.zhongzheng.modules.course.service.ICourseMenuService;
  12. import com.zhongzheng.modules.course.service.ICourseModuleChapterService;
  13. import com.zhongzheng.modules.course.service.ICourseService;
  14. import com.zhongzheng.modules.course.vo.CourseUserChapterSectionVo;
  15. import com.zhongzheng.modules.course.vo.CourseUserMenuVo;
  16. import com.zhongzheng.modules.course.vo.CourseUserModuleChapterVo;
  17. import com.zhongzheng.modules.course.vo.CourseUserVo;
  18. import com.zhongzheng.modules.goods.bo.GoodsAttachedQueryBo;
  19. import com.zhongzheng.modules.goods.service.IGoodsAttachedService;
  20. import com.zhongzheng.modules.goods.vo.GoodsAttachedVo;
  21. import com.zhongzheng.modules.goods.vo.GoodsUserVo;
  22. import com.zhongzheng.modules.order.bo.OrderAddBo;
  23. import com.zhongzheng.modules.order.domain.Printer;
  24. import com.zhongzheng.modules.order.service.IOrderGoodsService;
  25. import com.zhongzheng.modules.order.service.IOrderService;
  26. import com.zhongzheng.modules.user.entity.ClientLoginUser;
  27. import io.swagger.annotations.Api;
  28. import io.swagger.annotations.ApiOperation;
  29. import lombok.RequiredArgsConstructor;
  30. import org.springframework.beans.factory.annotation.Autowired;
  31. import org.springframework.security.access.prepost.PreAuthorize;
  32. import org.springframework.web.bind.annotation.*;
  33. import java.util.List;
  34. /**
  35. * 课程Controller
  36. *
  37. * @author hjl
  38. * @date 2021-10-09
  39. */
  40. @Api(value = "游客访问接口", tags = {"游客访问接口"})
  41. @RequiredArgsConstructor(onConstructor_ = @Autowired)
  42. @RestController
  43. @RequestMapping("/app/common/")
  44. public class CommonController extends BaseController {
  45. private final ICourseService iCourseService;
  46. @Autowired
  47. private RedisCache redisCache;
  48. /**
  49. * 查询课程列表
  50. */
  51. @ApiOperation("查询商品下的课程列表")
  52. @GetMapping("/courseList")
  53. public TableDataInfo<CourseUserVo> courseList(CourseQueryBo bo) {
  54. startPage();
  55. List<CourseUserVo> list = iCourseService.courseList(bo);
  56. return getDataTable(list);
  57. }
  58. /**
  59. * 查询课程列表
  60. */
  61. @ApiOperation("查询用户拥有的商品")
  62. @GetMapping("/goodsList")
  63. public TableDataInfo<GoodsUserVo> goodsList(CourseQueryBo bo) {
  64. startPage();
  65. List<GoodsUserVo> list = iCourseService.goodsList(bo);
  66. return getDataTable(list);
  67. }
  68. @ApiOperation("查询用户拥有的商品")
  69. @GetMapping("/test")
  70. public AjaxResult<Integer> test(CourseQueryBo bo) throws InterruptedException {
  71. Printer.num = 0;
  72. new Thread(new Printer(0,redisCache)).start();
  73. new Thread(new Printer(1,redisCache)).start();
  74. new Thread(new Printer(2,redisCache)).start();
  75. Thread.sleep(5000);
  76. return AjaxResult.success(Printer.num);
  77. }
  78. }