1111import me .chanjar .weixin .enterprise .bean .*;
1212import me .chanjar .weixin .enterprise .util .http .SimpleGetRequestExecutor ;
1313import me .chanjar .weixin .enterprise .util .crypto .SHA1 ;
14+ import me .chanjar .weixin .enterprise .util .json .WxCpGsonBuilder ;
1415import org .apache .commons .lang3 .StringUtils ;
1516import org .apache .http .client .ClientProtocolException ;
1617import org .apache .http .client .methods .CloseableHttpResponse ;
1920import org .apache .http .impl .client .CloseableHttpClient ;
2021import org .apache .http .impl .client .HttpClients ;
2122
22- import me .chanjar .weixin .enterprise .bean .WxCpDepartment ;
23+ import me .chanjar .weixin .enterprise .bean .WxCpDepart ;
2324import me .chanjar .weixin .enterprise .bean .result .WxError ;
2425import me .chanjar .weixin .enterprise .bean .result .WxMediaUploadResult ;
2526import me .chanjar .weixin .enterprise .bean .result .WxUser ;
2627import me .chanjar .weixin .enterprise .exception .WxErrorException ;
27- import me .chanjar .weixin .enterprise . util . fs .FileUtils ;
28+ import me .chanjar .weixin .common .FileUtils ;
2829import me .chanjar .weixin .enterprise .util .http .MediaDownloadRequestExecutor ;
2930import me .chanjar .weixin .enterprise .util .http .MediaUploadRequestExecutor ;
3031import me .chanjar .weixin .enterprise .util .http .RequestExecutor ;
3132import me .chanjar .weixin .enterprise .util .http .SimplePostRequestExecutor ;
32- import me .chanjar .weixin .enterprise .util .json .WxGsonBuilder ;
3333
3434import com .google .gson .JsonElement ;
3535import com .google .gson .JsonObject ;
@@ -142,7 +142,7 @@ public File mediaDownload(String media_id) throws WxErrorException {
142142 }
143143
144144
145- public WxCpDepartment departmentCreate (String name ) throws WxErrorException {
145+ public WxCpDepart departmentCreate (String name ) throws WxErrorException {
146146 // TODO
147147 String url = "https://api.weixin.qq.com/cgi-bin/groups/create" ;
148148 JsonObject json = new JsonObject ();
@@ -154,16 +154,16 @@ public WxCpDepartment departmentCreate(String name) throws WxErrorException {
154154 new SimplePostRequestExecutor (),
155155 url ,
156156 json .toString ());
157- return WxCpDepartment .fromJson (responseContent );
157+ return WxCpDepart .fromJson (responseContent );
158158 }
159159
160- public void departmentUpdate (WxCpDepartment group ) throws WxErrorException {
160+ public void departmentUpdate (WxCpDepart group ) throws WxErrorException {
161161 // TODO
162162 String url = "https://api.weixin.qq.com/cgi-bin/groups/update" ;
163163 execute (new SimplePostRequestExecutor (), url , group .toJson ());
164164 }
165165
166- public List <WxCpDepartment > departmentGet () throws WxErrorException {
166+ public List <WxCpDepart > departmentGet () throws WxErrorException {
167167 // TODO
168168 String url = "https://api.weixin.qq.com/cgi-bin/groups/get" ;
169169 String responseContent = execute (new SimpleGetRequestExecutor (), url , null );
@@ -172,12 +172,12 @@ public List<WxCpDepartment> departmentGet() throws WxErrorException {
172172 * 查询时返回的是 { groups : [ { id : ..., name : ..., count : ... }, ... ] }
173173 */
174174 JsonElement tmpJsonElement = Streams .parse (new JsonReader (new StringReader (responseContent )));
175- return WxGsonBuilder .INSTANCE .create ()
176- .fromJson (tmpJsonElement .getAsJsonObject ().get ("groups" ), new TypeToken <List <WxCpDepartment >>() {
175+ return WxCpGsonBuilder .INSTANCE .create ()
176+ .fromJson (tmpJsonElement .getAsJsonObject ().get ("groups" ), new TypeToken <List <WxCpDepart >>() {
177177 }.getType ());
178178 }
179179
180- public void departmentDelete (WxCpDepartment department ) throws WxErrorException {
180+ public void departmentDelete (WxCpDepart department ) throws WxErrorException {
181181 // TODO
182182
183183 }
0 commit comments