|
|
@@ -244,7 +244,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
throw BusinessRuntimeException.getInstance("账号不存在");
|
|
|
}
|
|
|
if (code == 4) {
|
|
|
- throw BusinessRuntimeException.getInstance("图片重复");
|
|
|
+ throw BusinessRuntimeException.getInstance(submitResult.getDescription());
|
|
|
}
|
|
|
if (code == 24) {
|
|
|
throw BusinessRuntimeException.getInstance("prompt包含敏感词");
|
|
|
@@ -262,7 +262,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
Map<Object, Object> accountsUsage = redisService.hmget(key);
|
|
|
|
|
|
if (accountsUsage == null || accountsUsage.isEmpty()) {
|
|
|
- Map<Object, Object> map = midjourneyAccountService.list(Wrappers.lambdaQuery(MidjourneyAccount.class)).stream().collect(Collectors.toMap(k -> k.getInstanceId().toString(), v -> 0));
|
|
|
+ Map<Object, Object> map = midjourneyAccountService.list(Wrappers.lambdaQuery(MidjourneyAccount.class).eq(MidjourneyAccount::getStatus,Boolean.TRUE)).stream().collect(Collectors.toMap(k -> k.getInstanceId().toString(), v -> 0));
|
|
|
// 保存所有账号ID和使用次数
|
|
|
redisService.hmset(key, map);
|
|
|
}
|