当前位置:网站首页>Use of lombok annotation @RequiredArgsConstructor
Use of lombok annotation @RequiredArgsConstructor
2022-08-04 01:32:00 【Can't type 314】
lombok注解@RequiredArgsConstructor的使用
前置说明
lombok 提供了很多的注解 , But those are the hosts we usually use
@Data
@Setter
@Getter
@ToString
…
使用 idea 打开 lombok 的源码包
之前看帖子 , see case use @RequiredArgsConstructor 进行依赖注入
于是测试一下
测试案例
HelloController.java
使用@RequiredArgsConstructor依赖注入
@RestController
@RequiredArgsConstructor
public class HelloController {
final StringRedisTemplate stringRedisTemplate;
@RequestMapping("/hello")
public Map hello() {
stringRedisTemplate.opsForValue().set("k1", "v1");
Map<String, String> result = new HashMap<>();
result.put("hello", "world");
return result;
}
final PersonDao personDao;
@GetMapping("/ssm")
public List<PersonEntity> listPerson() {
return personDao.selectList();
}
}
Check out the decompiled source code , 可以通过 idea 直接查看
lectList();
}
}
Check out the decompiled source code , 可以通过 idea 直接查看

边栏推荐
- Analysis: What makes the Nomad Bridge hack unique
- nodejs切换版本使用(不需要卸载重装)
- typescript54 - generic constraints
- typescript57-数组泛型接口
- 工程制图复习题
- jmeter跨平台运行csv等文件
- ASP.NET 获取数据库的数据并写入到excel表格中
- Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
- 电子组装行业对MES管理系统的需求分析
- Apache DolphinScheduler新一代分布式工作流任务调度平台实战-中
猜你喜欢
随机推荐
Please refer to dump files (if any exist) [date].dump, [date]-jvmRun[N].dump and [date].dumpstream.
Slipper —— 虚点,最短路
Array_Sliding window | leecode brushing notes
静态文件快速建站
字符串的排列
LDO investigation
谁说程序员不懂浪漫,表白代码来啦~
GNSS【0】- 专题
Slipper - virtual point, shortest path
MongoDB数据接入实践
阿里云技术专家邓青琳:云上跨可用区容灾和异地多活最佳实践
.NET Static Code Weaving - Rougamo Release 1.1.0
jmeter分布式压测
typescript58-泛型类
Electronics manufacturing enterprise deployment WMS what are the benefits of warehouse management system
Vant3 - click on the corresponding name name to jump to the next page corresponding to the location of the name of the TAB bar
优秀的测试/开发程序员,是怎样修炼的?步步为营地去执行......
持续投入商品研发,叮咚买菜赢在了供应链投入上
【Untitled】
【正则表达式】笔记