|
@@ -0,0 +1,32 @@
|
|
|
|
|
+package com.purui.ghip.feign;
|
|
|
|
|
+
|
|
|
|
|
+import org.springframework.cloud.openfeign.FeignClient;
|
|
|
|
|
+import org.springframework.web.bind.annotation.PostMapping;
|
|
|
|
|
+import org.springframework.web.bind.annotation.RequestBody;
|
|
|
|
|
+
|
|
|
|
|
+/**
|
|
|
|
|
+ * APM 服务
|
|
|
|
|
+ *
|
|
|
|
|
+ * @author zhengjie
|
|
|
|
|
+ * @date 2026/1/23
|
|
|
|
|
+ */
|
|
|
|
|
+@FeignClient(name = "apm-service", path = "/messages", fallback = ApmServiceClient.ApmServiceClientFallback.class)
|
|
|
|
|
+public interface ApmServiceClient {
|
|
|
|
|
+
|
|
|
|
|
+ /**
|
|
|
|
|
+ * 发送消息
|
|
|
|
|
+ *
|
|
|
|
|
+ * @param requestBody 请求体
|
|
|
|
|
+ * @return 响应体(JSON 字符串)
|
|
|
|
|
+ */
|
|
|
|
|
+ @PostMapping("/send")
|
|
|
|
|
+ String sendMessage(@RequestBody Object requestBody);
|
|
|
|
|
+
|
|
|
|
|
+ static class ApmServiceClientFallback implements ApmServiceClient {
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public String sendMessage(Object requestBody) {
|
|
|
|
|
+ return "{\"errorCode\":\"-1\",\"errorMessage\":\"APM服务不可用\"}";
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+}
|
|
|
|
|
+
|