|
@@ -2,6 +2,8 @@ package com.cyksj.web.controller.manage.account;
|
|
|
|
|
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
import cn.hutool.core.util.StrUtil;
|
|
import cn.hutool.core.util.StrUtil;
|
|
|
|
|
+import cn.hutool.json.JSONObject;
|
|
|
|
|
+import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
import com.cyksj.common.exception.BusinessRuntimeException;
|
|
|
import com.cyksj.dto.Result;
|
|
import com.cyksj.dto.Result;
|
|
@@ -112,6 +114,24 @@ public class CmsGptCarController {
|
|
|
chatgptSession.setIsCar(true);
|
|
chatgptSession.setIsCar(true);
|
|
|
chatgptSession.setOfficialSession(gptSession);
|
|
chatgptSession.setOfficialSession(gptSession);
|
|
|
chatgptSessionMapper.insert(chatgptSession);
|
|
chatgptSessionMapper.insert(chatgptSession);
|
|
|
|
|
+ if(StringUtils.isBlank(chatgptSession.getCarId())){
|
|
|
|
|
+ JSONObject jsonObject = new JSONObject(gptSession);
|
|
|
|
|
+ String planType = jsonObject.getJSONObject("accountCheckInfo").getStr("plan_type");
|
|
|
|
|
+ if ("plus".equals(planType)) {
|
|
|
|
|
+ chatgptSession.setCarId("P" + chatgptSession.getId());
|
|
|
|
|
+ chatgptSession.setCarName("P" + chatgptSession.getId());
|
|
|
|
|
+ }else if("team".equals(planType)) {
|
|
|
|
|
+ chatgptSession.setCarId("T" + chatgptSession.getId());
|
|
|
|
|
+ chatgptSession.setCarName("T" + chatgptSession.getId());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ chatgptSession.setCarId("P" + chatgptSession.getId());
|
|
|
|
|
+ chatgptSession.setCarName("P" + chatgptSession.getId());
|
|
|
|
|
+ chatgptSession.setIsPlus(0);
|
|
|
|
|
+ }
|
|
|
|
|
+ chatgptSessionMapper.updateById(chatgptSession);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+
|
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
return GatewayResponse.SUCCESS.newBuilder().toResult();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|