Caffeine缓存-Web应用版
提供web应用缓存配置示例,更多使用方式请参考dawdler-cache-caffeine.
1. 下载并运行
下载示例dawdler-tutorial.zip,版本为jdk1.8.
解压后,进入cache-caffeine-single-web目录中.
配置user_DataSource.properties.
运行UserWebApplication.java的main方法.
@DawdlerBootApplication
public class UserWebApplication {
public static void main(String[] args) throws Throwable {
DawdlerWebApplication.run(UserWebApplication.class, args);
}
}
1.1 项目结构说明
controller -> UserController.java web api的入口
service -> UserService.java 服务接口
service.impl -> UserServiceImpl.java 服务实现层
mapper -> UserMapper.java 数据库操作层
entity -> User.java 实体类
cache.config -> UserCacheConfig 缓存配置类