|
|
@@ -232,8 +232,8 @@ public class FeiShuService {
|
|
|
Client client = buildClient(account);
|
|
|
try {
|
|
|
String docId = docApiService.createDocument(client, userCourseVideo.getTitle());
|
|
|
- String courseUrl = buildCourseNewLink(param.getCompanyId(), param.getCompanyUserId(),
|
|
|
- param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink());
|
|
|
+ String courseUrl = buildNewFeiSHuCourseLink(param.getCompanyId(), param.getCompanyUserId(),
|
|
|
+ param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink(),param.getLogId());
|
|
|
docApiService.createIframeBlock(client, docId, courseUrl);
|
|
|
docApiService.changeDocumentPermissions(client, docId);
|
|
|
|
|
|
@@ -283,8 +283,8 @@ public class FeiShuService {
|
|
|
FeishuAccount account = wrapper.getAccount();
|
|
|
try {
|
|
|
String docId = docApiService.createDocument(client, userCourseVideo.getTitle());
|
|
|
- String courseUrl = buildCourseNewLink(param.getCompanyId(), param.getCompanyUserId(),
|
|
|
- param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink());
|
|
|
+ String courseUrl = buildNewFeiSHuCourseLink(param.getCompanyId(), param.getCompanyUserId(),
|
|
|
+ param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink(),param.getLogId());
|
|
|
docApiService.createIframeBlock(client, docId, courseUrl);
|
|
|
docApiService.changeDocumentPermissions(client, docId);
|
|
|
FsCourseLink fsCourseLink = courseLinkMapper.selectFsCourseLinkByLink(param.getLink());
|
|
|
@@ -355,7 +355,7 @@ public class FeiShuService {
|
|
|
try {
|
|
|
String docId = docApiService.createDocument(client, userCourseVideo.getTitle());
|
|
|
String courseUrl = buildCourseNewLink(param.getCompanyId(), param.getCompanyUserId(),
|
|
|
- param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink());
|
|
|
+ param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink(),param.getLogId());
|
|
|
docApiService.createIframeBlock(client, docId, courseUrl);
|
|
|
docApiService.changeDocumentPermissions(client, docId);
|
|
|
String result = "https://www.feishu.cn/docx/" + docId;
|
|
|
@@ -396,7 +396,7 @@ public class FeiShuService {
|
|
|
try {
|
|
|
String docId = docApiService.createDocument(client, userCourseVideo.getTitle());
|
|
|
String courseUrl = buildCourseNewLink(param.getCompanyId(), param.getCompanyUserId(),
|
|
|
- param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink());
|
|
|
+ param.getCourseId(), param.getVideoId(), param.getUserId(), param.getLink(),param.getLogId());
|
|
|
docApiService.createIframeBlock(client, docId, courseUrl);
|
|
|
docApiService.changeDocumentPermissions(client, docId);
|
|
|
String result = "https://www.feishu.cn/docx/" + docId;
|
|
|
@@ -490,7 +490,7 @@ public class FeiShuService {
|
|
|
// ==================== URL构建 ====================
|
|
|
|
|
|
private String buildCourseNewLink(Long companyId, Long companyUserId, Long courseId,
|
|
|
- Long videoId, Long userId, String link) {
|
|
|
+ Long videoId, Long userId, String link,Long logId) {
|
|
|
CourseConfig config = getCourseConfig();
|
|
|
Map<String, Object> courseParam = new LinkedHashMap<>();
|
|
|
courseParam.put("companyUserId", companyUserId);
|
|
|
@@ -516,6 +516,21 @@ public class FeiShuService {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * 新飞书逻辑
|
|
|
+ * */
|
|
|
+ private String buildNewFeiSHuCourseLink(Long companyId, Long companyUserId, Long courseId,
|
|
|
+ Long videoId, Long userId, String link,Long logId) {
|
|
|
+ CourseConfig config = getCourseConfig();
|
|
|
+ try {
|
|
|
+ String fullUrl = config.getFeishuCourseDomain() +
|
|
|
+ "/feishuCourseNew/pages_course/videoDetail?logId=" + logId;
|
|
|
+ return URLEncoder.encode(fullUrl, "UTF-8");
|
|
|
+ } catch (UnsupportedEncodingException e) {
|
|
|
+ throw new CustomException("看课URL拼接失败", e);
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
private String buildAuthLink(Long companyId, Long companyUserId, Long courseId,
|
|
|
Long videoId, String shortLink) {
|
|
|
CourseConfig config = getCourseConfig();
|