|
|
@@ -92,15 +92,16 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
imagineParam.put("base64Array", base64Array);
|
|
|
}
|
|
|
SubmitResult result = submit(user.getMode(),"imagine", null,imagineParam);
|
|
|
- return saveConversation(user.getId(), user.getMode(),result,"IMAGINE", StringUtils.EMPTY);
|
|
|
+ return saveConversation(user.getId(), user.getMode(),result,"IMAGINE", StringUtils.EMPTY, botType);
|
|
|
}
|
|
|
|
|
|
- public MidjourneyUserConversation saveConversation(Long userId,Integer mode,SubmitResult result, String action,String prompt) throws Exception {
|
|
|
+ public MidjourneyUserConversation saveConversation(Long userId,Integer mode,SubmitResult result, String action,String prompt, String botType) throws Exception {
|
|
|
Long taskId = Long.parseLong(result.getResult());
|
|
|
Map<String, Object> properties = result.getProperties();
|
|
|
MidjourneyUserConversation conversation = new MidjourneyUserConversation()
|
|
|
.setUserId(userId).setTaskId(taskId).setAction(action).setPrompt(prompt)
|
|
|
.setMode(mode).setStartTime(System.currentTimeMillis()).setProgress("0%")
|
|
|
+ .setBotType(botType)
|
|
|
.setStatus(result.getCode() == 21 ? "NOT_START" : "IN_PROGRESS").setTaskId(taskId);
|
|
|
if (MapUtil.isNotEmpty(properties)) {
|
|
|
conversation.setProperties(Jsons.toJson(properties));
|
|
|
@@ -120,7 +121,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
.put("botType", botType)
|
|
|
.build();
|
|
|
SubmitResult result = submit(user.getMode(),"describe", null, param);
|
|
|
- return saveConversation(user.getId(), user.getMode(),result,"DESCRIBE", StringUtils.EMPTY);
|
|
|
+ return saveConversation(user.getId(), user.getMode(),result,"DESCRIBE", StringUtils.EMPTY, botType);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -134,7 +135,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
param.put("dimensions", dimensions);
|
|
|
}
|
|
|
SubmitResult result = submit(user.getMode(),"blend", null, param);
|
|
|
- return saveConversation(user.getId(), user.getMode(),result,"BLEND", StringUtils.EMPTY);
|
|
|
+ return saveConversation(user.getId(), user.getMode(),result,"BLEND", StringUtils.EMPTY, botType);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -150,7 +151,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
param.put("maskBase64", maskBase64);
|
|
|
}
|
|
|
SubmitResult result = submit(user.getMode(),"modal", null, param);
|
|
|
- return saveConversation(user.getId(), user.getMode(),result,"MODAL", StringUtils.EMPTY);
|
|
|
+ return saveConversation(user.getId(), user.getMode(),result,"MODAL", StringUtils.EMPTY, StringUtils.EMPTY);
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -161,7 +162,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
.put("botType", botType)
|
|
|
.build();
|
|
|
SubmitResult result = submit(user.getMode(),"shorten", null, param);
|
|
|
- return saveConversation(user.getId(), user.getMode(), result,"SHORTEN", StringUtils.EMPTY);
|
|
|
+ return saveConversation(user.getId(), user.getMode(), result,"SHORTEN", StringUtils.EMPTY, botType);
|
|
|
}
|
|
|
|
|
|
/**
|
|
|
@@ -234,7 +235,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
}else {
|
|
|
syncUser(user.getId(), user.getMode(),num);
|
|
|
}
|
|
|
- saveConversation(user.getId(), user.getMode(), result,"ACTION", StringUtils.EMPTY);
|
|
|
+ saveConversation(user.getId(), user.getMode(), result,"ACTION", StringUtils.EMPTY, botType);
|
|
|
return result;
|
|
|
}
|
|
|
|