|
|
@@ -66,13 +66,13 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
return saveConversation(user.getId(), user.getMode(),Long.parseLong(result.getResult()),result.getProperties(),"IMAGINE", StringUtils.EMPTY);
|
|
|
}
|
|
|
|
|
|
- public MidjourneyUserConversation saveConversation(Long userId,Integer mode,Long taskId,Map<String,Object> properties, String action,String prompt) {
|
|
|
+ public MidjourneyUserConversation saveConversation(Long userId,Integer mode,Long taskId,Map<String,Object> properties, String action,String prompt) throws Exception {
|
|
|
MidjourneyUserConversation conversation = new MidjourneyUserConversation()
|
|
|
.setUserId(userId).setTaskId(taskId).setAction(action).setPrompt(prompt)
|
|
|
.setMode(mode).setStartTime(System.currentTimeMillis()).setProgress("0%")
|
|
|
.setStatus("IN_PROGRESS").setTaskId(taskId);
|
|
|
if (MapUtil.isNotEmpty(properties)) {
|
|
|
- conversation.setProperties(properties.toString());
|
|
|
+ conversation.setProperties(Jsons.toJson(properties));
|
|
|
conversation.setChannelId(properties.get("discordChannelId") == null ? null : Long.parseLong(properties.get("discordChannelId").toString()))
|
|
|
.setInstanceId(properties.get("discordInstanceId") == null ? null : Long.parseLong(properties.get("discordInstanceId").toString()));
|
|
|
}
|
|
|
@@ -134,6 +134,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
if (StringUtils.isNotBlank(conversation.getButtons())){
|
|
|
Jsons.parseList(conversation.getButtons(), MessageButton.class).forEach(button -> {
|
|
|
if (button.getCustomId().equals(customId)) {
|
|
|
+ log.info("action customId:{}", customId);
|
|
|
button.setStyle(3);
|
|
|
}
|
|
|
});
|