22
33import cn .binarywang .wx .miniapp .api .WxMaQrcodeService ;
44import cn .binarywang .wx .miniapp .api .WxMaService ;
5+ import cn .binarywang .wx .miniapp .bean .WxMaCodeLineColor ;
56import cn .binarywang .wx .miniapp .bean .WxMaQrcode ;
67import cn .binarywang .wx .miniapp .bean .WxMaWxcode ;
78import cn .binarywang .wx .miniapp .bean .WxMaWxcodeLimit ;
@@ -22,9 +23,8 @@ public WxMaQrcodeServiceImpl(WxMaService wxMaService) {
2223
2324 @ Override
2425 public File createQrcode (String path , int width ) throws WxErrorException {
25- String url = "https://api.weixin.qq.com/cgi-bin/wxaapp/createwxaqrcode" ;
2626 return this .wxMaService .execute (new QrCodeRequestExecutor (this .wxMaService .getRequestHttp ()),
27- url , new WxMaQrcode (path , width ));
27+ CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
2828 }
2929
3030 @ Override
@@ -33,15 +33,14 @@ public File createQrcode(String path) throws WxErrorException {
3333 }
3434
3535 @ Override
36- public File createWxCode (String path , int width , boolean autoColor , LineColor lineColor ) throws WxErrorException {
37- String url = "https://api.weixin.qq.com/wxa/getwxacode" ;
36+ public File createWxCode (String path , int width , boolean autoColor , WxMaCodeLineColor lineColor ) throws WxErrorException {
3837 WxMaWxcode wxMaWxcode = new WxMaWxcode ();
3938 wxMaWxcode .setPath (path );
4039 wxMaWxcode .setWidth (width );
4140 wxMaWxcode .setAutoColor (autoColor );
4241 wxMaWxcode .setLineColor (lineColor );
4342 return this .wxMaService .execute (new QrCodeRequestExecutor (this .wxMaService .getRequestHttp ()),
44- url , wxMaWxcode );
43+ GET_WXACODE_URL , wxMaWxcode );
4544 }
4645
4746 @ Override
@@ -55,16 +54,15 @@ public File createWxCode(String path) throws WxErrorException {
5554 }
5655
5756 @ Override
58- public File createWxCodeLimit (String scene , String page , int width , boolean autoColor , LineColor lineColor ) throws WxErrorException {
59- String url = "http://api.weixin.qq.com/wxa/getwxacodeunlimit" ;
57+ public File createWxCodeLimit (String scene , String page , int width , boolean autoColor , WxMaCodeLineColor lineColor ) throws WxErrorException {
6058 WxMaWxcodeLimit wxMaWxcodeLimit = new WxMaWxcodeLimit ();
6159 wxMaWxcodeLimit .setScene (scene );
6260 wxMaWxcodeLimit .setPage (page );
6361 wxMaWxcodeLimit .setWidth (width );
6462 wxMaWxcodeLimit .setAutoColor (autoColor );
6563 wxMaWxcodeLimit .setLineColor (lineColor );
6664 return this .wxMaService .execute (new QrCodeRequestExecutor (this .wxMaService .getRequestHttp ()),
67- url , wxMaWxcodeLimit );
65+ GET_WXACODE_UNLIMIT_URL , wxMaWxcodeLimit );
6866 }
6967
7068 @ Override
0 commit comments