|
@@ -18,6 +18,7 @@ import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.snowflake.Sequence;
|
|
import com.cyksj.common.snowflake.Sequence;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
import com.cyksj.common.util.*;
|
|
import com.cyksj.common.util.*;
|
|
|
|
|
+import com.tencentcloudapi.mongodb.v20180408.models.SpecItem;
|
|
|
import com.yhlxj.dao.mapper.GroupsRelationMapper;
|
|
import com.yhlxj.dao.mapper.GroupsRelationMapper;
|
|
|
import com.yhlxj.dao.mapper.midjourney.*;
|
|
import com.yhlxj.dao.mapper.midjourney.*;
|
|
|
import com.yhlxj.dao.model.dto.*;
|
|
import com.yhlxj.dao.model.dto.*;
|
|
@@ -969,6 +970,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
MidjourneyUserConversation conversation1 = new MidjourneyUserConversation();
|
|
MidjourneyUserConversation conversation1 = new MidjourneyUserConversation();
|
|
|
BeanUtil.copyProperties(conversation, conversation1);
|
|
BeanUtil.copyProperties(conversation, conversation1);
|
|
|
sync(conversation1);
|
|
sync(conversation1);
|
|
|
|
|
+ updAccountVersion(conversation);
|
|
|
} catch (Exception e) {
|
|
} catch (Exception e) {
|
|
|
log.error("同步任务出错 taskId:{}, error:{}", conversation.getTaskId(), StringUtil.getErrorText(e));
|
|
log.error("同步任务出错 taskId:{}, error:{}", conversation.getTaskId(), StringUtil.getErrorText(e));
|
|
|
}
|
|
}
|
|
@@ -985,6 +987,26 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
|
|
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public void updAccountVersion(MidjourneyUserConversation conversation) {
|
|
|
|
|
+ if (conversation.getStatus() != "FAILURE") {
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ if (!conversation.getFailReason().contains("Not enough ratings") || !conversation.getFailReason().contains("Invalid parameter, `--style` is not compatible with `--version 6.1`")){
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+ Long channelId = conversation.getChannelId();
|
|
|
|
|
+ String body = HttpRequest.get("http://147.79.20.196:8086/mj/admin/accounts").header("mj-api-secret", "chen188710").execute().body();
|
|
|
|
|
+ JSONArray jsonArray = JSONUtil.parseArray(body);
|
|
|
|
|
+ jsonArray.forEach(json -> {
|
|
|
|
|
+ JSONObject jsonObject = JSONUtil.parseObj(json);
|
|
|
|
|
+ if (jsonObject.getLong("channelId").equals(channelId) && !jsonObject.getStr("version").equals("6.1")) {
|
|
|
|
|
+ HttpRequest.post("http://147.79.20.196:8086/mj/admin/account-change-version/" + jsonObject.getStr("id") + "?version=6.1").header("mj-api-secret", "chen188710").execute().body();
|
|
|
|
|
+ log.info("updAccountVersion channelId:{}", channelId);
|
|
|
|
|
+ }
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
private BufferedImage readWebPImage(URL url) {
|
|
private BufferedImage readWebPImage(URL url) {
|
|
|
BufferedImage image = null;
|
|
BufferedImage image = null;
|
|
|
Iterator<ImageReader> readers = ImageIO.getImageReadersByMIMEType("image/webp");
|
|
Iterator<ImageReader> readers = ImageIO.getImageReadersByMIMEType("image/webp");
|