Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
江名洋
/
linkwe-scrm
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 24f9b665
authored
Dec 17, 2020
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
添加企业账号更新,启动清空企业微信token功能;
1 parent
0082627e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
41 additions
and
2 deletions
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAccessTokenService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAccessTokenServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCorpAccountServiceImpl.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAccessTokenService.java
View file @
24f9b66
...
@@ -14,4 +14,6 @@ public interface IWeAccessTokenService {
...
@@ -14,4 +14,6 @@ public interface IWeAccessTokenService {
public
String
findProviderAccessToken
();
public
String
findProviderAccessToken
();
public
void
removeToken
();
}
}
\ No newline at end of file
\ No newline at end of file
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAccessTokenServiceImpl.java
View file @
24f9b66
...
@@ -68,6 +68,8 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
...
@@ -68,6 +68,8 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
}
}
private
String
findAccessToken
(
String
accessTokenKey
){
private
String
findAccessToken
(
String
accessTokenKey
){
String
weAccessToken
=
redisCache
.
getCacheObject
(
accessTokenKey
);
String
weAccessToken
=
redisCache
.
getCacheObject
(
accessTokenKey
);
...
@@ -105,4 +107,15 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
...
@@ -105,4 +107,15 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
}
}
/**
* 清空redis中的相关token
*/
@Override
public
void
removeToken
()
{
redisCache
.
deleteObject
(
WeConstans
.
WE_COMMON_ACCESS_TOKEN
);
redisCache
.
deleteObject
(
WeConstans
.
WE_CONTACT_ACCESS_TOKEN
);
redisCache
.
deleteObject
(
WeConstans
.
WE_PROVIDER_ACCESS_TOKEN
);
}
}
}
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeCorpAccountServiceImpl.java
View file @
24f9b66
...
@@ -6,6 +6,7 @@ import java.util.Optional;
...
@@ -6,6 +6,7 @@ import java.util.Optional;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.constant.Constants
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.utils.DateUtils
;
import
com.linkwechat.common.utils.DateUtils
;
import
com.linkwechat.wecom.service.IWeAccessTokenService
;
import
com.linkwechat.wecom.service.IWeCorpAccountService
;
import
com.linkwechat.wecom.service.IWeCorpAccountService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
...
@@ -25,6 +26,10 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
...
@@ -25,6 +26,10 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
@Autowired
@Autowired
private
WeCorpAccountMapper
weCorpAccountMapper
;
private
WeCorpAccountMapper
weCorpAccountMapper
;
@Autowired
private
IWeAccessTokenService
iWeAccessTokenService
;
/**
/**
* 查询企业id相关配置
* 查询企业id相关配置
*
*
...
@@ -72,7 +77,15 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
...
@@ -72,7 +77,15 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
)
public
int
updateWeCorpAccount
(
WeCorpAccount
wxCorpAccount
)
{
{
return
weCorpAccountMapper
.
updateWeCorpAccount
(
wxCorpAccount
);
int
returnCode
=
weCorpAccountMapper
.
updateWeCorpAccount
(
wxCorpAccount
);
if
(
Constants
.
SERVICE_RETURN_SUCCESS_CODE
<
returnCode
){
iWeAccessTokenService
.
removeToken
();
}
return
returnCode
;
}
}
...
@@ -94,7 +107,18 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
...
@@ -94,7 +107,18 @@ public class WeCorpAccountServiceImpl implements IWeCorpAccountService {
*/
*/
@Override
@Override
public
int
startVailWeCorpAccount
(
String
corpId
)
{
public
int
startVailWeCorpAccount
(
String
corpId
)
{
return
weCorpAccountMapper
.
startVailWeCorpAccount
(
corpId
);
int
returnCode
=
weCorpAccountMapper
.
startVailWeCorpAccount
(
corpId
);
if
(
Constants
.
SERVICE_RETURN_SUCCESS_CODE
<
returnCode
){
iWeAccessTokenService
.
removeToken
();
}
return
returnCode
;
}
}
@Override
@Override
...
...
Write
Preview
Markdown
is supported
Attach a file
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 post a comment