mirror of
https://github.com/PlayEdu/PlayEdu
synced 2025-06-24 13:22:42 +08:00
优化
This commit is contained in:
parent
4387471d76
commit
76dceaa44d
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package xyz.playedu.system.interceptor;
|
package xyz.playedu.api.interceptor;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package xyz.playedu.system.interceptor;
|
package xyz.playedu.api.interceptor;
|
||||||
|
|
||||||
import jakarta.servlet.http.HttpServletRequest;
|
import jakarta.servlet.http.HttpServletRequest;
|
||||||
import jakarta.servlet.http.HttpServletResponse;
|
import jakarta.servlet.http.HttpServletResponse;
|
@ -13,7 +13,7 @@
|
|||||||
* See the License for the specific language governing permissions and
|
* See the License for the specific language governing permissions and
|
||||||
* limitations under the License.
|
* limitations under the License.
|
||||||
*/
|
*/
|
||||||
package xyz.playedu.system.interceptor;
|
package xyz.playedu.api.interceptor;
|
||||||
|
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
|
|
@ -17,5 +17,5 @@ package xyz.playedu.common.service;
|
|||||||
|
|
||||||
public interface RateLimiterService {
|
public interface RateLimiterService {
|
||||||
|
|
||||||
public Long current(String key, Long seconds);
|
Long current(String key, Long seconds);
|
||||||
}
|
}
|
||||||
|
@ -37,8 +37,6 @@ public class RateLimiterServiceImpl implements RateLimiterService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Long current(String key, Long seconds) {
|
public Long current(String key, Long seconds) {
|
||||||
Long current = RedisUtil.handler().execute(redisScript, Arrays.asList(key, seconds + ""));
|
return RedisUtil.handler().execute(redisScript, Arrays.asList(key, seconds + ""));
|
||||||
log.info("key={},count={}", key, current);
|
|
||||||
return current;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user