he2802 4 lat temu
rodzic
commit
b660039e08

+ 62 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/course/CourseController.java

@@ -0,0 +1,62 @@
+package com.zhongzheng.controller.course;
+
+import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
+import com.zhongzheng.common.annotation.Log;
+import com.zhongzheng.common.core.controller.BaseController;
+import com.zhongzheng.common.core.domain.AjaxResult;
+import com.zhongzheng.common.core.page.TableDataInfo;
+import com.zhongzheng.common.enums.BusinessType;
+import com.zhongzheng.modules.course.bo.CourseAddBo;
+import com.zhongzheng.modules.course.bo.CourseEditBo;
+import com.zhongzheng.modules.course.bo.CourseQueryBo;
+import com.zhongzheng.modules.course.service.ICourseService;
+import com.zhongzheng.modules.course.vo.CourseVo;
+import io.swagger.annotations.Api;
+import io.swagger.annotations.ApiOperation;
+import lombok.RequiredArgsConstructor;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.security.access.prepost.PreAuthorize;
+import org.springframework.validation.annotation.Validated;
+import org.springframework.web.bind.annotation.*;
+
+import java.util.List;
+
+/**
+ * 课程Controller
+ *
+ * @author hjl
+ * @date 2021-05-19
+ */
+@Api(value = "课程控制器", tags = {"课程管理"})
+@RequiredArgsConstructor(onConstructor_ = @Autowired)
+@RestController
+@RequestMapping("/course")
+public class CourseController extends BaseController {
+
+    private final ICourseService iCourseService;
+
+    /**
+     * 查询课程列表
+     */
+    @ApiOperation("查询课程列表")
+    @PreAuthorize("@ss.hasPermi('course:course:list')")
+    @GetMapping("/list")
+    public TableDataInfo<CourseVo> list(CourseQueryBo bo) {
+        startPage();
+        List<CourseVo> list = iCourseService.selectCourseList(bo);
+        return getDataTable(list);
+    }
+
+
+    /**
+     * 获取课程详细信息
+     */
+    @ApiOperation("获取课程详细信息")
+    @PreAuthorize("@ss.hasPermi('course:course:query')")
+    @GetMapping("/{courseId}")
+    public AjaxResult<CourseVo> getInfo(@PathVariable("courseId" ) Long courseId) {
+        return AjaxResult.success(iCourseService.queryById(courseId));
+    }
+
+
+}

+ 1 - 1
zhongzheng-api/src/main/resources/application.yml

@@ -112,7 +112,7 @@ token:
     # 令牌密钥
     secret: abcdefghijklmnopqrstuvwxyz
     # 令牌有效期(默认30分钟)
-    expireTime: 360
+    expireTime: 30
 
 # MyBatis配置
 # https://baomidou.com/config/

+ 1 - 0
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/SecurityConfig.java

@@ -110,6 +110,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
                         "/**/*.css",
                         "/**/*.js"
                 ).permitAll()
+                .antMatchers("/refreshToken/**").anonymous()
                 .antMatchers("/v1/test/**").anonymous()
                 .antMatchers("/v1/**").anonymous()
                 .antMatchers("/profile/**").anonymous()