{"id":73,"date":"2026-03-02T13:36:48","date_gmt":"2026-03-02T05:36:48","guid":{"rendered":"http:\/\/qiaobenyoucai.top\/?p=73"},"modified":"2026-03-03T10:00:08","modified_gmt":"2026-03-03T02:00:08","slug":"xutils3-0%e7%89%88%e6%9c%ac%e7%9a%84%e5%8f%91%e9%80%81%e5%90%8c%e6%ad%a5%e7%bd%91%e7%bb%9c%e8%af%b7%e6%b1%82%e7%9a%84%e6%96%b9%e5%bc%8f","status":"publish","type":"post","link":"http:\/\/qiaobenyoucai.top\/?p=73","title":{"rendered":"xUtils3.0\u7248\u672c\u7684\u53d1\u9001\u540c\u6b65\u7f51\u7edc\u8bf7\u6c42\u7684\u65b9\u5f0f"},"content":{"rendered":"<p>\u5bf9\u4e8eAndroid\u5f00\u53d1\u6765\u8bf4\uff0c\u57fa\u672c\u90fd\u662f\u7528\u5f02\u6b65\u6765\u4ece\u7f51\u7edc\u4e0a\u8bf7\u6c42\u6570\u636e\uff0c\u5f88\u5c11\u7528\u5230\u540c\u6b65\u8bf7\u6c42\u7684\u3002\u8fd1\u65e5\u9879\u76ee\u6709\u4e2a\u5730\u65b9\u9700\u8981\u4f7f\u7528\u5230\u540c\u6b65\u8bf7\u6c42\uff08\u4ee5\u6211\u76ee\u524d\u7684\u77e5\u8bc6\u50a8\u5907\u6765\u8bf4\u597d\u50cf\u53ea\u80fd\u7528\u540c\u6b65\u8bf7\u6c42\u6765\u89e3\u51b3\u8fd9\u4e2a\u95ee\u9898\u4e86\uff09\uff0c\u53bb\u7f51\u4e0a\u641c\u7d22\u76f8\u5173\u8d44\u6599\uff0c\u53c8\u6ca1\u6709\u627e\u5230\u4ec0\u4e48\u660e\u786e\u7684\u4f7f\u7528\u65b9\u6cd5\u3002\u6240\u4ee5\u8bb0\u4e0b\u6765\uff0c\u4ee5\u5907\u4e0d\u65f6\u4e4b\u9700\u3002<\/p>\n<p>\u9996\u5148bean\u7c7b \u91cc\u8fdb\u884c\u76f8\u5173\uff0c\u6ce8\u89e3\uff1a<br \/>\n<!--more--><\/p>\n<p><code>\/**<br \/>\n* \u7fa4\u6210\u5458\u4fe1\u606f\u7c7b<br \/>\n* Created time on 2016\/6\/28.<br \/>\n*\/<br \/>\n@HttpResponse(parser = JsonResponseParser.class)<br \/>\npublic class GroupMemberInfo implements Serializable{<\/p>\n<p>\/**<br \/>\n* code : 0000<br \/>\n* data : {\"departmentLevel\":{},\"dispatcherLevel\":{\"chinese\":\"\u8d85\u7ea7\u7ba1\u7406\u5458\",\"key\":\"SUPER_ADMI_he<br \/>\n*\/<\/p>\n<p>private String code;<br \/>\n\/**<br \/>\n* headImg :<br \/>\n* imid : 6HAYAkUeqehe\/UtSewyg5tocsw68x8RAJ4SatSeYit7H6eY7dubtz9RpJijbHPibrpdxLw=<br \/>\n* mobile :<br \/>\n* name : \u817e\u8baf\u8d85\u7ea7\u7ba1\u7406\u5458<br \/>\n* uuid :<br \/>\n*\/<\/p>\n<p>private DataBean data;<br \/>\nprivate String msg;<\/p>\n<p>public String getCode() {<br \/>\nreturn code;<br \/>\n}<\/p>\n<p>public void setCode(String code) {<br \/>\nthis.code = code;<br \/>\n}<\/p>\n<p>public DataBean getData() {<br \/>\nreturn data;<br \/>\n}<\/p>\n<p>public void setData(DataBean data) {<br \/>\nthis.data = data;<br \/>\n}<\/p>\n<p>public String getMsg() {<br \/>\nreturn msg;<br \/>\n}<\/p>\n<p>public void setMsg(String msg) {<br \/>\nthis.msg = msg;<br \/>\n}<\/p>\n<p>@Table(name=\"group_member\")<br \/>\npublic static class DataBean implements Serializable {<br \/>\nprivate DepartmentLevelBean departmentLevel;<br \/>\n\/**<br \/>\n* chinese : \u8d85\u7ea7\u7ba1\u7406\u5458<br \/>\n* key : SUPER_ADMIN<br \/>\n*\/<br \/>\n@Column(name =\"uuid\", isId =true)<br \/>\nprivate String uuid;<br \/>\n@Column(name =\"headImg\")<br \/>\nprivate String headImg;<br \/>\n@Column(name =\"imid\")<br \/>\nprivate String imid;<br \/>\n@Column(name =\"mobile\")<br \/>\nprivate String mobile;<br \/>\n@Column(name =\"name\")<br \/>\nprivate String name;<\/p>\n<p>public String getHeadImg() {<br \/>\nreturn headImg;<br \/>\n}<\/p>\n<p>public void setHeadImg(String headImg) {<br \/>\nthis.headImg = headImg;<br \/>\n}<\/p>\n<p>public String getImid() {<br \/>\nreturn imid;<br \/>\n}<\/p>\n<p>public void setImid(String imid) {<br \/>\nthis.imid = imid;<br \/>\n}<\/p>\n<p>public String getMobile() {<br \/>\nreturn mobile;<br \/>\n}<\/p>\n<p>public void setMobile(String mobile) {<br \/>\nthis.mobile = mobile;<br \/>\n}<\/p>\n<p>public String getName() {<br \/>\nreturn name;<br \/>\n}<\/p>\n<p>public void setName(String name) {<br \/>\nthis.name = name;<br \/>\n}<\/p>\n<p>public String getUuid() {<br \/>\nreturn uuid;<br \/>\n}<\/p>\n<p>public void setUuid(String uuid) {<br \/>\nthis.uuid = uuid;<br \/>\n}<br \/>\n}<br \/>\n}<\/code><br \/>\n\u7136\u540e\u5199\u51fa\u89e3\u6790\u5668\u7684\u89e3\u6790\u65b9\u5f0f\uff0c\u6211\u8fd9\u91cc\u91c7\u7528\u7684\u662ffastjson\uff0c\u771f\u662f\u611f\u89c9\u5f88\u597d\u7528\u3002<br \/>\n\/**<br \/>\n* Created by jin<br \/>\n* Created time on 2016\/7\/4.<br \/>\n*\/<br \/>\npublic class JsonResponseParser implements ResponseParser {\/\/ \u5982\u679c\u5b9e\u73b0 InputStreamResponseParser, \u53ef\u5b9e\u73b0\u81ea\u5b9a\u4e49\u6d41\u6570\u636e\u8f6c\u6362.<\/p>\n<p>@Override<br \/>\npublic void checkResponse(UriRequest request) throws Throwable {<br \/>\n\/\/ custom check ?<br \/>\n\/\/ get headers ?<br \/>\n}<\/p>\n<p>\/**<br \/>\n* \u8f6c\u6362result\u4e3aresultType\u7c7b\u578b\u7684\u5bf9\u8c61<br \/>\n*<br \/>\n* @param resultType \u8fd4\u56de\u503c\u7c7b\u578b(\u53ef\u80fd\u5e26\u6709\u6cdb\u578b\u4fe1\u606f)<br \/>\n* @param resultClass \u8fd4\u56de\u503c\u7c7b\u578b<br \/>\n* @param result \u5b57\u7b26\u4e32\u6570\u636e<br \/>\n* @return<br \/>\n* @throws Throwable<br \/>\n*\/<br \/>\n@Override<br \/>\npublic Object parse(Type resultType, Class&lt;?&gt; resultClass, String result) throws Throwable {<br \/>\n\/\/ TODO: json to java bean<br \/>\nif (resultClass == List.class) {<br \/>\n\/\/ fastJson \u89e3\u6790:<br \/>\nreturn JSON.parseArray(result, (Class&lt;?&gt;) ParameterizedTypeUtil.getParameterizedType(resultType, List.class, 0));<br \/>\n} else {<br \/>\n\/\/ fastjson \u89e3\u6790:<br \/>\nreturn JSON.parseObject(result, resultClass);<br \/>\n}<\/p>\n<p>}<br \/>\n}<br \/>\n\u51c6\u5907\u5de5\u4f5c\u5df2\u7ecf\u5b8c\u6210\uff0c\u6700\u540e\u5c31\u662f\u76f4\u63a5\u4f7f\u7528\u4e86\uff0c\u7528\u8d77\u6765\u8fd8\u662f\u5f88\u7b80\u5355\u7684\u3002<br \/>\ntry {<br \/>\nRequestParams params = new RequestParams(UrlConstants.findUserInfoByUuid);<br \/>\nparams.addBodyParameter(&#8220;accessToken&#8221;, User.getAccessToken());<br \/>\nparams.addBodyParameter(&#8220;uid&#8221;, User.getUid());<br \/>\n\/\/\u8fd9\u91cc\u5c31\u662f\u4f7f\u7528\u540c\u6b65\u8bf7\u6c42\u7684\u5730\u65b9\u4e86\uff0c\u53ea\u6709\u4e00\u53e5\u4ee3\u7801\uff0c\u53ef\u4ee5\u76f4\u63a5\u8fd4\u56de\u4e00\u4e2a\u5bf9\u8c61\u3002<br \/>\nGroupMemberInfo groupMemberInfo = x.http().postSync(params, GroupMemberInfo.class);<br \/>\n} catch (Throwable throwable) {<br \/>\nthrowable.printStackTrace();<br \/>\n}<\/p>\n<p>\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014\u2014<br \/>\n\u7248\u6743\u58f0\u660e\uff1a\u672c\u6587\u4e3aCSDN\u535a\u4e3b\u300cDoubleJuce\u300d\u7684\u539f\u521b\u6587\u7ae0\uff0c\u9075\u5faaCC 4.0 BY-SA\u7248\u6743\u534f\u8bae\uff0c\u8f6c\u8f7d\u8bf7\u9644\u4e0a\u539f\u6587\u51fa\u5904\u94fe\u63a5\u53ca\u672c\u58f0\u660e\u3002<br \/>\n\u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/blog.csdn.net\/a836456589\/article\/details\/51821002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5bf9\u4e8eAndroid\u5f00\u53d1\u6765\u8bf4\uff0c\u57fa\u672c\u90fd\u662f\u7528\u5f02\u6b65\u6765\u4ece\u7f51\u7edc\u4e0a\u8bf7\u6c42\u6570\u636e\uff0c\u5f88\u5c11\u7528\u5230\u540c\u6b65\u8bf7\u6c42\u7684\u3002\u8fd1\u65e5\u9879\u76ee\u6709\u4e2a\u5730\u65b9\u9700\u8981\u4f7f\u7528\u5230\u540c<\/p>\n<div class=\"more-link\">\n\t\t\t\t <a href=\"http:\/\/qiaobenyoucai.top\/?p=73\" class=\"link-btn theme-btn\"><span>Read More <\/span> <i class=\"fa fa-caret-right\"><\/i><\/a>\n\t\t\t<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=\/wp\/v2\/posts\/73"}],"collection":[{"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=73"}],"version-history":[{"count":6,"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=\/wp\/v2\/posts\/73\/revisions"}],"predecessor-version":[{"id":87,"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=\/wp\/v2\/posts\/73\/revisions\/87"}],"wp:attachment":[{"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=73"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=73"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/qiaobenyoucai.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=73"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}