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
ed23035c
Commit
ed23035c
authored
Jun 22, 2022
by
yanzg
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
升级新版本
parent
222ec7a5
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
316 additions
and
39 deletions
+316
-39
WxXcxAuthCode2SessionReq.java
...anzuoguang/wxxcx/auth/login/WxXcxAuthCode2SessionReq.java
+5
-0
WxXcxAuthCode2SessionRequest.java
...oguang/wxxcx/auth/login/WxXcxAuthCode2SessionRequest.java
+6
-6
WxXcxResponseAuthCode2SessionRes.java
...ng/wxxcx/auth/login/WxXcxResponseAuthCode2SessionRes.java
+6
-0
code2Session.md
...ain/java/com/yanzuoguang/wxxcx/auth/login/code2Session.md
+0
-0
WxAuthCode2SessionReq.java
.../wxxcx/auth/login/code2session/WxAuthCode2SessionReq.java
+0
-5
WxXcxCode2SessionRes.java
...g/wxxcx/auth/login/code2session/WxXcxCode2SessionRes.java
+0
-6
readme.md
...-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/readme.md
+4
-4
WxAuthCheckEncryptedDataReq.java
...zuoguang/wxxcx/auth/user/WxAuthCheckEncryptedDataReq.java
+16
-0
WxAuthCheckEncryptedDataRequest.java
...uang/wxxcx/auth/user/WxAuthCheckEncryptedDataRequest.java
+51
-0
WxAuthCheckEncryptedDataRes.java
...zuoguang/wxxcx/auth/user/WxAuthCheckEncryptedDataRes.java
+6
-0
checkEncryptedData.md
...ava/com/yanzuoguang/wxxcx/auth/user/checkEncryptedData.md
+134
-0
WxXcxAccessToken.java
...ain/java/com/yanzuoguang/wxxcx/base/WxXcxAccessToken.java
+19
-0
WxXcxAssert.java
...src/main/java/com/yanzuoguang/wxxcx/base/WxXcxAssert.java
+1
-1
WxXcxConfig.java
...src/main/java/com/yanzuoguang/wxxcx/base/WxXcxConfig.java
+7
-7
WxXcxResponseBaseError.java
...va/com/yanzuoguang/wxxcx/base/WxXcxResponseBaseError.java
+1
-1
WxXcxAuthLogin.java
...main/java/com/yanzuoguang/wxxcx/start/WxXcxAuthLogin.java
+4
-4
WxXcxAuthUser.java
.../main/java/com/yanzuoguang/wxxcx/start/WxXcxAuthUser.java
+21
-0
WxXcxAuthLoginImpl.java
.../com/yanzuoguang/wxxcx/start/impl/WxXcxAuthLoginImpl.java
+5
-5
WxXcxAuthUserImpl.java
...a/com/yanzuoguang/wxxcx/start/impl/WxXcxAuthUserImpl.java
+30
-0
No files found.
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/WxXcxAuthCode2SessionReq.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
login
;
public
class
WxXcxAuthCode2SessionReq
{
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/
code2session/
WxXcxAuthCode2SessionRequest.java
→
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/WxXcxAuthCode2SessionRequest.java
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
login
.
code2session
;
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
login
;
import
com.alibaba.fastjson.TypeReference
;
import
com.yanzuoguang.util.helper.HttpHelper
;
...
...
@@ -6,7 +6,7 @@ import com.yanzuoguang.util.helper.JsonHelper;
import
com.yanzuoguang.wxxcx.base.*
;
/**
*
请求配置
*
登录凭证校验。通过 wx.login 接口获得临时登录凭证 code 后传到开发者服务器调用此接口完成登录流程。更多使用方法详见 小程序登录。
*
* @author 颜佐光
*/
...
...
@@ -14,9 +14,9 @@ public class WxXcxAuthCode2SessionRequest implements WxXwxRequestUrl, WxXcxReque
private
final
WxXcxConfig
wxXcxConfig
;
private
final
WxXcxRequest
wxXcxRequest
;
private
final
WxAuthCode2SessionReq
req
;
private
final
Wx
Xcx
AuthCode2SessionReq
req
;
public
WxXcxAuthCode2SessionRequest
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
,
WxAuthCode2SessionReq
req
)
{
public
WxXcxAuthCode2SessionRequest
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
,
Wx
Xcx
AuthCode2SessionReq
req
)
{
this
.
wxXcxConfig
=
wxXcxConfig
;
this
.
wxXcxRequest
=
wxXcxRequest
;
this
.
req
=
req
;
...
...
@@ -32,11 +32,11 @@ public class WxXcxAuthCode2SessionRequest implements WxXwxRequestUrl, WxXcxReque
return
HttpHelper
.
getUrlParameter
(
req
);
}
public
WxXcxCode2SessionRes
getResponse
()
{
public
WxXcx
ResponseAuth
Code2SessionRes
getResponse
()
{
// todo: 检测参数是否合法
// Assert.assertEquals();
return
this
.
wxXcxRequest
.
request
(
this
,
response
->
{
WxXcx
Code2SessionRes
ret
=
JsonHelper
.
deserialize
(
response
,
new
TypeReference
<
WxXcx
Code2SessionRes
>()
{
WxXcx
ResponseAuthCode2SessionRes
ret
=
JsonHelper
.
deserialize
(
response
,
new
TypeReference
<
WxXcxResponseAuth
Code2SessionRes
>()
{
});
WxXcxAssert
.
assertBaseError
(
ret
);
return
ret
;
...
...
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/WxXcxResponseAuthCode2SessionRes.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
login
;
import
com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError
;
public
class
WxXcxResponseAuthCode2SessionRes
extends
WxXcxResponseBaseError
{
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/code2
session/readme
.md
→
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/code2
Session
.md
View file @
ed23035c
File moved
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/code2session/WxAuthCode2SessionReq.java
deleted
100644 → 0
View file @
222ec7a5
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
login
.
code2session
;
public
class
WxAuthCode2SessionReq
{
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/login/code2session/WxXcxCode2SessionRes.java
deleted
100644 → 0
View file @
222ec7a5
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
login
.
code2session
;
import
com.yanzuoguang.wxxcx.base.WxXcxBaseError
;
public
class
WxXcxCode2SessionRes
extends
WxXcxBaseError
{
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/readme.md
View file @
ed23035c
-
[
登录
](
login/code2
session/readme
.md
)
-
[
code2Session
](
login/code2
session/readme
.md
)
-
[
用户信息
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html
)
-
[
checkEncryptedData
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html
)
-
[
登录
](
login/code2
Session
.md
)
-
[
code2Session
](
login/code2
Session
.md
)
-
用户信息
-
[
checkEncryptedData
](
user/checkEncryptedData.md
)
-
[
getPaidUnionId
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.getPaidUnionId.html
)
-
[
getPluginOpenPId
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.getPluginOpenPId.html
)
-
[
接口调用凭证
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/access-token/auth.getAccessToken.html
)
...
...
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/user/WxAuthCheckEncryptedDataReq.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
user
;
import
com.yanzuoguang.wxxcx.base.WxXcxAssert
;
public
class
WxAuthCheckEncryptedDataReq
{
private
String
encrypted_msg_hash
;
public
String
getEncrypted_msg_hash
()
{
return
encrypted_msg_hash
;
}
public
void
setEncrypted_msg_hash
(
String
encrypted_msg_hash
)
{
this
.
encrypted_msg_hash
=
encrypted_msg_hash
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/user/WxAuthCheckEncryptedDataRequest.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
user
;
import
com.alibaba.fastjson.TypeReference
;
import
com.yanzuoguang.util.helper.HttpHelper
;
import
com.yanzuoguang.util.helper.JsonHelper
;
import
com.yanzuoguang.wxxcx.base.*
;
/**
* 检查加密信息是否由微信生成(当前只支持手机号加密数据),只能检测最近3天生成的加密数据
* @author 颜佐光
*/
public
class
WxAuthCheckEncryptedDataRequest
implements
WxXwxRequestUrl
,
WxXcxRequestUrlPara
,
WxXcxRequestPostFormData
{
private
final
WxXcxConfig
wxXcxConfig
;
private
final
WxXcxRequest
wxXcxRequest
;
private
final
WxXcxAccessToken
accessToken
;
private
final
WxAuthCheckEncryptedDataReq
req
;
public
WxAuthCheckEncryptedDataRequest
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
,
WxXcxAccessToken
accessToken
,
WxAuthCheckEncryptedDataReq
req
)
{
this
.
wxXcxConfig
=
wxXcxConfig
;
this
.
wxXcxRequest
=
wxXcxRequest
;
this
.
accessToken
=
accessToken
;
this
.
req
=
req
;
}
@Override
public
String
getUrl
()
{
return
wxXcxConfig
.
getBaseUrl
()
+
wxXcxConfig
.
getAuthCheckEncryptedDataUrl
()
+
"?"
+
this
.
getUrlPara
();
}
@Override
public
String
getUrlPara
()
{
return
HttpHelper
.
getUrlParameter
(
accessToken
);
}
@Override
public
String
getPost
()
{
return
HttpHelper
.
getUrlParameter
(
req
);
}
public
WxAuthCheckEncryptedDataRes
getResponse
()
{
// todo: 检测参数是否合法
// Assert.assertEquals();
return
this
.
wxXcxRequest
.
request
(
this
,
response
->
{
WxAuthCheckEncryptedDataRes
ret
=
JsonHelper
.
deserialize
(
response
,
new
TypeReference
<
WxAuthCheckEncryptedDataRes
>()
{
});
WxXcxAssert
.
assertBaseError
(
ret
);
return
ret
;
});
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/user/WxAuthCheckEncryptedDataRes.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
auth
.
user
;
import
com.yanzuoguang.wxxcx.base.WxXcxResponseBaseError
;
public
class
WxAuthCheckEncryptedDataRes
extends
WxXcxResponseBaseError
{
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/auth/user/checkEncryptedData.md
0 → 100644
View file @
ed23035c
用户信息 /checkEncryptedData
# auth.checkEncryptedData
> 本接口应在服务器端调用,详细说明参见[服务端API](https://developers.weixin.qq.com/miniprogram/dev/framework/server-ability/backend-api.html)。
> 本接口支持[云调用](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/openapi/openapi.html)。需开发者工具版本 >= `1.02.1904090`(最新[稳定版下载](https://developers.weixin.qq.com/miniprogram/dev/devtools/stable.html)),`wx-server-sdk` >= `0.4.0`
检查加密信息是否由微信生成(当前只支持手机号加密数据),只能检测最近3天生成的加密数据
调用方式:
-
[
HTTPS 调用
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html#method-http
)
-
[
云调用
](
https://developers.weixin.qq.com/miniprogram/dev/api-backend/open-api/user-info/auth.checkEncryptedData.html#method-cloud
)
## HTTPS 调用
### 请求地址
```
text
POST https://api.weixin.qq.com/wxa/business/checkencryptedmsg?access_token=ACCESS_TOKEN
```
### 请求参数
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| :----------------- | :----- | :----- | :--- | :------------------------------------------------ |
| encrypted_msg_hash | string | | 是 | 加密数据的sha256,通过Hex(Base16)编码后的字符串 |
### 返回值
### Object
返回的 JSON 数据
| 属性 | 类型 | 说明 |
| :---------- | :------ | :------------------- |
| errcode | number | 错误码 |
| errmsg | string | 错误提示信息 |
| vaild | boolean | 是否是合法的数据 |
| create_time | number | 加密数据生成的时间戳 |
**errcode 的合法值**
| 值 | 说明 | 最低版本 |
| :---- | :----------------------------------------------------------- | :------- |
| 0 | 请求成功 | |
| -1 | 系统繁忙,此时请开发者稍候再试 | |
| 1 | 加密数据不存在,数据生成的时间超过保存的限制(3天)或者 key 不存在 | |
| 40097 | 请求里的encrypted_msg_hash参数无效 | |
| 44002 | 传入的数据为空 | |
| 47001 | 传入的数据格式错误 | |
### 调用示例
```
text
加密数据为: hsSuSUsePBqSQw2rYMtf9Nvha603xX8f2BMQBcYRoJiMNwOqt/UEhrqekebG5ar0LFNAm5MD4Uz6zorRwiXJwbySJ/FEJHav4NsobBIU1PwdjbJWVQLFy7+YFkHB32OnQXWMh6ugW7Dyk2KS5BXp1f5lniKPp1KNLyNLlFlNZ2mgJCJmWvHj5AI7BLpWwoRvqRyZvVXo+9FsWqvBdxmAPA==
sha256: 657edd868c9715a9bebe42b833269a557a48498785397a796f1568c29a200b2c
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"encrypted_msg_hash": "657edd868c9715a9bebe42b833269a557a48498785397a796f1568c29a200b2c"}' http://api.weixin.qq.com/wxa/business/checkencryptedmsg?access_token=ACCESS_TOKEN
```
### 返回结果示例
```
json
{
"errcode"
:
0
,
"errmsg"
:
"ok"
,
"vaild"
:
true
,
"create_time"
:
1629121902
}
```
## 云调用
> [云调用](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/openapi/openapi.html)是微信云开发提供的在云函数中调用微信开放接口的能力,需要在云函数中通过 `wx-server-sdk` 使用。
### 接口方法
```
js
openapi
.
auth
.
checkEncryptedData
```
> 需在 `config.json` 中配置 `auth.checkEncryptedData` API 的权限,[详情](https://developers.weixin.qq.com/miniprogram/dev/wxcloud/guide/openapi/openapi.html#usage-3)
### 请求参数
| 属性 | 类型 | 默认值 | 必填 | 说明 |
| :--------------- | :----- | :----- | :--- | :------------------------------------------------ |
| encryptedMsgHash | string | | 是 | 加密数据的sha256,通过Hex(Base16)编码后的字符串 |
### 返回值
### Object
返回的 JSON 数据
| 属性 | 类型 | 说明 |
| :--------- | :------ | :------------------- |
| errCode | number | 错误码 |
| errMsg | string | 错误提示信息 |
| vaild | boolean | 是否是合法的数据 |
| createTime | number | 加密数据生成的时间戳 |
**errCode 的合法值**
| 值 | 说明 | 最低版本 |
| :--- | :--- | :------- |
| 0 | 成功 | |
### 异常
### Object
抛出的异常
| 属性 | 类型 | 说明 |
| :------ | :----- | :----------- |
| errCode | number | 错误码 |
| errMsg | string | 错误提示信息 |
**errCode 的合法值**
| 值 | 说明 | 最低版本 |
| :---- | :----------------------------------------------------------- | :------- |
| -1 | 系统繁忙,此时请开发者稍候再试 | |
| 1 | 加密数据不存在,数据生成的时间超过保存的限制(3天)或者 key 不存在 | |
| 40097 | 请求里的encrypted_msg_hash参数无效 | |
| 44002 | 传入的数据为空 | |
| 47001 | 传入的数据格式错误 | |
\ No newline at end of file
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/base/WxXcxAccessToken.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
base
;
/**
* 小程序token
*
* @author 颜佐光
*/
public
class
WxXcxAccessToken
{
private
String
access_token
;
public
String
getAccess_token
()
{
return
access_token
;
}
public
void
setAccess_token
(
String
access_token
)
{
this
.
access_token
=
access_token
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/base/WxXcxAssert.java
View file @
ed23035c
...
...
@@ -11,7 +11,7 @@ public class WxXcxAssert {
public
static
final
String
WX_ERROR_CODE
=
"WX_XCX."
;
public
static
void
assertBaseError
(
WxXcxBaseError
baseError
)
{
public
static
void
assertBaseError
(
WxXcx
Response
BaseError
baseError
)
{
if
(
baseError
.
getErrcode
()
!=
0
)
{
throw
new
CodeTargetException
(
String
.
format
(
"%s%s"
,
WX_ERROR_CODE
,
baseError
.
getErrcode
()),
baseError
.
getErrmsg
(),
baseError
);
}
...
...
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/base/WxXcxConfig.java
View file @
ed23035c
...
...
@@ -15,22 +15,22 @@ public class WxXcxConfig {
private
String
baseUrl
;
@Value
(
"${yzg.wx.xcx.
code2Sess
ionUrl:/sns/jscode2session}"
)
@Value
(
"${yzg.wx.xcx.
authCode2Sesst
ionUrl:/sns/jscode2session}"
)
private
String
authCode2SesstionUrl
;
@Value
(
"${yzg.wx.xcx.authCheckEncryptedDataUrl:/wxa/business/checkencryptedmsg}"
)
private
String
authCheckEncryptedDataUrl
;
public
String
getBaseUrl
()
{
return
baseUrl
;
}
public
void
setBaseUrl
(
String
baseUrl
)
{
this
.
baseUrl
=
baseUrl
;
}
public
String
getAuthCode2SesstionUrl
()
{
return
authCode2SesstionUrl
;
}
public
void
setAuthCode2SesstionUrl
(
String
authCode2SesstionUrl
)
{
this
.
authCode2SesstionUrl
=
authCode2Sesstion
Url
;
public
String
getAuthCheckEncryptedDataUrl
(
)
{
return
authCheckEncryptedData
Url
;
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/base/WxXcxBaseError.java
→
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/base/WxXcx
Response
BaseError.java
View file @
ed23035c
...
...
@@ -2,7 +2,7 @@ package com.yanzuoguang.wxxcx.base;
import
com.yanzuoguang.util.vo.BaseVo
;
public
class
WxXcxBaseError
extends
BaseVo
{
public
class
WxXcx
Response
BaseError
extends
BaseVo
{
/**
* 错误码
...
...
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/start/WxXcxAuthLogin.java
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
start
;
import
com.yanzuoguang.wxxcx.auth.login.
code2session.W
xAuthCode2SessionReq
;
import
com.yanzuoguang.wxxcx.auth.login.
code2session.WxXcx
Code2SessionRes
;
import
com.yanzuoguang.wxxcx.auth.login.
WxXc
xAuthCode2SessionReq
;
import
com.yanzuoguang.wxxcx.auth.login.
WxXcxResponseAuth
Code2SessionRes
;
/**
* 微信登录实现类
...
...
@@ -13,8 +13,8 @@ public interface WxXcxAuthLogin {
/**
* 请求登录
*
* @param wxAuthCode2SessionReq 请求登录
* @param wx
Xcx
AuthCode2SessionReq 请求登录
* @return 请求实体
*/
WxXcx
Code2SessionRes
code2Session
(
WxAuthCode2SessionReq
w
xAuthCode2SessionReq
);
WxXcx
ResponseAuthCode2SessionRes
code2Session
(
WxXcxAuthCode2SessionReq
wxXc
xAuthCode2SessionReq
);
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/start/WxXcxAuthUser.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
start
;
import
com.yanzuoguang.wxxcx.auth.user.WxAuthCheckEncryptedDataReq
;
import
com.yanzuoguang.wxxcx.auth.user.WxAuthCheckEncryptedDataRes
;
import
com.yanzuoguang.wxxcx.base.WxXcxAccessToken
;
/**
*
*
* @author 颜佐光
*/
public
interface
WxXcxAuthUser
{
/**
*
* @param accessToken
* @param req
* @return
*/
WxAuthCheckEncryptedDataRes
checkEncryptedData
(
WxXcxAccessToken
accessToken
,
WxAuthCheckEncryptedDataReq
req
);
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/start/impl/WxXcxAuthLoginImpl.java
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
start
.
impl
;
import
com.yanzuoguang.wxxcx.auth.login.
code2session.W
xAuthCode2SessionReq
;
import
com.yanzuoguang.wxxcx.auth.login.
code2session.
WxXcxAuthCode2SessionRequest
;
import
com.yanzuoguang.wxxcx.auth.login.
code2session.WxXcx
Code2SessionRes
;
import
com.yanzuoguang.wxxcx.auth.login.
WxXc
xAuthCode2SessionReq
;
import
com.yanzuoguang.wxxcx.auth.login.WxXcxAuthCode2SessionRequest
;
import
com.yanzuoguang.wxxcx.auth.login.
WxXcxResponseAuth
Code2SessionRes
;
import
com.yanzuoguang.wxxcx.base.WxXcxConfig
;
import
com.yanzuoguang.wxxcx.base.WxXcxRequest
;
import
com.yanzuoguang.wxxcx.start.WxXcxAuthLogin
;
...
...
@@ -25,8 +25,8 @@ public class WxXcxAuthLoginImpl implements WxXcxAuthLogin {
}
@Override
public
WxXcx
Code2SessionRes
code2Session
(
WxAuthCode2SessionReq
w
xAuthCode2SessionReq
)
{
WxXcxAuthCode2SessionRequest
code2SessionRequest
=
new
WxXcxAuthCode2SessionRequest
(
wxXcxConfig
,
wxXcxRequest
,
wxAuthCode2SessionReq
);
public
WxXcx
ResponseAuthCode2SessionRes
code2Session
(
WxXcxAuthCode2SessionReq
wxXc
xAuthCode2SessionReq
)
{
WxXcxAuthCode2SessionRequest
code2SessionRequest
=
new
WxXcxAuthCode2SessionRequest
(
wxXcxConfig
,
wxXcxRequest
,
wx
Xcx
AuthCode2SessionReq
);
return
code2SessionRequest
.
getResponse
();
}
}
yzg-util-wxxcx/src/main/java/com/yanzuoguang/wxxcx/start/impl/WxXcxAuthUserImpl.java
0 → 100644
View file @
ed23035c
package
com
.
yanzuoguang
.
wxxcx
.
start
.
impl
;
import
com.yanzuoguang.wxxcx.auth.user.WxAuthCheckEncryptedDataReq
;
import
com.yanzuoguang.wxxcx.auth.user.WxAuthCheckEncryptedDataRequest
;
import
com.yanzuoguang.wxxcx.auth.user.WxAuthCheckEncryptedDataRes
;
import
com.yanzuoguang.wxxcx.base.WxXcxAccessToken
;
import
com.yanzuoguang.wxxcx.base.WxXcxConfig
;
import
com.yanzuoguang.wxxcx.base.WxXcxRequest
;
import
com.yanzuoguang.wxxcx.start.WxXcxAuthUser
;
import
org.springframework.stereotype.Component
;
/**
* @author 颜佐光
*/
@Component
public
class
WxXcxAuthUserImpl
implements
WxXcxAuthUser
{
private
final
WxXcxConfig
wxXcxConfig
;
private
final
WxXcxRequest
wxXcxRequest
;
public
WxXcxAuthUserImpl
(
WxXcxConfig
wxXcxConfig
,
WxXcxRequest
wxXcxRequest
)
{
this
.
wxXcxConfig
=
wxXcxConfig
;
this
.
wxXcxRequest
=
wxXcxRequest
;
}
@Override
public
WxAuthCheckEncryptedDataRes
checkEncryptedData
(
WxXcxAccessToken
accessToken
,
WxAuthCheckEncryptedDataReq
req
)
{
WxAuthCheckEncryptedDataRequest
code2SessionRequest
=
new
WxAuthCheckEncryptedDataRequest
(
wxXcxConfig
,
wxXcxRequest
,
accessToken
,
req
);
return
code2SessionRequest
.
getResponse
();
}
}
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