|
|
@@ -400,18 +400,28 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
|
|
|
|
|
|
@Override
|
|
|
- public ConversationLimitResponse conversationLimit(String userToken, String model, String carId, ChatgptUser chatgptUser) {
|
|
|
+ public ConversationLimitResponse conversationLimit(String userToken, String model, String carId, ChatgptUser chatgptUser, Boolean isCar) {
|
|
|
ConversationLimitResponse conversationLimitResponse = new ConversationLimitResponse();
|
|
|
conversationLimitResponse.setLimited(false);
|
|
|
if (!"text-davinci-002-render-sha".equals(model)) {
|
|
|
//如果不为车队 直接返回
|
|
|
- if (!chatgptUser.getIsCar()) {
|
|
|
- return conversationLimitResponse;
|
|
|
+ if (chatgptUser.getIsCar()) {
|
|
|
+ conversationLimitResponse = isConversationAllowed(userToken, chatgptUser.getLimitNum(), chatgptUser.getLimitTime());
|
|
|
+ }
|
|
|
+ if(carId == null){
|
|
|
+ if (StringUtils.isNotBlank(userToken)) {
|
|
|
+ if (chatgptUser.getSessionId() != null) {
|
|
|
+ ChatgptSession chatgptSession = chatgptSessionMapper.selectById(chatgptUser.getSessionId());
|
|
|
+ if(chatgptSession != null){
|
|
|
+ carId = chatgptSession.getCarId();
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
}
|
|
|
- conversationLimitResponse = isConversationAllowed(userToken, chatgptUser.getLimitNum(), chatgptUser.getLimitTime());
|
|
|
//车队次数记录
|
|
|
+ String finalCarId = carId;
|
|
|
TASK_EXECUTOR.execute(() -> {
|
|
|
- cardConversationRecord(carId);
|
|
|
+ cardConversationRecord(finalCarId);
|
|
|
});
|
|
|
}
|
|
|
|