|
@@ -373,6 +373,15 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ public JSONObject getConversationCount(String userToken) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ String res = HttpUtil.get("http://154.198.213.52:9611/getConversationCount?userToken=" + userToken);
|
|
|
|
|
+ return new JSONObject(res);
|
|
|
|
|
+ }catch (Exception e){
|
|
|
|
|
+ return null;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
public ChatgptSession checkSession(String carId) {
|
|
public ChatgptSession checkSession(String carId) {
|
|
@@ -547,7 +556,9 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
UpgradePackage upgradePackage = upgradePackageMapper.selectById(chatgptUser.getPackageId());
|
|
UpgradePackage upgradePackage = upgradePackageMapper.selectById(chatgptUser.getPackageId());
|
|
|
packagePrice = upgradePackage.getPrice();
|
|
packagePrice = upgradePackage.getPrice();
|
|
|
}
|
|
}
|
|
|
- return ChatGptUserView.builder()
|
|
|
|
|
|
|
+ JSONObject conversationCount = getConversationCount(chatgptUser.getUserToken());
|
|
|
|
|
+
|
|
|
|
|
+ ChatGptUserView view = ChatGptUserView.builder()
|
|
|
.skuName(goodsDonSku.getSubTitle())
|
|
.skuName(goodsDonSku.getSubTitle())
|
|
|
.expireTime(chatgptUser.getExpireTime())
|
|
.expireTime(chatgptUser.getExpireTime())
|
|
|
.limitNum(chatgptUser.getLimitNum())
|
|
.limitNum(chatgptUser.getLimitNum())
|
|
@@ -557,17 +568,23 @@ public class ChatGptAccountServiceImpl implements ChatGptAccountService {
|
|
|
.goodsId(goodsDonSku.getGoodsId())
|
|
.goodsId(goodsDonSku.getGoodsId())
|
|
|
.skuId(goodsDonSku.getId())
|
|
.skuId(goodsDonSku.getId())
|
|
|
.months(goodsDonSku.getMonths())
|
|
.months(goodsDonSku.getMonths())
|
|
|
- .use(Math.min(chatgptUser.getLimitNum(), getConversationCount(chatgptUser.getUserToken(), chatgptUser.getLimitTime())))
|
|
|
|
|
|
|
+ .use(Math.min(chatgptUser.getLimitNum(), conversationCount.getLong("count")))
|
|
|
.packageId(chatgptUser.getPackageId())
|
|
.packageId(chatgptUser.getPackageId())
|
|
|
.packagePrice(packagePrice)
|
|
.packagePrice(packagePrice)
|
|
|
.isRenewPackage(chatgptUser.getRenewOrderId() != null ? true : false)
|
|
.isRenewPackage(chatgptUser.getRenewOrderId() != null ? true : false)
|
|
|
.renewSkuId(chatgptUser.getRenewSkuId())
|
|
.renewSkuId(chatgptUser.getRenewSkuId())
|
|
|
.renewOrderId(chatgptUser.getRenewOrderId())
|
|
.renewOrderId(chatgptUser.getRenewOrderId())
|
|
|
.build();
|
|
.build();
|
|
|
|
|
+ if (chatgptUser.getLimitNum() > 20) {
|
|
|
|
|
+ view.setO1PUse(Math.min(chatgptUser.getLimitNum() < 60 ? 5L : 15L, conversationCount.getLong("o1_p")));
|
|
|
|
|
+ view.setO1MiniUse(Math.min(chatgptUser.getLimitNum() < 60 ? 10L : 25L, conversationCount.getLong("o1_mini")));
|
|
|
|
|
+ }
|
|
|
|
|
+ return view;
|
|
|
} else {
|
|
} else {
|
|
|
throw BusinessRuntimeException.getInstance("您还未购买该车票");
|
|
throw BusinessRuntimeException.getInstance("您还未购买该车票");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public ChatGptUserView getUserInfoWithToken(String userToken) {
|
|
public ChatGptUserView getUserInfoWithToken(String userToken) {
|
|
|
if (checkCarAccountWithToken(userToken)) {
|
|
if (checkCarAccountWithToken(userToken)) {
|