|
|
@@ -156,17 +156,11 @@ public class MiniPopularizeFrontServiceImpl implements MiniPopularizeFrontServic
|
|
|
if (conversationId == null) {
|
|
|
//查询当前用户信息
|
|
|
MiniPopularizeUser user = miniPopularizeUserMapper.selectOne(Wrappers.lambdaQuery(MiniPopularizeUser.class).eq(MiniPopularizeUser::getUserId, userId));
|
|
|
- Long num = 0L;
|
|
|
if (user.getNum() == 0) {
|
|
|
throw BusinessRuntimeException.getInstance("无可用次数");
|
|
|
}
|
|
|
- num = redisService.decr(RedisService.key.MINI_POPULARIZE_GPT_NUM.getName() + userId, 1L);
|
|
|
- if (num < 0) {
|
|
|
- redisService.incr(RedisService.key.MINI_POPULARIZE_GPT_NUM.getName() + userId, 1L);
|
|
|
- }
|
|
|
int i = miniPopularizeUserMapper.decLumaNum(userId, 1, user.getNum());
|
|
|
if (i == 0) {
|
|
|
- redisService.incr(RedisService.key.MINI_POPULARIZE_GPT_NUM.getName() + userId, 1L);
|
|
|
throw BusinessRuntimeException.getInstance("网络异常,请稍后再试");
|
|
|
}
|
|
|
conversation.setConversationId(RandomUtil.randomString(64));
|