Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
afanti-open-api
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
JIRA
JIRA
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
java-ms
afanti-open-api
Commits
34475143
Commit
34475143
authored
Sep 26, 2024
by
许润龙
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev-activity-faw' into 'uat'
Dev activity faw See merge request
!62
parents
5792d9c0
c68e3f07
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
8 deletions
+8
-8
FawActivityDTO.java
...com/afanticar/afantiopenapi/model/dto/FawActivityDTO.java
+1
-1
BaseService.java
...java/com/afanticar/afantiopenapi/service/BaseService.java
+7
-7
No files found.
src/main/java/com/afanticar/afantiopenapi/model/dto/FawActivityDTO.java
View file @
34475143
...
@@ -22,7 +22,7 @@ public class FawActivityDTO {
...
@@ -22,7 +22,7 @@ public class FawActivityDTO {
@Min
(
value
=
1
,
message
=
"当前页最小1"
)
@Min
(
value
=
1
,
message
=
"当前页最小1"
)
private
Integer
current
;
private
Integer
current
;
@Max
(
value
=
500
,
message
=
"分页大小最大5
00"
)
@Max
(
value
=
1000
,
message
=
"分页大小最大10
00"
)
private
Integer
size
;
private
Integer
size
;
private
String
publishDateStart
;
private
String
publishDateStart
;
...
...
src/main/java/com/afanticar/afantiopenapi/service/BaseService.java
View file @
34475143
...
@@ -55,13 +55,13 @@ public class BaseService {
...
@@ -55,13 +55,13 @@ public class BaseService {
}
catch
(
InterruptedException
e
)
{
}
catch
(
InterruptedException
e
)
{
throw
new
RuntimeException
(
e
);
throw
new
RuntimeException
(
e
);
}
}
//
String header = "token";
String
header
=
"token"
;
//
String fawKey = String.format("%s:%s:limit", dataType, header);
String
fawKey
=
String
.
format
(
"%s:%s:limit"
,
dataType
,
header
);
//
RRateLimiter rateLimiter = redissonClient.getRateLimiter(fawKey);
RRateLimiter
rateLimiter
=
redissonClient
.
getRateLimiter
(
fawKey
);
//
rateLimiter.trySetRate(RateType.OVERALL, limit, limitPeriod, RateIntervalUnit.SECONDS);
rateLimiter
.
trySetRate
(
RateType
.
OVERALL
,
limit
,
limitPeriod
,
RateIntervalUnit
.
SECONDS
);
//
if (!rateLimiter.tryAcquire(1, waiting, TimeUnit.MILLISECONDS)) {
if
(!
rateLimiter
.
tryAcquire
(
1
,
waiting
,
TimeUnit
.
MILLISECONDS
))
{
//
return BaseController.error("10010", "您的请求太过频繁,请稍后再试!");
return
BaseController
.
error
(
"10010"
,
"您的请求太过频繁,请稍后再试!"
);
//
}
}
return
null
;
return
null
;
}
}
}
}
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