|
|
@@ -63,6 +63,11 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
|
|
|
Long instanceId = getAccount(midjourneyAccount.getId());
|
|
|
midjourneyAccount.setInstanceId(instanceId);
|
|
|
baseMapper.updateById(midjourneyAccount);
|
|
|
+ String key = RedisService.key.MIDJOURNEY_ACCOUNT.getName();
|
|
|
+ Map<Object, Object> accountsUsage = redisService.hmget(key);
|
|
|
+ if (MapUtil.isNotEmpty(accountsUsage)) {
|
|
|
+ redisService.hset(key,midjourneyAccount.getInstanceId().toString(),accountsUsage.values().toArray()[0]);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -75,6 +80,7 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
|
|
|
baseMapper.deleteById(id);
|
|
|
//删除plus服务账号信息
|
|
|
delAcount(midjourneyAccount.getInstanceId());
|
|
|
+ redisService.hdel(RedisService.key.MIDJOURNEY_ACCOUNT.getName(),midjourneyAccount.getInstanceId());
|
|
|
}
|
|
|
|
|
|
@Override
|
|
|
@@ -98,6 +104,15 @@ public class MidJourneyAccountServiceImpl extends ServiceImpl<MidjourneyAccountM
|
|
|
midjourneyAccount.setStatus(!midjourneyAccount.getStatus());
|
|
|
baseMapper.updateById(midjourneyAccount);
|
|
|
updAccount(midjourneyAccount);
|
|
|
+ String key = RedisService.key.MIDJOURNEY_ACCOUNT.getName();
|
|
|
+ if (!midjourneyAccount.getStatus()) {
|
|
|
+ redisService.hdel(key,midjourneyAccount.getInstanceId());
|
|
|
+ }else {
|
|
|
+ Map<Object, Object> accountsUsage = redisService.hmget(key);
|
|
|
+ if (MapUtil.isNotEmpty(accountsUsage)) {
|
|
|
+ redisService.hset(key,midjourneyAccount.getInstanceId().toString(),accountsUsage.values().toArray()[0]);
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@Override
|