|
@@ -4,9 +4,15 @@ import com.qmth.boot.api.annotation.Aac;
|
|
|
import com.qmth.boot.core.ai.model.llm.LlmAppType;
|
|
|
import com.qmth.ops.api.constants.OpsApiConstants;
|
|
|
import com.qmth.ops.api.vo.CodeNameVO;
|
|
|
+import com.qmth.ops.biz.service.LlmClientService;
|
|
|
+import com.qmth.ops.biz.service.LlmModelService;
|
|
|
+import com.qmth.ops.biz.service.LlmSupplierService;
|
|
|
import org.springframework.web.bind.annotation.RequestMapping;
|
|
|
+import org.springframework.web.bind.annotation.RequestParam;
|
|
|
import org.springframework.web.bind.annotation.RestController;
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.LinkedList;
|
|
|
import java.util.List;
|
|
|
|
|
@@ -16,6 +22,15 @@ public class LlmInfoController {
|
|
|
|
|
|
private List<CodeNameVO> appTypeList;
|
|
|
|
|
|
+ @Resource
|
|
|
+ private LlmSupplierService llmSupplierService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private LlmModelService llmModelService;
|
|
|
+
|
|
|
+ @Resource
|
|
|
+ private LlmClientService llmClientService;
|
|
|
+
|
|
|
@RequestMapping("/app_types")
|
|
|
@Aac(auth = false)
|
|
|
public Object list() {
|
|
@@ -27,4 +42,23 @@ public class LlmInfoController {
|
|
|
return appTypeList;
|
|
|
}
|
|
|
|
|
|
+ @RequestMapping("/client_refresh")
|
|
|
+ @Aac(auth = false)
|
|
|
+ public Object refreshClient(@RequestParam(required = false) Long supplierId,
|
|
|
+ @RequestParam(required = false) Long modelId) {
|
|
|
+ if (supplierId != null) {
|
|
|
+ llmClientService.updateBySupplier(llmSupplierService.getById(supplierId));
|
|
|
+ return new HashMap<String, Long>() {{
|
|
|
+ put("supplierId", supplierId);
|
|
|
+ }};
|
|
|
+ } else if (modelId != null) {
|
|
|
+ llmClientService.updateByModel(llmModelService.getById(modelId));
|
|
|
+ return new HashMap<String, Long>() {{
|
|
|
+ put("modelId", modelId);
|
|
|
+ }};
|
|
|
+ } else {
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
}
|