zyp 5 天之前
父節點
當前提交
6882cbee16

+ 11 - 0
fs-company-app/src/main/java/com/fs/app/controller/FsUserCourseVideoController.java

@@ -1,6 +1,7 @@
 package com.fs.app.controller;
 
 import cn.hutool.core.date.DateUtil;
+import cn.hutool.json.JSONUtil;
 import com.fasterxml.jackson.core.JsonProcessingException;
 import com.fs.app.annotation.Login;
 import com.fs.app.config.ImageStorageConfig;
@@ -16,6 +17,7 @@ import com.fs.company.domain.CompanyUser;
 import com.fs.company.service.ICompanyMiniappService;
 import com.fs.company.service.ICompanyService;
 import com.fs.company.service.ICompanyUserService;
+import com.fs.course.config.CourseConfig;
 import com.fs.course.domain.FsUserCoursePeriod;
 import com.fs.course.dto.BatchSendCourseDTO;
 import com.fs.course.dto.BatchUrgeCourseDTO;
@@ -36,6 +38,7 @@ import com.fs.im.service.IFsImMsgSendDetailService;
 import com.fs.im.service.IFsImMsgSendLogService;
 import com.fs.im.service.OpenIMService;
 import com.fs.im.vo.FsImMsgSendLogVO;
+import com.fs.system.service.ISysConfigService;
 import com.github.pagehelper.PageHelper;
 import com.github.pagehelper.PageInfo;
 import io.swagger.annotations.Api;
@@ -280,6 +283,8 @@ public class FsUserCourseVideoController extends AppBaseController {
         return ResponseResult.ok(courseLinkService.getGotoWxAppLink(linkStr,appid));
     }
 
+    @Autowired
+    private ISysConfigService configService;
     @GetMapping("/getGotoAppLink")
     @ApiOperation("获取跳转微信小程序的链接地址")
     public ResponseResult<String> getGotoWxAppLink(String linkStr, Long companyId) {
@@ -295,6 +300,12 @@ public class FsUserCourseVideoController extends AppBaseController {
         return ResponseResult.ok(courseLinkService.getGotoWxAppLink(linkStr,appid));
     }
 
+    @GetMapping("/getGotoH5Link")
+    @ApiOperation("获取H5看课的链接地址")
+    public ResponseResult<String> getGotoH5Link(String linkStr) {
+        return ResponseResult.ok(courseLinkService.getGotoH5Link(linkStr));
+    }
+
     @ApiOperation("会员批量发送课程消息")
     @PostMapping("/batchSendCourse")
     public OpenImResponseDTO batchSendCourse(@RequestBody BatchSendCourseDTO batchSendCourseDTO) throws JsonProcessingException {

+ 2 - 0
fs-service/src/main/java/com/fs/course/service/IFsCourseLinkService.java

@@ -96,4 +96,6 @@ public interface IFsCourseLinkService
     R getWxaCodeGenerateScheme(String linkStr,String appId);
 
     R getProjectCode();
+
+    String getGotoH5Link(String linkStr);
 }

+ 10 - 0
fs-service/src/main/java/com/fs/course/service/impl/FsCourseLinkServiceImpl.java

@@ -922,4 +922,14 @@ public class FsCourseLinkServiceImpl implements IFsCourseLinkService
         }
         return R.ok().put("code",code);
     }
+
+    @Override
+    public String getGotoH5Link(String linkStr) {
+        String json = configService.selectConfigByKey("course.config");
+        CourseConfig config = JSONUtil.toBean(json, CourseConfig.class);
+
+        String url = config.getCourseDomainName()+linkStr;
+        return url;
+
+    }
 }