Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
haoban-manage3.0
Overview
Overview
Details
Activity
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
QianQiXiang
haoban-manage3.0
Commits
0f45d8ab
Commit
0f45d8ab
authored
Dec 08, 2020
by
qwmqiuwenmin
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'developer' of
http://115.159.76.241/haoban3.0/haoban-manage3.0.git
into developer
parents
31052891
dd6225bc
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
2 deletions
+17
-2
TestController.java
.../com/gic/haoban/manage/web/controller/TestController.java
+15
-0
HaoBanErrCode.java
...java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
+1
-1
WebInterceptor.java
...com/gic/haoban/manage/web/interceptor/WebInterceptor.java
+1
-1
No files found.
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/controller/TestController.java
View file @
0f45d8ab
...
@@ -12,10 +12,12 @@ import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
...
@@ -12,10 +12,12 @@ import com.gic.haoban.manage.api.service.MemberUnionidRelatedApiService;
import
com.gic.haoban.manage.api.service.TestApiService
;
import
com.gic.haoban.manage.api.service.TestApiService
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.errCode.HaoBanErrCode
;
import
com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo
;
import
com.gic.haoban.manage.web.qo.QywxXcxSendMessageQo
;
import
com.gic.redis.data.util.GicRateLimiter
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.redis.data.util.RedisUtil
;
import
com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO
;
import
com.gic.wechat.api.dto.qywx.QywxXcxSendMessageDTO
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
com.gic.wechat.api.service.qywx.QywxSuiteApiService
;
import
org.apache.commons.lang3.StringUtils
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -152,4 +154,17 @@ public class TestController extends WebBaseController {
...
@@ -152,4 +154,17 @@ public class TestController extends WebBaseController {
testApiService
.
listAllQywxUser
(
corpid
,
secretVal
,
dataId
);
testApiService
.
listAllQywxUser
(
corpid
,
secretVal
,
dataId
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
@RequestMapping
(
"/test-limiter"
)
public
HaobanResponse
testLimiter
(
String
key
,
String
eid
)
{
if
(
StringUtils
.
isAnyBlank
(
key
,
eid
))
{
return
resultResponse
(
HaoBanErrCode
.
ERR_5
);
}
GicRateLimiter
instance
=
GicRateLimiter
.
getInstance
(
"haoban-manage3-web"
);
Long
acquire
=
instance
.
acquire
(
key
,
eid
);
if
(
acquire
==
0L
)
{
return
resultResponse
(
HaoBanErrCode
.
ERR_13
);
}
return
resultResponse
(
HaoBanErrCode
.
ERR_1
);
}
}
}
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/errCode/HaoBanErrCode.java
View file @
0f45d8ab
...
@@ -59,7 +59,7 @@ public enum HaoBanErrCode {
...
@@ -59,7 +59,7 @@ public enum HaoBanErrCode {
/**
/**
* 验证码发送失败
* 验证码发送失败
*/
*/
ERR_13
(
1
1
,
"客官,当前访问人数较多,请稍后再试"
),
ERR_13
(
1
3
,
"客官,当前访问人数较多,请稍后再试"
),
/**
/**
* 验证码校验失败
* 验证码校验失败
...
...
haoban-manage3-web/src/main/java/com/gic/haoban/manage/web/interceptor/WebInterceptor.java
View file @
0f45d8ab
...
@@ -106,7 +106,7 @@ public class WebInterceptor extends HandlerInterceptorAdapter {
...
@@ -106,7 +106,7 @@ public class WebInterceptor extends HandlerInterceptorAdapter {
Long
acquire
=
instance
.
acquire
(
requestURI
,
wxEnterpriseId
);
Long
acquire
=
instance
.
acquire
(
requestURI
,
wxEnterpriseId
);
logger
.
info
(
"限流返回值:{},{}"
,
requestURI
,
acquire
);
logger
.
info
(
"限流返回值:{},{}"
,
requestURI
,
acquire
);
if
(
acquire
.
equals
(
0
)
)
{
if
(
acquire
==
0L
)
{
this
.
errorResult
(
httpServletResponse
,
HaoBanErrCode
.
ERR_13
);
this
.
errorResult
(
httpServletResponse
,
HaoBanErrCode
.
ERR_13
);
logger
.
info
(
"限流!"
);
logger
.
info
(
"限流!"
);
return
false
;
return
false
;
...
...
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