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
c68e3f07
Commit
c68e3f07
authored
Sep 26, 2024
by
许润龙
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改:活动视频、直播数据详情数据接口
parent
7b9600e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 deletions
+7
-7
BaseService.java
...java/com/afanticar/afantiopenapi/service/BaseService.java
+7
-7
No files found.
src/main/java/com/afanticar/afantiopenapi/service/BaseService.java
View file @
c68e3f07
...
@@ -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