7
7
import cn .binarywang .wx .miniapp .bean .WxaCode ;
8
8
import cn .binarywang .wx .miniapp .bean .WxaCodeUnlimit ;
9
9
import cn .binarywang .wx .miniapp .executor .QrcodeBytesRequestExecutor ;
10
- import cn .binarywang .wx .miniapp .executor .QrcodeFileRequestExecutor ;
11
10
import cn .binarywang .wx .miniapp .executor .QrcodeRequestExecutor ;
12
11
import lombok .AllArgsConstructor ;
13
12
import me .chanjar .weixin .common .error .WxErrorException ;
@@ -23,14 +22,12 @@ public class WxMaQrcodeServiceImpl implements WxMaQrcodeService {
23
22
24
23
@ Override
25
24
public byte [] createQrcodeBytes (String path , int width ) throws WxErrorException {
26
- final QrcodeBytesRequestExecutor executor = new QrcodeBytesRequestExecutor (this .wxMaService .getRequestHttp ());
27
- return this .wxMaService .execute (executor , CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
25
+ return this .wxMaService .execute (QrcodeBytesRequestExecutor .create (this .wxMaService .getRequestHttp ()), CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
28
26
}
29
27
30
28
@ Override
31
29
public File createQrcode (String path , int width ) throws WxErrorException {
32
- final QrcodeRequestExecutor executor = new QrcodeRequestExecutor (this .wxMaService .getRequestHttp ());
33
- return this .wxMaService .execute (executor , CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
30
+ return this .wxMaService .execute (QrcodeRequestExecutor .create (this .wxMaService .getRequestHttp ()), CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
34
31
}
35
32
36
33
@ Override
@@ -41,8 +38,7 @@ public File createQrcode(String path) throws WxErrorException {
41
38
@ Override
42
39
public byte [] createWxaCodeBytes (String path , int width , boolean autoColor , WxMaCodeLineColor lineColor , boolean isHyaline )
43
40
throws WxErrorException {
44
- final QrcodeBytesRequestExecutor executor = new QrcodeBytesRequestExecutor (this .wxMaService .getRequestHttp ());
45
- return this .wxMaService .execute (executor , GET_WXACODE_URL , WxaCode .builder ()
41
+ return this .wxMaService .execute (QrcodeBytesRequestExecutor .create (this .wxMaService .getRequestHttp ()), GET_WXACODE_URL , WxaCode .builder ()
46
42
.path (path )
47
43
.width (width )
48
44
.autoColor (autoColor )
@@ -54,8 +50,7 @@ public byte[] createWxaCodeBytes(String path, int width, boolean autoColor, WxMa
54
50
@ Override
55
51
public File createWxaCode (String path , int width , boolean autoColor , WxMaCodeLineColor lineColor , boolean isHyaline )
56
52
throws WxErrorException {
57
- final QrcodeRequestExecutor executor = new QrcodeRequestExecutor (this .wxMaService .getRequestHttp ());
58
- return this .wxMaService .execute (executor , GET_WXACODE_URL , WxaCode .builder ()
53
+ return this .wxMaService .execute (QrcodeRequestExecutor .create (this .wxMaService .getRequestHttp ()), GET_WXACODE_URL , WxaCode .builder ()
59
54
.path (path )
60
55
.width (width )
61
56
.autoColor (autoColor )
@@ -77,15 +72,15 @@ public File createWxaCode(String path) throws WxErrorException {
77
72
@ Override
78
73
public byte [] createWxaCodeUnlimitBytes (String scene , String page , int width , boolean autoColor ,
79
74
WxMaCodeLineColor lineColor , boolean isHyaline ) throws WxErrorException {
80
- return this .wxMaService .execute (new QrcodeBytesRequestExecutor (this .wxMaService .getRequestHttp ()),
75
+ return this .wxMaService .execute (QrcodeBytesRequestExecutor . create (this .wxMaService .getRequestHttp ()),
81
76
GET_WXACODE_UNLIMIT_URL ,
82
77
this .buildWxaCodeUnlimit (scene , page , width , autoColor , lineColor , isHyaline ));
83
78
}
84
79
85
80
@ Override
86
81
public File createWxaCodeUnlimit (String scene , String page , int width , boolean autoColor ,
87
82
WxMaCodeLineColor lineColor , boolean isHyaline ) throws WxErrorException {
88
- return this .wxMaService .execute (new QrcodeRequestExecutor (this .wxMaService .getRequestHttp ()),
83
+ return this .wxMaService .execute (QrcodeRequestExecutor . create (this .wxMaService .getRequestHttp ()),
89
84
GET_WXACODE_UNLIMIT_URL ,
90
85
this .buildWxaCodeUnlimit (scene , page , width , autoColor , lineColor , isHyaline ));
91
86
}
@@ -110,8 +105,7 @@ public File createWxaCodeUnlimit(String scene, String page) throws WxErrorExcept
110
105
111
106
@ Override
112
107
public File createQrcode (String path , int width , String filePath ) throws WxErrorException {
113
- final QrcodeFileRequestExecutor executor = new QrcodeFileRequestExecutor (this .wxMaService .getRequestHttp (), filePath );
114
- return this .wxMaService .execute (executor , CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
108
+ return this .wxMaService .execute (QrcodeRequestExecutor .create (this .wxMaService .getRequestHttp (), filePath ), CREATE_QRCODE_URL , new WxMaQrcode (path , width ));
115
109
}
116
110
117
111
@ Override
@@ -122,8 +116,7 @@ public File createQrcode(String path, String filePath) throws WxErrorException {
122
116
@ Override
123
117
public File createWxaCode (String path , int width , String filePath , boolean autoColor , WxMaCodeLineColor lineColor , boolean isHyaline )
124
118
throws WxErrorException {
125
- final QrcodeFileRequestExecutor executor = new QrcodeFileRequestExecutor (this .wxMaService .getRequestHttp (), filePath );
126
- return this .wxMaService .execute (executor , GET_WXACODE_URL , WxaCode .builder ()
119
+ return this .wxMaService .execute (QrcodeRequestExecutor .create (this .wxMaService .getRequestHttp (), filePath ), GET_WXACODE_URL , WxaCode .builder ()
127
120
.path (path )
128
121
.width (width )
129
122
.autoColor (autoColor )
@@ -145,7 +138,7 @@ public File createWxaCode(String path, String filePath) throws WxErrorException
145
138
@ Override
146
139
public File createWxaCodeUnlimit (String scene , String page , String filePath , int width , boolean autoColor ,
147
140
WxMaCodeLineColor lineColor , boolean isHyaline ) throws WxErrorException {
148
- return this .wxMaService .execute (new QrcodeFileRequestExecutor (this .wxMaService .getRequestHttp (), filePath ),
141
+ return this .wxMaService .execute (QrcodeRequestExecutor . create (this .wxMaService .getRequestHttp (), filePath ),
149
142
GET_WXACODE_UNLIMIT_URL ,
150
143
this .buildWxaCodeUnlimit (scene , page , width , autoColor , lineColor , isHyaline ));
151
144
}
0 commit comments