参数类型泛型传入和泛型传出
public <U, S> R<U> query(S req, String name, Class<U> type) { R<String> resp = httpPost(name, JSONObject.toJSONString(req)); if (!resp.isSuccess()) { R.fail("网络问题"); } U result = JSONObject.parseObject(resp.getResult(), type); return R.ok(result); }
----淡定从容,宁静致远----