|
|
@@ -1,11 +1,9 @@
|
|
|
package com.cyksj.web.controller.mirror;
|
|
|
|
|
|
import cn.hutool.core.date.DateUtil;
|
|
|
-import cn.hutool.json.JSONObject;
|
|
|
import com.cyksj.common.EnvCommonService;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.common.task.GlobalThreadPoolTaskExecutor;
|
|
|
-import com.cyksj.common.util.IoKit;
|
|
|
import com.cyksj.dto.Result;
|
|
|
import com.cyksj.enums.GatewayResponse;
|
|
|
import com.cyksj.model.entity.ChatgptSession;
|
|
|
@@ -155,7 +153,7 @@ public class MirrorController {
|
|
|
if (user == null) {
|
|
|
response.setStatus(401);
|
|
|
}
|
|
|
- if(StringUtils.isNotBlank(conversationRequest.getCarId())){
|
|
|
+ if (StringUtils.isNotBlank(conversationRequest.getCarId())) {
|
|
|
//4.获取gpt-4 的规则限制
|
|
|
//text-davinci-002-render-sha 3.5
|
|
|
ConversationLimitResponse conversationLimitResponse = chatGptAccountService.conversationLimit(userToken, conversationRequest.getModel(), conversationRequest.getCarId(), user, isCar);
|
|
|
@@ -165,7 +163,10 @@ public class MirrorController {
|
|
|
//String json = "{\"detail\":{\"message\":\"您的账号已达到GPT-4的使用上限。您现在可以继续使用默认模型,或者重试在\",\"code\":\"model_cap_exceeded\",\"clears_in\":2687}}";
|
|
|
ChatgptConversionLimitView chatgptConversionLimitView = new ChatgptConversionLimitView();
|
|
|
ChatgptConversionLimitView.Detail detail = new ChatgptConversionLimitView.Detail();
|
|
|
- detail.setMessage("您目前的套餐已达到GPT-4的使用上限。您可以继续使用3.5,预计 " + DateUtil.format(new Date(conversationLimitResponse.getNextAvailableTime()), "yyyy-MM-dd HH:mm:ss") + " 恢复");
|
|
|
+ String url = "[点击此处升级](https://nf.video/ticket?relationId=%d&pType=pay)";
|
|
|
+
|
|
|
+ String format = String.format(url, user.getRelationId());
|
|
|
+ detail.setMessage("您目前的套餐已达到GPT-4的使用上限。您可以继续使用3.5,预计 " + DateUtil.format(new Date(conversationLimitResponse.getNextAvailableTime()), "yyyy-MM-dd HH:mm:ss") + " 恢复" + ",如需增加滚动时间内可询问次数," + format);
|
|
|
chatgptConversionLimitView.setDetail(detail);
|
|
|
return chatgptConversionLimitView;
|
|
|
} else {
|