package example.api; import example.dto.*; import example.ApiClient; import com.fasterxml.jackson.core.type.TypeReference; import com.fasterxml.jackson.databind.JsonNode; import java.util.List; import java.util.Map; import java.util.HashMap; /** * 其他接口 */ public class OtherApi { private final ApiClient client; public OtherApi(ApiClient client) { this.client = client; } public static final TypeReference getResultType = new TypeReference() { }; /** * 响应基础类型 * */ public String get() { Map params = new HashMap(); return client.get("/other/long",params, getResultType); } public static final TypeReference getContentResultType = new TypeReference() { }; /** * 响应基础类型 * */ public Integer getContent() { Map params = new HashMap(); return client.get("/other/string",params, getContentResultType); } public static final TypeReference> multiplePathVariableResultType = new TypeReference>() { }; /** * 多路径参数 * */ public List multiplePathVariable( String id, String type) { Map params = new HashMap(); return client.get(String.format("/other/boolean/%s/%s",type,id),params, multiplePathVariableResultType); } }