Skip to content

16301094/Assignment2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 

Repository files navigation

小组成员 16301093黄镇海 16301094黄琛深 16301103谢俊

A2-report文档截图

basic requirment:restful services实现 Rate Limiting: 依赖: com.google.guava guava 创建AccessLimitService, 每秒发放5个令牌 RateLimiter rateLimiter = RateLimiter.create(5); 在需要限速的controller(url)处,使用accessLimitService.tryAcquire() 尝试取得令牌

实测每秒会放行六次

测试方法:编写一个并发访问的测试类

Cache: spring boot

在UserServiceImpl 服务中,对需要缓存的返回结果 对应的函数做@Cacheable("users")注解 下次调用该方法是便可直接返回缓存的查找结果

Hateos: org.springframework.boot spring-boot-starter-hateoas

使用linkTo(UserController.class).slash(result.getUserId()).withSelfRel(); 进行add后即可为返回结果添加self 链接

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors