Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in / Register
Toggle navigation
Y
yzg-util
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
YZG
yzg-util
Commits
fdfdbcb5
Commit
fdfdbcb5
authored
Jul 05, 2022
by
xianjun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
创建微信小程序接口实体
parent
fdb9020f
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
489 additions
and
2 deletions
+489
-2
WxXcxConfig.java
...src/main/java/com/yanzuoguang/wxxcx/base/WxXcxConfig.java
+52
-2
WxXcxOpenApiManageClearQuotaReq.java
.../wxxcx/openapimanage/WxXcxOpenApiManageClearQuotaReq.java
+33
-0
WxXcxOpenApiManageClearQuotaRequest.java
...cx/openapimanage/WxXcxOpenApiManageClearQuotaRequest.java
+54
-0
WxXcxOpenApiManageClearQuotaRes.java
.../wxxcx/openapimanage/WxXcxOpenApiManageClearQuotaRes.java
+11
-0
WxXcxOpenApiManageGetApiQuotaQuotaRes.java
.../openapimanage/WxXcxOpenApiManageGetApiQuotaQuotaRes.java
+45
-0
WxXcxOpenApiManageGetApiQuotaReq.java
...wxxcx/openapimanage/WxXcxOpenApiManageGetApiQuotaReq.java
+33
-0
WxXcxOpenApiManageGetApiQuotaRequest.java
...x/openapimanage/WxXcxOpenApiManageGetApiQuotaRequest.java
+53
-0
WxXcxOpenApiManageGetApiQuotaRes.java
...wxxcx/openapimanage/WxXcxOpenApiManageGetApiQuotaRes.java
+20
-0
WxXcxOpenApiManageGetRidInfoReq.java
.../wxxcx/openapimanage/WxXcxOpenApiManageGetRidInfoReq.java
+33
-0
WxXcxOpenApiManageGetRidInfoRequest.java
...cx/openapimanage/WxXcxOpenApiManageGetRidInfoRequest.java
+52
-0
WxXcxOpenApiManageGetRidInfoRequestRes.java
...openapimanage/WxXcxOpenApiManageGetRidInfoRequestRes.java
+79
-0
WxXcxOpenApiManageGetRidInfoRes.java
.../wxxcx/openapimanage/WxXcxOpenApiManageGetRidInfoRes.java
+23
-0
WxXcxAuthLoginImpl.java
.../com/yanzuoguang/wxxcx/start/impl/WxXcxAuthLoginImpl.java
+1
-0
No files found.
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/base/WxXcxConfig.java
View file @
fdfdbcb5
...
...
@@ -17,6 +17,18 @@ public class WxXcxConfig {
@Value
(
"${yzg.wx.xcx.url:https://api.weixin.qq.com}"
)
private
String
baseUrl
;
/**
* 公共URI
*/
@Value
(
"${yzg.wx.xcx.appid:wxd70bc341df16d0b8}"
)
private
String
appid
;
/**
* 公共URI
*/
@Value
(
"${yzg.wx.xcx.secret:a8a4bc5f1dc5cde3c9abddf107c5598e}"
)
private
String
secret
;
/**
* 登录凭证校验
*/
...
...
@@ -123,13 +135,13 @@ public class WxXcxConfig {
/**
* 发送客服消息给用户
*/
@Value
(
"${yzg.wx.xcx.customerServiceMessageSend:/cgi-bin/message/custom/send}"
)
@Value
(
"${yzg.wx.xcx.customerServiceMessageSend:/cgi-bin/message/custom/
business/
send}"
)
private
String
customerServiceMessageSend
;
/**
* 下发客服当前输入状态给用户
*/
@Value
(
"${yzg.wx.xcx.customerServiceMessageSetTyping:/cgi-bin/message/custom/typing}"
)
@Value
(
"${yzg.wx.xcx.customerServiceMessageSetTyping:/cgi-bin/message/custom/
business/
typing}"
)
private
String
customerServiceMessageSetTyping
;
/**
...
...
@@ -276,10 +288,48 @@ public class WxXcxConfig {
@Value
(
"${yzg.wx.xcx.redPacketCoverGetAuthenticationUrl:/redpacketcover/wxapp/cover_url/get_by_token}"
)
private
String
redPacketCoverGetAuthenticationUrl
;
/**
* 重置 API 调用次数
*/
@Value
(
"${yzg.wx.xcx.clearQuota:/cgi-bin/clear_quota}"
)
private
String
clearQuota
;
/**
* 查询API调用额度
*/
@Value
(
"${yzg.wx.xcx.clearQuota:/cgi-bin/openapi/quota/get}"
)
private
String
getApiQuota
;
/**
* 查询RID信息
*/
@Value
(
"${yzg.wx.xcx.clearQuota:/cgi-bin/openapi/rid/get}"
)
private
String
getRidInfo
;
public
String
getGetApiQuota
()
{
return
getApiQuota
;
}
public
String
getGetRidInfo
()
{
return
getRidInfo
;
}
public
String
getClearQuota
()
{
return
clearQuota
;
}
public
String
getBaseUrl
()
{
return
baseUrl
;
}
public
String
getAppid
()
{
return
appid
;
}
public
String
getSecret
()
{
return
secret
;
}
public
String
getAuthCode2SessionUrl
()
{
return
authCode2SessionUrl
;
}
...
...
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageClearQuotaReq.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
/**
* 重置 API 调用次数 请求
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageClearQuotaReq
{
/**
* 第三方平台接口调用凭证authorizer_access_token,该参数为 URL 参数,非 Body 参数。
*/
private
String
access_token
;
/**
* 要被清空的账号的appid
*/
private
String
appid
;
public
String
getAccess_token
()
{
return
access_token
;
}
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
public
String
getAppid
()
{
return
appid
;
}
public
void
setAppid
(
String
appid
)
{
this
.
appid
=
appid
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageClearQuotaRequest.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
import
com.alibaba.fastjson.TypeReference
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.wxxcx.base.*
;
import
com.yanzuoguang.wxxcx.nearbypoi.WxXcxNearbyPoiAddReq
;
import
com.yanzuoguang.wxxcx.nearbypoi.WxXcxNearbyPoiAddRes
;
/**
* 重置 API 调用次数 转换
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageClearQuotaRequest
implements
WxXcxRequestUrl
,
WxXcxRequestUrlPara
,
WxXcxRequestPostFormData
{
private
final
WxXcxConfig
wxXcxConfig
;
private
final
WxXcxRequest
wxXcxRequest
;
private
final
WxXcxAccessToken
accessToken
;
private
final
WxXcxOpenApiManageClearQuotaReq
req
;
public
WxXcxOpenApiManageClearQuotaRequest
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
,
WxXcxAccessToken
accessToken
,
WxXcxOpenApiManageClearQuotaReq
req
)
{
this
.
wxXcxConfig
=
wxXcxConfig
;
this
.
wxXcxRequest
=
wxXcxRequest
;
this
.
accessToken
=
accessToken
;
this
.
req
=
req
;
}
@Override
public
String
getUrl
()
{
return
wxXcxConfig
.
getBaseUrl
()
+
wxXcxConfig
.
getClearQuota
()
+
"?"
+
this
.
getUrlPara
();
}
@Override
public
String
getUrlPara
()
{
return
HttpHelper
.
getUrlParameter
(
accessToken
);
}
@Override
public
String
getPost
()
{
return
HttpHelper
.
getUrlParameter
(
req
);
}
public
WxXcxOpenApiManageClearQuotaRes
getResponse
()
{
// todo: 检测参数是否合法
// Assert.assertEquals();
return
this
.
wxXcxRequest
.
request
(
this
,
response
->
{
WxXcxOpenApiManageClearQuotaRes
ret
=
JsonHelper
.
deserialize
(
response
,
new
TypeReference
<
WxXcxOpenApiManageClearQuotaRes
>()
{
});
WxXcxAssert
.
assertBaseError
(
ret
);
return
ret
;
});
}
}
\ No newline at end of file
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageClearQuotaRes.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
import
com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError
;
/**
* 重置 API 调用次数 响应
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageClearQuotaRes
extends
WxXcxResponseBaseError
{
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetApiQuotaQuotaRes.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
/**
* 查询 API 调用额度 响应详情
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetApiQuotaQuotaRes
{
/**
* 当天该账号可调用该接口的次数
*/
private
int
daily_limit
;
/**
* 当天已经调用的次数
*/
private
int
used
;
/**
* 当天剩余调用次数
*/
private
int
remain
;
public
int
getDaily_limit
()
{
return
daily_limit
;
}
public
void
setDaily_limit
(
int
daily_limit
)
{
this
.
daily_limit
=
daily_limit
;
}
public
int
getUsed
()
{
return
used
;
}
public
void
setUsed
(
int
used
)
{
this
.
used
=
used
;
}
public
int
getRemain
()
{
return
remain
;
}
public
void
setRemain
(
int
remain
)
{
this
.
remain
=
remain
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetApiQuotaReq.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
/**
* 查询 API 调用额度 请求
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetApiQuotaReq
{
/**
* 第三方平台接口调用凭证authorizer_access_token,该参数为 URL 参数,非 Body 参数
*/
private
String
access_token
;
/**
* api的请求地址,例如"/cgi-bin/message/custom/send";不要前缀“https://api.weixin.qq.com” ,也不要漏了"/",否则都会76003的报错
*/
private
String
cgi_path
;
public
String
getAccess_token
()
{
return
access_token
;
}
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
public
String
getCgi_path
()
{
return
cgi_path
;
}
public
void
setCgi_path
(
String
cgi_path
)
{
this
.
cgi_path
=
cgi_path
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetApiQuotaRequest.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
import
com.alibaba.fastjson.TypeReference
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.wxxcx.base.*
;
/**
* 查询 API 调用额度 转换
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetApiQuotaRequest
implements
WxXcxRequestUrl
,
WxXcxRequestUrlPara
,
WxXcxRequestPostFormData
{
private
final
WxXcxConfig
wxXcxConfig
;
private
final
WxXcxRequest
wxXcxRequest
;
private
final
WxXcxAccessToken
accessToken
;
private
final
WxXcxOpenApiManageGetApiQuotaReq
req
;
public
WxXcxOpenApiManageGetApiQuotaRequest
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
,
WxXcxAccessToken
accessToken
,
WxXcxOpenApiManageGetApiQuotaReq
req
)
{
this
.
wxXcxConfig
=
wxXcxConfig
;
this
.
wxXcxRequest
=
wxXcxRequest
;
this
.
accessToken
=
accessToken
;
this
.
req
=
req
;
}
@Override
public
String
getUrl
()
{
return
wxXcxConfig
.
getBaseUrl
()
+
wxXcxConfig
.
getGetApiQuota
()
+
"?"
+
this
.
getUrlPara
();
}
@Override
public
String
getUrlPara
()
{
return
HttpHelper
.
getUrlParameter
(
accessToken
);
}
@Override
public
String
getPost
()
{
return
HttpHelper
.
getUrlParameter
(
req
);
}
public
WxXcxOpenApiManageGetApiQuotaRes
getResponse
()
{
// todo: 检测参数是否合法
// Assert.assertEquals();
return
this
.
wxXcxRequest
.
request
(
this
,
response
->
{
WxXcxOpenApiManageGetApiQuotaRes
ret
=
JsonHelper
.
deserialize
(
response
,
new
TypeReference
<
WxXcxOpenApiManageGetApiQuotaRes
>()
{
});
WxXcxAssert
.
assertBaseError
(
ret
);
return
ret
;
});
}
}
\ No newline at end of file
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetApiQuotaRes.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
import
com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError
;
/**
* 查询 API 调用额度 响应
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetApiQuotaRes
extends
WxXcxResponseBaseError
{
private
WxXcxOpenApiManageGetApiQuotaQuotaRes
quota
;
public
WxXcxOpenApiManageGetApiQuotaQuotaRes
getQuota
()
{
return
quota
;
}
public
void
setQuota
(
WxXcxOpenApiManageGetApiQuotaQuotaRes
quota
)
{
this
.
quota
=
quota
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetRidInfoReq.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
/**
* 查询 RID 信息 请求
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetRidInfoReq
{
/**
* 第三方平台接口调用凭证authorizer_access_token,该参数为 URL 参数,非 Body 参数。
*/
private
String
access_token
;
/**
* 调用接口报错返回的rid
*/
private
String
rid
;
public
String
getAccess_token
()
{
return
access_token
;
}
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
public
String
getRid
()
{
return
rid
;
}
public
void
setRid
(
String
rid
)
{
this
.
rid
=
rid
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetRidInfoRequest.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
import
com.alibaba.fastjson.TypeReference
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.wxxcx.base.*
;
/**
* 查询 RID 信息 转换
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetRidInfoRequest
implements
WxXcxRequestUrl
,
WxXcxRequestUrlPara
,
WxXcxRequestPostFormData
{
private
final
WxXcxConfig
wxXcxConfig
;
private
final
WxXcxRequest
wxXcxRequest
;
private
final
WxXcxAccessToken
accessToken
;
private
final
WxXcxOpenApiManageGetRidInfoReq
req
;
public
WxXcxOpenApiManageGetRidInfoRequest
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
,
WxXcxAccessToken
accessToken
,
WxXcxOpenApiManageGetRidInfoReq
req
)
{
this
.
wxXcxConfig
=
wxXcxConfig
;
this
.
wxXcxRequest
=
wxXcxRequest
;
this
.
accessToken
=
accessToken
;
this
.
req
=
req
;
}
@Override
public
String
getUrl
()
{
return
wxXcxConfig
.
getBaseUrl
()
+
wxXcxConfig
.
getGetRidInfo
()
+
"?"
+
this
.
getUrlPara
();
}
@Override
public
String
getUrlPara
()
{
return
HttpHelper
.
getUrlParameter
(
accessToken
);
}
@Override
public
String
getPost
()
{
return
HttpHelper
.
getUrlParameter
(
req
);
}
public
WxXcxOpenApiManageGetRidInfoRes
getResponse
()
{
// todo: 检测参数是否合法
// Assert.assertEquals();
return
this
.
wxXcxRequest
.
request
(
this
,
response
->
{
WxXcxOpenApiManageGetRidInfoRes
ret
=
JsonHelper
.
deserialize
(
response
,
new
TypeReference
<
WxXcxOpenApiManageGetRidInfoRes
>()
{
});
WxXcxAssert
.
assertBaseError
(
ret
);
return
ret
;
});
}
}
\ No newline at end of file
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetRidInfoRequestRes.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
/**
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetRidInfoRequestRes
{
/**
* 发起请求的时间戳
*/
private
double
invoke_time
;
/**
* 请求毫秒级耗时
*/
private
double
cost_in_ms
;
/**
* 请求的 URL 参数
*/
private
String
request_url
;
/**
* post请求的请求参数
*/
private
String
request_body
;
/**
* 接口请求返回参数
*/
private
String
response_body
;
/**
* 接口请求的客户端ip
*/
private
String
client_ip
;
public
double
getInvoke_time
()
{
return
invoke_time
;
}
public
void
setInvoke_time
(
double
invoke_time
)
{
this
.
invoke_time
=
invoke_time
;
}
public
double
getCost_in_ms
()
{
return
cost_in_ms
;
}
public
void
setCost_in_ms
(
double
cost_in_ms
)
{
this
.
cost_in_ms
=
cost_in_ms
;
}
public
String
getRequest_url
()
{
return
request_url
;
}
public
void
setRequest_url
(
String
request_url
)
{
this
.
request_url
=
request_url
;
}
public
String
getRequest_body
()
{
return
request_body
;
}
public
void
setRequest_body
(
String
request_body
)
{
this
.
request_body
=
request_body
;
}
public
String
getResponse_body
()
{
return
response_body
;
}
public
void
setResponse_body
(
String
response_body
)
{
this
.
response_body
=
response_body
;
}
public
String
getClient_ip
()
{
return
client_ip
;
}
public
void
setClient_ip
(
String
client_ip
)
{
this
.
client_ip
=
client_ip
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/openapimanage/WxXcxOpenApiManageGetRidInfoRes.java
0 → 100644
View file @
fdfdbcb5
package
com
.
yanzuoguang
.
wxxcx
.
openapimanage
;
import
com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError
;
/**
* 查询 RID 信息 响应
*
* @author 李贤军
*/
public
class
WxXcxOpenApiManageGetRidInfoRes
extends
WxXcxResponseBaseError
{
/**
* 查询 RID 信息 响应详情
*/
private
WxXcxOpenApiManageGetRidInfoRequestRes
request
;
public
WxXcxOpenApiManageGetRidInfoRequestRes
getRequest
()
{
return
request
;
}
public
void
setRequest
(
WxXcxOpenApiManageGetRidInfoRequestRes
request
)
{
this
.
request
=
request
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/start/impl/WxXcxAuthLoginImpl.java
View file @
fdfdbcb5
...
...
@@ -26,6 +26,7 @@ public class WxXcxAuthLoginImpl implements WxXcxAuthLogin {
/**
* 登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 小程序登录。
*
* @param wxXcxAuthCode2SessionReq 请求登录
* @return
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment