|
|
@@ -129,6 +129,7 @@ public class MidjourneyController {
|
|
|
* 同步数据库
|
|
|
*/
|
|
|
public void syncUser(Long id,Integer mode,Long num){
|
|
|
+ log.info("同步次数 id:{},mode:{},num:{}",id,mode,num);
|
|
|
if (num == null){
|
|
|
return;
|
|
|
}
|
|
|
@@ -162,7 +163,7 @@ public class MidjourneyController {
|
|
|
log.info("提交Imagine任务,提示:{},base64数组长度:{}",submitImagineDTO.getPrompt(),submitImagineDTO.getBase64Array());
|
|
|
MidjourneyUser user = getUser();
|
|
|
Long num = checkUserLimit(user);
|
|
|
- if (num != null && num == 0){
|
|
|
+ if (num != null && num <= 0){
|
|
|
throw BusinessRuntimeException.getInstance("次数已用完");
|
|
|
}
|
|
|
MidjourneyUserConversation conversation;
|
|
|
@@ -184,7 +185,7 @@ public class MidjourneyController {
|
|
|
log.info("提交Describe任务");
|
|
|
MidjourneyUser user = getUser();
|
|
|
Long num = checkUserLimit(user);
|
|
|
- if (num != null && num == 0){
|
|
|
+ if (num != null && num <= 0){
|
|
|
throw BusinessRuntimeException.getInstance("次数已用完");
|
|
|
}
|
|
|
MidjourneyUserConversation conversation;
|
|
|
@@ -206,7 +207,7 @@ public class MidjourneyController {
|
|
|
log.info("提交Blend任务 dimensions:{},base64数组长度:{}", submitBlendDTO.getDimensions(), submitBlendDTO.getBase64Array().size());
|
|
|
MidjourneyUser user = getUser();
|
|
|
Long num = checkUserLimit(user);
|
|
|
- if (num != null && num == 0){
|
|
|
+ if (num != null && num <= 0){
|
|
|
throw BusinessRuntimeException.getInstance("次数已用完");
|
|
|
}
|
|
|
MidjourneyUserConversation conversation;
|
|
|
@@ -228,7 +229,7 @@ public class MidjourneyController {
|
|
|
log.info("提交Modal任务,taskId:{},提示:{},base64数组长度:{}",submitModalDTO.getTaskId(),submitModalDTO.getPrompt(),submitModalDTO.getMaskBase64());
|
|
|
MidjourneyUser user = getUser();
|
|
|
Long num = checkUserLimit(user);
|
|
|
- if (num != null && num == 0){
|
|
|
+ if (num != null && num <= 0){
|
|
|
throw BusinessRuntimeException.getInstance("次数已用完");
|
|
|
}
|
|
|
MidjourneyUserConversation conversation;
|
|
|
@@ -250,7 +251,7 @@ public class MidjourneyController {
|
|
|
log.info("提交Shorten任务 提示词:{}",submitShortenDTO.getPrompt());
|
|
|
MidjourneyUser user = getUser();
|
|
|
Long num = checkUserLimit(user);
|
|
|
- if (num != null && num == 0){
|
|
|
+ if (num != null && num <= 0){
|
|
|
throw BusinessRuntimeException.getInstance("次数已用完");
|
|
|
}
|
|
|
MidjourneyUserConversation conversation;
|
|
|
@@ -272,7 +273,7 @@ public class MidjourneyController {
|
|
|
log.info("任务id:{},执行动作:{}",actionDTO.getTaskId(),actionDTO.getCustomId());
|
|
|
MidjourneyUser user = getUser();
|
|
|
Long num = checkUserLimit(user);
|
|
|
- if (num != null && num == 0){
|
|
|
+ if (num != null && num <= 0){
|
|
|
throw BusinessRuntimeException.getInstance("次数已用完");
|
|
|
}
|
|
|
MidjourneyUserConversation conversation;
|