|
@@ -1,5 +1,6 @@
|
|
|
package com.fs.app.service;
|
|
package com.fs.app.service;
|
|
|
|
|
|
|
|
|
|
+import com.fs.common.core.redis.RedisCache;
|
|
|
import com.fs.common.exception.CustomException;
|
|
import com.fs.common.exception.CustomException;
|
|
|
import com.fs.feishu.domain.FeishuAccount;
|
|
import com.fs.feishu.domain.FeishuAccount;
|
|
|
import com.fs.feishu.service.FeiShuService;
|
|
import com.fs.feishu.service.FeiShuService;
|
|
@@ -21,6 +22,12 @@ public class FeishuAsyncService {
|
|
|
|
|
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private FeiShuService feiShuService;
|
|
private FeiShuService feiShuService;
|
|
|
|
|
+
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private RedisCache redisCache;
|
|
|
|
|
+
|
|
|
|
|
+ private static final String FEISHU_CLIENT = "fei_shu_client:";
|
|
|
|
|
+
|
|
|
@Async // 开启异步任务
|
|
@Async // 开启异步任务
|
|
|
public void processFeishuDocAsync(Client client, String docId, String authUrl,
|
|
public void processFeishuDocAsync(Client client, String docId, String authUrl,
|
|
|
Long videoId, Long companyId, Long courseId,
|
|
Long videoId, Long companyId, Long courseId,
|
|
@@ -29,7 +36,10 @@ public class FeishuAsyncService {
|
|
|
try {
|
|
try {
|
|
|
docApiService.createTextLinkBlock(client, docId, authUrl);
|
|
docApiService.createTextLinkBlock(client, docId, authUrl);
|
|
|
docApiService.changeDocumentPermissions(client, docId);
|
|
docApiService.changeDocumentPermissions(client, docId);
|
|
|
- // 成功时无需记录错误
|
|
|
|
|
|
|
+ // 成功时需要更新docId的文档内容为已填充
|
|
|
|
|
+ String amountKey = FEISHU_CLIENT+docId;
|
|
|
|
|
+ account.setDocumentIdFillFlag(Boolean.TRUE);
|
|
|
|
|
+ redisCache.setCacheObject(amountKey, account);
|
|
|
} catch (CustomException e) {
|
|
} catch (CustomException e) {
|
|
|
// 调用原Service的方法处理异常
|
|
// 调用原Service的方法处理异常
|
|
|
Integer code = e.getCode();
|
|
Integer code = e.getCode();
|