|
|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.annotation.NoSubmit;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.util.IoKit;
|
|
|
+import com.cyksj.common.util.StringUtil;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.ejlchina.searcher.BeanSearcher;
|
|
|
@@ -206,6 +207,7 @@ public class MidjourneyController {
|
|
|
conversation = midjourneyService.submitImagine(user, mode, submitImagineDTO.getPrompt(), submitImagineDTO.getBotType(), submitImagineDTO.getBase64Array());
|
|
|
} catch (Exception e) {
|
|
|
recoverUserLimit(user.getId(), mode,num);
|
|
|
+ log.error("提交Imagine任务异常,{}", StringUtil.getErrorText(e));
|
|
|
throw BusinessRuntimeException.getInstance(e.getMessage());
|
|
|
}
|
|
|
//syncUser(user.getId(), user.getMode(), num);
|
|
|
@@ -230,6 +232,7 @@ public class MidjourneyController {
|
|
|
conversation = midjourneyService.submitDescribe(user, mode,submitDescribeDTO.getBotType(),submitDescribeDTO.getBase64());
|
|
|
} catch (Exception e) {
|
|
|
recoverUserLimit(user.getId(), mode,num);
|
|
|
+ log.error("提交Describe任务异常,{}", StringUtil.getErrorText(e));
|
|
|
throw BusinessRuntimeException.getInstance(e.getMessage());
|
|
|
}
|
|
|
//syncUser(user.getId(), user.getMode(), num);
|
|
|
@@ -254,6 +257,7 @@ public class MidjourneyController {
|
|
|
conversation = midjourneyService.submitBlend(user, mode,submitBlendDTO.getDimensions(), submitBlendDTO.getBotType(), submitBlendDTO.getBase64Array());
|
|
|
} catch (Exception e) {
|
|
|
recoverUserLimit(user.getId(), mode,num);
|
|
|
+ log.error("提交Blend任务异常,{}", StringUtil.getErrorText(e));
|
|
|
throw BusinessRuntimeException.getInstance(e.getMessage());
|
|
|
}
|
|
|
//syncUser(user.getId(), user.getMode(), num);
|
|
|
@@ -282,6 +286,7 @@ public class MidjourneyController {
|
|
|
conversation = midjourneyService.submitModal(user, mode, submitModalDTO.getTaskId(), submitModalDTO.getPrompt(), submitModalDTO.getMaskBase64());
|
|
|
} catch (Exception e) {
|
|
|
recoverUserLimit(user.getId(), mode,num);
|
|
|
+ log.error("提交Modal任务异常,{}", StringUtil.getErrorText(e));
|
|
|
throw BusinessRuntimeException.getInstance(e.getMessage());
|
|
|
}
|
|
|
//syncUser(user.getId(), user.getMode(), num);
|
|
|
@@ -338,6 +343,7 @@ public class MidjourneyController {
|
|
|
conversation = midjourneyService.submitAction(user,midjourneyUserConversation,mode, actionDTO.getTaskId(), actionDTO.getCustomId(),num, actionDTO.getBotType(), apiChannelId);
|
|
|
} catch (Exception e) {
|
|
|
recoverUserLimit(user.getId(), mode,num);
|
|
|
+ log.error("执行动作异常,{}", StringUtil.getErrorText(e));
|
|
|
throw BusinessRuntimeException.getInstance(e.getMessage());
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(conversation);
|
|
|
@@ -360,6 +366,7 @@ public class MidjourneyController {
|
|
|
conversation = midjourneyService.submitSeed(user, mode, seedDTO.getTaskId(), seedDTO.getBotType());
|
|
|
} catch (Exception e) {
|
|
|
recoverUserLimit(user.getId(), mode,num);
|
|
|
+ log.error("执行seed动作异常,{}", StringUtil.getErrorText(e));
|
|
|
throw BusinessRuntimeException.getInstance(e.getMessage());
|
|
|
}
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult(conversation);
|