33import cn .binarywang .wx .miniapp .api .WxMaQrcodeService ;
44import cn .binarywang .wx .miniapp .api .WxMaService ;
55import cn .binarywang .wx .miniapp .bean .WxMaQrcode ;
6+ import cn .binarywang .wx .miniapp .bean .WxMaWxcode ;
7+ import cn .binarywang .wx .miniapp .bean .WxMaWxcodeLimit ;
68import cn .binarywang .wx .miniapp .util .http .QrCodeRequestExecutor ;
79import me .chanjar .weixin .common .exception .WxErrorException ;
810
@@ -25,4 +27,49 @@ public File createQrcode(String path, int width) throws WxErrorException {
2527 url , new WxMaQrcode (path , width ));
2628 }
2729
30+ @ Override
31+ public File createQrcode (String path ) throws WxErrorException {
32+ return this .createQrcode (path , 430 );
33+ }
34+
35+ @ 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" ;
38+ WxMaWxcode wxMaWxcode = new WxMaWxcode ();
39+ wxMaWxcode .setPath (path );
40+ wxMaWxcode .setWidth (width );
41+ wxMaWxcode .setAutoColor (autoColor );
42+ wxMaWxcode .setLineColor (lineColor );
43+ return this .wxMaService .execute (new QrCodeRequestExecutor (this .wxMaService .getRequestHttp ()),
44+ url , wxMaWxcode );
45+ }
46+
47+ @ Override
48+ public File createWxCode (String path , int width ) throws WxErrorException {
49+ return this .createWxCode (path , width , true , null );
50+ }
51+
52+ @ Override
53+ public File createWxCode (String path ) throws WxErrorException {
54+ return this .createWxCode (path , 430 , true , null );
55+ }
56+
57+ @ 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" ;
60+ WxMaWxcodeLimit wxMaWxcodeLimit = new WxMaWxcodeLimit ();
61+ wxMaWxcodeLimit .setScene (scene );
62+ wxMaWxcodeLimit .setPage (page );
63+ wxMaWxcodeLimit .setWidth (width );
64+ wxMaWxcodeLimit .setAutoColor (autoColor );
65+ wxMaWxcodeLimit .setLineColor (lineColor );
66+ return this .wxMaService .execute (new QrCodeRequestExecutor (this .wxMaService .getRequestHttp ()),
67+ url , wxMaWxcodeLimit );
68+ }
69+
70+ @ Override
71+ public File createWxCodeLimit (String scene , String page ) throws WxErrorException {
72+ return this .createWxCodeLimit (scene , page , 430 , true , null );
73+ }
74+
2875}
0 commit comments