xiaoyaoyou1212 / viseutils Goto Github PK
View Code? Open in Web Editor NEW整理的系列基础工具类,包含辅助工具、加密解密、数据转换、IO操作、系统工具等。
Home Page: http://www.huwei.tech/
整理的系列基础工具类,包含辅助工具、加密解密、数据转换、IO操作、系统工具等。
Home Page: http://www.huwei.tech/
咱的加密功能有支持SM4国密算法吗?
@Override public ApiResult<T> call(ResponseBody responseBody) { Gson gson = new Gson(); ApiResult<T> apiResult = new ApiResult<T>(); apiResult.setStatus(-1); try { String json = responseBody.string(); if (clazz.equals(String.class)) { apiResult.setData((T) json); apiResult.setStatus(0); } else { ApiResult result = parseApiResult(json, apiResult); if (result != null) { apiResult = result; if (apiResult.getData() != null) { T data = gson.fromJson(apiResult.getData().toString(), clazz); apiResult.setData(data); } else { apiResult.setMessage("ApiResult's data is null"); } } else { apiResult.setMessage("json is null"); } } } catch (JSONException e) { e.printStackTrace(); apiResult.setMessage(e.getMessage()); } catch (IOException e) { e.printStackTrace(); apiResult.setMessage(e.getMessage()); } finally { responseBody.close(); } return apiResult; }
我觉得这个方法这里应该返回 T ,code 这些可以在这里统一的进行处理下。我试了这个apiGet这个方法,总是搞不对类型。谢谢大神教教我。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.