1
1
package me .chanjar .weixin .mp .config ;
2
2
3
3
import me .chanjar .weixin .common .bean .WxAccessToken ;
4
+ import me .chanjar .weixin .common .enums .TicketType ;
4
5
import me .chanjar .weixin .common .util .http .apache .ApacheHttpClientBuilder ;
5
6
import me .chanjar .weixin .mp .bean .WxMpHostConfig ;
6
- import me .chanjar .weixin .common .enums .TicketType ;
7
7
8
8
import java .io .File ;
9
9
import java .util .concurrent .locks .Lock ;
14
14
* @author chanjarster
15
15
*/
16
16
public interface WxMpConfigStorage {
17
+ /**
18
+ * Gets access token.
19
+ *
20
+ * @return the access token
21
+ */
17
22
String getAccessToken ();
18
23
24
+ /**
25
+ * Gets access token lock.
26
+ *
27
+ * @return the access token lock
28
+ */
19
29
Lock getAccessTokenLock ();
20
30
31
+ /**
32
+ * Is access token expired boolean.
33
+ *
34
+ * @return the boolean
35
+ */
21
36
boolean isAccessTokenExpired ();
22
37
23
38
/**
@@ -40,14 +55,34 @@ public interface WxMpConfigStorage {
40
55
*/
41
56
void updateAccessToken (String accessToken , int expiresInSeconds );
42
57
58
+ /**
59
+ * Gets ticket.
60
+ *
61
+ * @param type the type
62
+ * @return the ticket
63
+ */
43
64
String getTicket (TicketType type );
44
65
66
+ /**
67
+ * Gets ticket lock.
68
+ *
69
+ * @param type the type
70
+ * @return the ticket lock
71
+ */
45
72
Lock getTicketLock (TicketType type );
46
73
74
+ /**
75
+ * Is ticket expired boolean.
76
+ *
77
+ * @param type the type
78
+ * @return the boolean
79
+ */
47
80
boolean isTicketExpired (TicketType type );
48
81
49
82
/**
50
83
* 强制将ticket过期掉.
84
+ *
85
+ * @param type the type
51
86
*/
52
87
void expireTicket (TicketType type );
53
88
@@ -61,44 +96,115 @@ public interface WxMpConfigStorage {
61
96
*/
62
97
void updateTicket (TicketType type , String ticket , int expiresInSeconds );
63
98
99
+ /**
100
+ * Gets app id.
101
+ *
102
+ * @return the app id
103
+ */
64
104
String getAppId ();
65
105
106
+ /**
107
+ * Gets secret.
108
+ *
109
+ * @return the secret
110
+ */
66
111
String getSecret ();
67
112
113
+ /**
114
+ * Gets token.
115
+ *
116
+ * @return the token
117
+ */
68
118
String getToken ();
69
119
120
+ /**
121
+ * Gets aes key.
122
+ *
123
+ * @return the aes key
124
+ */
70
125
String getAesKey ();
71
126
127
+ /**
128
+ * Gets template id.
129
+ *
130
+ * @return the template id
131
+ */
72
132
String getTemplateId ();
73
133
134
+ /**
135
+ * Gets expires time.
136
+ *
137
+ * @return the expires time
138
+ */
74
139
long getExpiresTime ();
75
140
141
+ /**
142
+ * Gets oauth 2 redirect uri.
143
+ *
144
+ * @return the oauth 2 redirect uri
145
+ */
76
146
String getOauth2redirectUri ();
77
147
148
+ /**
149
+ * Gets http proxy host.
150
+ *
151
+ * @return the http proxy host
152
+ */
78
153
String getHttpProxyHost ();
79
154
155
+ /**
156
+ * Gets http proxy port.
157
+ *
158
+ * @return the http proxy port
159
+ */
80
160
int getHttpProxyPort ();
81
161
162
+ /**
163
+ * Gets http proxy username.
164
+ *
165
+ * @return the http proxy username
166
+ */
82
167
String getHttpProxyUsername ();
83
168
169
+ /**
170
+ * Gets http proxy password.
171
+ *
172
+ * @return the http proxy password
173
+ */
84
174
String getHttpProxyPassword ();
85
175
176
+ /**
177
+ * Gets tmp dir file.
178
+ *
179
+ * @return the tmp dir file
180
+ */
86
181
File getTmpDirFile ();
87
182
88
183
/**
89
184
* http client builder.
90
185
*
91
- * @return ApacheHttpClientBuilder
186
+ * @return ApacheHttpClientBuilder apache http client builder
92
187
*/
93
188
ApacheHttpClientBuilder getApacheHttpClientBuilder ();
94
189
95
190
/**
96
191
* 是否自动刷新token.
192
+ *
193
+ * @return the boolean
97
194
*/
98
195
boolean autoRefreshToken ();
99
196
100
197
/**
101
198
* 得到微信接口地址域名部分的自定义设置信息.
199
+ *
200
+ * @return the host config
102
201
*/
103
202
WxMpHostConfig getHostConfig ();
203
+
204
+ /**
205
+ * 设置微信接口地址域名部分的自定义设置信息.
206
+ *
207
+ * @param hostConfig host config
208
+ */
209
+ void setHostConfig (WxMpHostConfig hostConfig );
104
210
}
0 commit comments