|
|
@@ -1,17 +1,18 @@
|
|
|
package com.emoon.mcp.server.service.impl;
|
|
|
|
|
|
+import cn.hutool.core.collection.CollUtil;
|
|
|
import cn.hutool.core.map.MapUtil;
|
|
|
import com.emoon.mcp.server.service.IMcpService;
|
|
|
-import com.emoon.mcp.server.service.httpclients.AdminClient;
|
|
|
+import com.emoon.mcp.httpclients.AdminClient;
|
|
|
import com.emoon.mcp.util.McpConstants;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import org.dromara.common.core.domain.R;
|
|
|
import org.dromara.common.core.utils.StringUtils;
|
|
|
import org.dromara.common.json.utils.JsonUtils;
|
|
|
-import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
/**
|
|
|
@@ -69,8 +70,8 @@ public class McpServiceImpl implements IMcpService {
|
|
|
if (StringUtils.isEmpty(token)) {
|
|
|
return R.fail("缺少 token 参数");
|
|
|
}
|
|
|
- Map<String, Object> resp = adminClient.knowledgeList(String.format("Bearer: %s", token), MapUtil.removeAny(params, "token"));
|
|
|
- if (MapUtil.isEmpty(resp)) {
|
|
|
+ List<Map<String, Object>> resp = adminClient.knowledgeList(String.format("Bearer: %s", token), MapUtil.removeAny(params, "token"));
|
|
|
+ if (CollUtil.isEmpty(resp)) {
|
|
|
return R.fail("查询失败");
|
|
|
}
|
|
|
// TODO 需要读取 body
|
|
|
@@ -79,30 +80,19 @@ public class McpServiceImpl implements IMcpService {
|
|
|
|
|
|
private R<Object> handleHospitalActivity(Map<String, Object> params) {
|
|
|
log.info("handleHospitalActivity: {}", JsonUtils.toJsonString(params));
|
|
|
- return null;
|
|
|
+ List<Map<String, Object>> resp = adminClient.hospitalActivityList(params);
|
|
|
+ if (CollUtil.isEmpty(resp)) {
|
|
|
+ return R.fail("查询失败");
|
|
|
+ }
|
|
|
+ return R.ok("查询成功", resp);
|
|
|
}
|
|
|
|
|
|
private R<Object> handleFindMedicalRecord(Map<String, Object> params) {
|
|
|
log.info("handleFindMedicalRecord: {}", JsonUtils.toJsonString(params));
|
|
|
- return null;
|
|
|
+ List<Map<String, Object>> medicalRecord = adminClient.findMedicalRecord(params);
|
|
|
+ if (CollUtil.isEmpty(medicalRecord)) {
|
|
|
+ return R.fail("查询失败");
|
|
|
+ }
|
|
|
+ return R.ok("查询成功", medicalRecord);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
}
|