代码
package com.qing.actuator;
import org.springframework.boot.actuate.endpoint.annotation.Endpoint;
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation;
import org.springframework.stereotype.Component;
import java.util.HashMap;
@Component
//id就是端点的名字
@Endpoint(id = "payPoint",enableByDefault = true)
public class PayEndPoint {
//想要返回信息就return
//想要返回信息格式是json就返回map
@ReadOperation
public Object pay(){
HashMap map = new HashMap();
map.put("pay1","20000");
map.put("pay2","30000");
map.put("pay3","150000");
return map;
}
}
测试
映射
总结