@@ -71,7 +71,7 @@ public String getJsapiTicket(boolean forceRefresh) throws WxErrorException {
7171 }
7272
7373 if (this .getWxMpConfigStorage ().isJsapiTicketExpired ()) {
74- String responseContent = execute (new SimpleGetRequestExecutor (), WxMpApiUrls .GET_JSAPI_TICKET_URL , null );
74+ String responseContent = execute (new SimpleGetRequestExecutor (), WxMpService .GET_JSAPI_TICKET_URL , null );
7575 JsonElement tmpJsonElement = JSON_PARSER .parse (responseContent );
7676 JsonObject tmpJsonObject = tmpJsonElement .getAsJsonObject ();
7777 String jsapiTicket = tmpJsonObject .get ("ticket" ).getAsString ();
@@ -107,31 +107,31 @@ public String getAccessToken() throws WxErrorException {
107107
108108 @ Override
109109 public WxMpMassUploadResult massNewsUpload (WxMpMassNews news ) throws WxErrorException {
110- String responseContent = this .post (WxMpApiUrls .MEDIA_UPLOAD_NEWS_URL , news .toJson ());
110+ String responseContent = this .post (WxMpService .MEDIA_UPLOAD_NEWS_URL , news .toJson ());
111111 return WxMpMassUploadResult .fromJson (responseContent );
112112 }
113113
114114 @ Override
115115 public WxMpMassUploadResult massVideoUpload (WxMpMassVideo video ) throws WxErrorException {
116- String responseContent = this .post (WxMpApiUrls .MEDIA_UPLOAD_VIDEO_URL , video .toJson ());
116+ String responseContent = this .post (WxMpService .MEDIA_UPLOAD_VIDEO_URL , video .toJson ());
117117 return WxMpMassUploadResult .fromJson (responseContent );
118118 }
119119
120120 @ Override
121121 public WxMpMassSendResult massGroupMessageSend (WxMpMassTagMessage message ) throws WxErrorException {
122- String responseContent = this .post (WxMpApiUrls .MESSAGE_MASS_SENDALL_URL , message .toJson ());
122+ String responseContent = this .post (WxMpService .MESSAGE_MASS_SENDALL_URL , message .toJson ());
123123 return WxMpMassSendResult .fromJson (responseContent );
124124 }
125125
126126 @ Override
127127 public WxMpMassSendResult massOpenIdsMessageSend (WxMpMassOpenIdsMessage message ) throws WxErrorException {
128- String responseContent = this .post (WxMpApiUrls .MESSAGE_MASS_SEND_URL , message .toJson ());
128+ String responseContent = this .post (WxMpService .MESSAGE_MASS_SEND_URL , message .toJson ());
129129 return WxMpMassSendResult .fromJson (responseContent );
130130 }
131131
132132 @ Override
133133 public WxMpMassSendResult massMessagePreview (WxMpMassPreviewMessage wxMpMassPreviewMessage ) throws Exception {
134- String responseContent = this .post (WxMpApiUrls .MESSAGE_MASS_PREVIEW_URL , wxMpMassPreviewMessage .toJson ());
134+ String responseContent = this .post (WxMpService .MESSAGE_MASS_PREVIEW_URL , wxMpMassPreviewMessage .toJson ());
135135 return WxMpMassSendResult .fromJson (responseContent );
136136 }
137137
@@ -140,26 +140,26 @@ public String shortUrl(String long_url) throws WxErrorException {
140140 JsonObject o = new JsonObject ();
141141 o .addProperty ("action" , "long2short" );
142142 o .addProperty ("long_url" , long_url );
143- String responseContent = this .post (WxMpApiUrls .SHORTURL_API_URL , o .toString ());
143+ String responseContent = this .post (WxMpService .SHORTURL_API_URL , o .toString ());
144144 JsonElement tmpJsonElement = JSON_PARSER .parse (responseContent );
145145 return tmpJsonElement .getAsJsonObject ().get ("short_url" ).getAsString ();
146146 }
147147
148148 @ Override
149149 public WxMpSemanticQueryResult semanticQuery (WxMpSemanticQuery semanticQuery ) throws WxErrorException {
150- String responseContent = this .post (WxMpApiUrls .SEMANTIC_SEMPROXY_SEARCH_URL , semanticQuery .toJson ());
150+ String responseContent = this .post (WxMpService .SEMANTIC_SEMPROXY_SEARCH_URL , semanticQuery .toJson ());
151151 return WxMpSemanticQueryResult .fromJson (responseContent );
152152 }
153153
154154 @ Override
155155 public String oauth2buildAuthorizationUrl (String redirectURI , String scope , String state ) {
156- return String .format (WxMpApiUrls .CONNECT_OAUTH2_AUTHORIZE_URL ,
156+ return String .format (WxMpService .CONNECT_OAUTH2_AUTHORIZE_URL ,
157157 this .getWxMpConfigStorage ().getAppId (), URIUtil .encodeURIComponent (redirectURI ), scope , StringUtils .trimToEmpty (state ));
158158 }
159159
160160 @ Override
161161 public String buildQrConnectUrl (String redirectURI , String scope , String state ) {
162- return String .format (WxMpApiUrls .QRCONNECT_URL ,
162+ return String .format (WxMpService .QRCONNECT_URL ,
163163 this .getWxMpConfigStorage ().getAppId (), URIUtil .encodeURIComponent (redirectURI ), scope , StringUtils .trimToEmpty (state ));
164164 }
165165
@@ -175,13 +175,13 @@ private WxMpOAuth2AccessToken getOAuth2AccessToken(String url) throws WxErrorExc
175175
176176 @ Override
177177 public WxMpOAuth2AccessToken oauth2getAccessToken (String code ) throws WxErrorException {
178- String url = String .format (WxMpApiUrls .OAUTH2_ACCESS_TOKEN_URL , this .getWxMpConfigStorage ().getAppId (), this .getWxMpConfigStorage ().getSecret (), code );
178+ String url = String .format (WxMpService .OAUTH2_ACCESS_TOKEN_URL , this .getWxMpConfigStorage ().getAppId (), this .getWxMpConfigStorage ().getSecret (), code );
179179 return this .getOAuth2AccessToken (url );
180180 }
181181
182182 @ Override
183183 public WxMpOAuth2AccessToken oauth2refreshAccessToken (String refreshToken ) throws WxErrorException {
184- String url = String .format (WxMpApiUrls .OAUTH2_REFRESH_TOKEN_URL , this .getWxMpConfigStorage ().getAppId (), refreshToken );
184+ String url = String .format (WxMpService .OAUTH2_REFRESH_TOKEN_URL , this .getWxMpConfigStorage ().getAppId (), refreshToken );
185185 return this .getOAuth2AccessToken (url );
186186 }
187187
@@ -191,7 +191,7 @@ public WxMpUser oauth2getUserInfo(WxMpOAuth2AccessToken oAuth2AccessToken, Strin
191191 lang = "zh_CN" ;
192192 }
193193
194- String url = String .format (WxMpApiUrls .OAUTH2_USERINFO_URL , oAuth2AccessToken .getAccessToken (), oAuth2AccessToken .getOpenId (), lang );
194+ String url = String .format (WxMpService .OAUTH2_USERINFO_URL , oAuth2AccessToken .getAccessToken (), oAuth2AccessToken .getOpenId (), lang );
195195
196196 try {
197197 RequestExecutor <String , String > executor = new SimpleGetRequestExecutor ();
@@ -204,7 +204,7 @@ public WxMpUser oauth2getUserInfo(WxMpOAuth2AccessToken oAuth2AccessToken, Strin
204204
205205 @ Override
206206 public boolean oauth2validateAccessToken (WxMpOAuth2AccessToken oAuth2AccessToken ) {
207- String url = String .format (WxMpApiUrls .OAUTH2_VALIDATE_TOKEN_URL , oAuth2AccessToken .getAccessToken (), oAuth2AccessToken .getOpenId ());
207+ String url = String .format (WxMpService .OAUTH2_VALIDATE_TOKEN_URL , oAuth2AccessToken .getAccessToken (), oAuth2AccessToken .getOpenId ());
208208
209209 try {
210210 RequestExecutor <String , String > executor = new SimpleGetRequestExecutor ();
@@ -219,7 +219,7 @@ public boolean oauth2validateAccessToken(WxMpOAuth2AccessToken oAuth2AccessToken
219219
220220 @ Override
221221 public String [] getCallbackIP () throws WxErrorException {
222- String responseContent = this .get (WxMpApiUrls .GET_CALLBACK_IP_URL , null );
222+ String responseContent = this .get (WxMpService .GET_CALLBACK_IP_URL , null );
223223 JsonElement tmpJsonElement = JSON_PARSER .parse (responseContent );
224224 JsonArray ipList = tmpJsonElement .getAsJsonObject ().get ("ip_list" ).getAsJsonArray ();
225225 String [] ipArray = new String [ipList .size ()];
0 commit comments