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 9bbf23c7
authored
Sep 04, 2020
by
水库浪子
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
移除单元测试相关功能
1 parent
f8c66105
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
37 additions
and
23 deletions
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCorpAccountController.java
linkwe-common/pom.xml
linkwe-common/src/main/java/com/linkwechat/common/exception/wecom/WeComException.java
linkwe-wecom/pom.xml
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCorpAccount.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAccessTokenService.java
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/impl/WeAccessTokenServiceImpl.java
pom.xml
linkwe-admin/src/main/java/com/linkwechat/web/controller/wecom/WeCorpAccountController.java
View file @
9bbf23c
...
@@ -24,11 +24,7 @@ import java.util.List;
...
@@ -24,11 +24,7 @@ import java.util.List;
public
class
WeCorpAccountController
extends
BaseController
public
class
WeCorpAccountController
extends
BaseController
{
{
@Autowired
@Autowired
<<<<<<<
Updated
upstream:
linkwe
-
admin
/
src
/
main
/
java
/
com
/
linkwechat
/
web
/
controller
/
wecom
/
WeCorpAccountController
.
java
private
IWeCorpAccountService
weCorpAccountService
;
private
IWeCorpAccountService
weCorpAccountService
;
=======
private
IWeCorpAccountService
wxCorpAccountService
;
>>>>>>>
Stashed
changes:
linkwe
-
admin
/
src
/
main
/
java
/
com
/
linkwechat
/
web
/
controller
/
wecom
/
WxCorpAccountController
.
java
/**
/**
* 查询企业id相关配置列表
* 查询企业id相关配置列表
...
...
linkwe-common/pom.xml
View file @
9bbf23c
...
@@ -127,13 +127,10 @@
...
@@ -127,13 +127,10 @@
<dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
<artifactId>
lombok
</artifactId>
<scope>
compile
</scope>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
</dependency>
</dependencies>
</dependencies>
...
...
linkwe-common/src/main/java/com/linkwechat/common/exception/wecom/WeComException.java
View file @
9bbf23c
...
@@ -5,5 +5,20 @@ package com.linkwechat.common.exception.wecom;
...
@@ -5,5 +5,20 @@ package com.linkwechat.common.exception.wecom;
* @author: My
* @author: My
* @create: 2020-08-26 16:52
* @create: 2020-08-26 16:52
**/
**/
public
class
WeComException
{
public
class
WeComException
extends
RuntimeException
{
private
static
final
long
serialVersionUID
=
1L
;
protected
final
String
message
;
public
WeComException
(
String
message
)
{
this
.
message
=
message
;
}
@Override
public
String
getMessage
()
{
return
message
;
}
}
}
linkwe-wecom/pom.xml
View file @
9bbf23c
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<artifactId>
linkwe-common
</artifactId>
<artifactId>
linkwe-common
</artifactId>
</dependency>
</dependency>
</dependencies>
</dependencies>
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/domain/WeCorpAccount.java
View file @
9bbf23c
...
@@ -2,7 +2,10 @@ package com.linkwechat.wecom.domain;
...
@@ -2,7 +2,10 @@ package com.linkwechat.wecom.domain;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.common.annotation.Excel
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
com.linkwechat.common.core.domain.BaseEntity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
/**
* 企业id相关配置对象 wx_corp_account
* 企业id相关配置对象 wx_corp_account
...
@@ -11,6 +14,9 @@ import lombok.Data;
...
@@ -11,6 +14,9 @@ import lombok.Data;
* @date 2020-08-24
* @date 2020-08-24
*/
*/
@Data
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
public
class
WeCorpAccount
extends
BaseEntity
public
class
WeCorpAccount
extends
BaseEntity
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
linkwe-wecom/src/main/java/com/linkwechat/wecom/service/IWeAccessTokenService.java
View file @
9bbf23c
...
@@ -7,5 +7,5 @@ package com.linkwechat.wecom.service;
...
@@ -7,5 +7,5 @@ package com.linkwechat.wecom.service;
**/
**/
public
interface
IWeAccessTokenService
{
public
interface
IWeAccessTokenService
{
String
findToken
();
public
String
findToken
();
}
}
\ 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 @
9bbf23c
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
package
com
.
linkwechat
.
wecom
.
service
.
impl
;
import
com.linkwechat.common.constant.WeConstans
;
import
com.linkwechat.common.core.redis.RedisCache
;
import
com.linkwechat.common.exception.wecom.WeComException
;
import
com.linkwechat.common.utils.StringUtils
;
import
com.linkwechat.wecom.client.WeAccessTokenClient
;
import
com.linkwechat.wecom.client.WeAccessTokenClient
;
import
com.linkwechat.wecom.domain.dto.WeAccessTokenDtoDto
;
import
com.linkwechat.wecom.domain.WeCorpAccount
;
import
com.linkwechat.wecom.domain.WeCorpAccount
;
import
com.linkwechat.wecom.domain.dto.WeAccessTokenDtoDto
;
import
com.linkwechat.wecom.service.IWeAccessTokenService
;
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.data.redis.core.RedisTemplate
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
java.util.concurrent.TimeUnit
;
/**
/**
* @description: 微信token相关接口
* @description: 微信token相关接口
* @author:
My
* @author:
HaoN
* @create: 2020-08-26 14:43
* @create: 2020-08-26 14:43
**/
**/
@Service
@Service
...
@@ -26,7 +31,7 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
...
@@ -26,7 +31,7 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
@Autowired
@Autowired
private
RedisCache
redisCache
;
private
RedisCache
redisCache
;
...
@@ -39,9 +44,10 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
...
@@ -39,9 +44,10 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
=
iWxCorpAccountService
.
findValidWeCorpAccount
();
=
iWxCorpAccountService
.
findValidWeCorpAccount
();
if
(
null
==
wxCorpAccount
){
if
(
null
==
wxCorpAccount
){
//返回错误异常,让用户绑定企业id相关信息
//返回错误异常,让用户绑定企业id相关信息
throw
new
WeComException
(
"无可用的corpid和secret"
);
}
}
String
weAccessToken
=
(
String
)
redisCache
.
getCacheObject
(
WeConstans
.
WE_ACCESS_TOKEN
);
String
weAccessToken
=
redisCache
.
getCacheObject
(
WeConstans
.
WE_ACCESS_TOKEN
);
//为空,请求微信服务器同时缓存到redis中
//为空,请求微信服务器同时缓存到redis中
if
(
StringUtils
.
isEmpty
(
weAccessToken
)){
if
(
StringUtils
.
isEmpty
(
weAccessToken
)){
...
@@ -51,10 +57,8 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
...
@@ -51,10 +57,8 @@ public class WeAccessTokenServiceImpl implements IWeAccessTokenService {
redisCache
.
setCacheObject
(
WeConstans
.
WE_ACCESS_TOKEN
,
accessToken
.
getAccess_token
(),
accessToken
.
getExpires_in
().
intValue
(),
TimeUnit
.
SECONDS
);
redisCache
.
setCacheObject
(
WeConstans
.
WE_ACCESS_TOKEN
,
accessToken
.
getAccess_token
(),
accessToken
.
getExpires_in
().
intValue
(),
TimeUnit
.
SECONDS
);
weAccessToken
=
accessToken
.
getAccess_token
();
weAccessToken
=
accessToken
.
getAccess_token
();
}
}
}
}
return
weAccessToken
;
return
weAccessToken
;
}
}
...
...
pom.xml
View file @
9bbf23c
...
@@ -205,12 +205,7 @@
...
@@ -205,12 +205,7 @@
<version>
${lombok.version}
</version>
<version>
${lombok.version}
</version>
</dependency>
</dependency>
<dependency>
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-test
</artifactId>
<version>
${springboot.vaerion}
</version>
<scope>
test
</scope>
</dependency>
</dependencies>
</dependencies>
...
...
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