|
|
@@ -127,6 +127,9 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
if (midjourneyUser == null){
|
|
|
throw BusinessRuntimeException.getInstance("10001","会话已过期,请重新登录");
|
|
|
}
|
|
|
+ if (midjourneyUser.getIsBlack()){
|
|
|
+ throw new BusinessRuntimeException("账号异常,请联系客服");
|
|
|
+ }
|
|
|
if(!redisService.hasKey(RedisService.key.MIDJOURNEY_FAST_LIMIT.getName() + midjourneyUser.getId())){
|
|
|
redisService.set(RedisService.key.MIDJOURNEY_FAST_LIMIT.getName() + midjourneyUser.getId(),midjourneyUser.getMjFastNum());
|
|
|
}
|
|
|
@@ -590,18 +593,7 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
redisService.set(key, 1L, RedisService.key.MIDJOURNEY_USER_TIME.getTimeout());
|
|
|
submitCount = 1L;
|
|
|
} else {
|
|
|
- submitCount = redisService.incr(key, 1L);
|
|
|
- int limit = 260;
|
|
|
- Integer white = midjourneyWhiteMapper.selectCount(Wrappers.lambdaQuery(MidjourneyWhite.class).eq(MidjourneyWhite::getUserId, userId));
|
|
|
- if (white > 0) {
|
|
|
- limit = 400;
|
|
|
- }
|
|
|
- if (submitCount > limit) {
|
|
|
- // 24小时内提交次数超过限制,拉黑用户
|
|
|
- user.setIsBlack(true);
|
|
|
- midjourneyUserMapper.updateById(user);
|
|
|
- return;
|
|
|
- }
|
|
|
+ submitCount = Long.valueOf(str);
|
|
|
}
|
|
|
|
|
|
// 根据提交次数设置提交间隔
|
|
|
@@ -631,6 +623,18 @@ public class MidjourneyServiceImpl implements MidjourneyService {
|
|
|
} else {
|
|
|
redisService.set(submitKey, 1L, submitInterval);
|
|
|
}
|
|
|
+
|
|
|
+ submitCount = redisService.incr(key, 1L);
|
|
|
+ int limit = 200;
|
|
|
+ Integer white = midjourneyWhiteMapper.selectCount(Wrappers.lambdaQuery(MidjourneyWhite.class).eq(MidjourneyWhite::getUserId, userId));
|
|
|
+ if (white > 0) {
|
|
|
+ limit = 400;
|
|
|
+ }
|
|
|
+ if (submitCount > limit) {
|
|
|
+ // 24小时内提交次数超过限制,拉黑用户
|
|
|
+ user.setIsBlack(true);
|
|
|
+ midjourneyUserMapper.updateById(user);
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
public String getAccountWithMinUsage(Integer mode,Long instanceId) {
|