|
|
@@ -103,6 +103,8 @@ public class GroupRelationController {
|
|
|
|
|
|
private final ChatGptAuthService chatGptAuthService;
|
|
|
|
|
|
+ private final GoodsCoursewareFileMapper goodsCoursewareFileMapper;
|
|
|
+
|
|
|
private final static Sequence SEQUENCE = new Sequence(0);
|
|
|
|
|
|
@RequestMapping("/get/renewal")
|
|
|
@@ -542,4 +544,26 @@ public class GroupRelationController {
|
|
|
groupRelationFrontService.sendCourseWare(request);
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
|
+
|
|
|
+ //获取课程云盘链接
|
|
|
+ @GetMapping("/get/courseware")
|
|
|
+ public Result<GoodsCoursewareFile> getGoodsCourseware(Long relationId) {
|
|
|
+ long userId = StpUserUtil.getLoginIdAsLong();
|
|
|
+ List<Long> userIdList = userBindRelationService.getRelationUserIdList(userId, null);
|
|
|
+ GroupsRelationView relationView = beanSearcher.searchFirst(GroupsRelationView.class, MapUtils.builder()
|
|
|
+ .field(GroupsRelationView::getUserId, userIdList).op(Operator.InList)
|
|
|
+ .field(GroupsRelationView::getId, relationId).build());
|
|
|
+ if (relationView == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("您的车票不存在");
|
|
|
+ }
|
|
|
+ GoodsCoursewareFile goodsCoursewareFile = goodsCoursewareFileMapper.selectOne(Wrappers.lambdaQuery(GoodsCoursewareFile.class)
|
|
|
+ .eq(GoodsCoursewareFile::getGoodsId, relationView.getGoodsId())
|
|
|
+ .eq(GoodsCoursewareFile::getStatus, true)
|
|
|
+ .select(GoodsCoursewareFile::getLink, GoodsCoursewareFile::getCode)
|
|
|
+ .last("limit 1"));
|
|
|
+ if (goodsCoursewareFile == null) {
|
|
|
+ throw BusinessRuntimeException.getInstance("暂未配置课件链接地址,请联系客服");
|
|
|
+ }
|
|
|
+ return GatewayResponse.SUCCESS.newBuilder().toResult(goodsCoursewareFile);
|
|
|
+ }
|
|
|
}
|