|
@@ -12,12 +12,15 @@ import com.fs.aicall.utils.StringUtils;
|
|
|
import com.fs.common.annotation.Log;
|
|
import com.fs.common.annotation.Log;
|
|
|
import com.fs.common.core.controller.BaseController;
|
|
import com.fs.common.core.controller.BaseController;
|
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
import com.fs.common.core.domain.AjaxResult;
|
|
|
|
|
+import com.fs.common.core.domain.R;
|
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
import com.fs.common.core.page.TableDataInfo;
|
|
|
import com.fs.common.enums.BusinessType;
|
|
import com.fs.common.enums.BusinessType;
|
|
|
import com.fs.common.utils.ServletUtils;
|
|
import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
import com.fs.common.utils.poi.ExcelUtil;
|
|
|
import com.fs.framework.security.LoginUser;
|
|
import com.fs.framework.security.LoginUser;
|
|
|
import com.fs.framework.service.TokenService;
|
|
import com.fs.framework.service.TokenService;
|
|
|
|
|
+import com.fs.system.domain.SysConfig;
|
|
|
|
|
+import com.fs.system.mapper.SysConfigMapper;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
|
import org.springframework.stereotype.Controller;
|
|
import org.springframework.stereotype.Controller;
|
|
@@ -52,6 +55,9 @@ public class CcLlmAgentAccountController extends BaseController
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private TokenService tokenService;
|
|
private TokenService tokenService;
|
|
|
|
|
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ SysConfigMapper sysConfigMapper;
|
|
|
|
|
+
|
|
|
private static List<String> hideKeys = Arrays.asList("apiKey", "oauthPrivateKey", "oauthPublicKeyId", "patToken");
|
|
private static List<String> hideKeys = Arrays.asList("apiKey", "oauthPrivateKey", "oauthPublicKeyId", "patToken");
|
|
|
|
|
|
|
|
|
|
|
|
@@ -157,6 +163,17 @@ public class CcLlmAgentAccountController extends BaseController
|
|
|
if (null == ccLlmAgentAccount.getKbCatId()) {
|
|
if (null == ccLlmAgentAccount.getKbCatId()) {
|
|
|
ccLlmAgentAccount.setKbCatId(-1);
|
|
ccLlmAgentAccount.setKbCatId(-1);
|
|
|
}
|
|
}
|
|
|
|
|
+ if("DeepSeekChat".equalsIgnoreCase(ccLlmAgentAccount.getProviderClassName())){
|
|
|
|
|
+ JSONObject jsonObject = JSONObject.parseObject( ccLlmAgentAccount.getAccountJson());
|
|
|
|
|
+ if(null != jsonObject && jsonObject.containsKey("apiKey") && jsonObject.getString("apiKey").contains("**")){
|
|
|
|
|
+ SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("cId.config");
|
|
|
|
|
+ if(null != sysConfig && StringUtils.isNotBlank(sysConfig.getConfigValue())){
|
|
|
|
|
+ JSONObject configValue = JSONObject.parseObject(sysConfig.getConfigValue());
|
|
|
|
|
+ jsonObject.put("apiKey", configValue.getString("apiKey"));
|
|
|
|
|
+ ccLlmAgentAccount.setAccountJson(JSONObject.toJSONString(jsonObject));
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
|
|
|
// 新增模型
|
|
// 新增模型
|
|
|
int result = ccLlmAgentAccountService.insertCcLlmAgentAccount(ccLlmAgentAccount);
|
|
int result = ccLlmAgentAccountService.insertCcLlmAgentAccount(ccLlmAgentAccount);
|
|
@@ -330,4 +347,11 @@ public class CcLlmAgentAccountController extends BaseController
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @GetMapping("/getCidConfig")
|
|
|
|
|
+ @ResponseBody
|
|
|
|
|
+ public R getCidConfig()
|
|
|
|
|
+ {
|
|
|
|
|
+ SysConfig sysConfig = sysConfigMapper.selectConfigByConfigKey("cId.config");
|
|
|
|
|
+ return R.ok().put("data",sysConfig.getConfigValue());
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|