当前位置:网站首页>lombok注解@RequiredArgsConstructor的使用
lombok注解@RequiredArgsConstructor的使用
2022-08-04 01:28:00 【不会打字314】
lombok注解@RequiredArgsConstructor的使用
前置说明
lombok 提供了很多的注解 , 但是我们平时使用的主机就是那几个
@Data
@Setter
@Getter
@ToString
…
使用 idea 打开 lombok 的源码包
之前看帖子 , 看见案例使用 @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();
}
}
查看反编译的源码 , 可以通过 idea 直接查看
lectList();
}
}
查看反编译的源码 , 可以通过 idea 直接查看

边栏推荐
猜你喜欢
2022 China Computing Power Conference released the excellent results of "Innovation Pioneer"
MongoDB数据接入实践
What warehouse management problems can WMS warehouse management system solve in the electronics industry?
The 600MHz band is here, will it be the new golden band?
MySQL回表指的是什么
TensoFlow学习记录(二):基础操作
【store商城项目01】环境准备以及测试
nodejs安装及环境配置
typescript56-泛型接口
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
nodejs+express实现数据库mysql的访问,并展示数据到页面上
vxe-table 从页面批量删除数据 (不动数据库里的数据)
typescript48 - type compatibility between functions
通用的测试用例编写大全(登录测试/web测试等)
nodejs+npm的安装与配置
.NET Static Code Weaving - Rougamo Release 1.1.0
电子组装行业对MES管理系统的需求分析
typescript51-泛型的基本使用
MySQL回表指的是什么
哎,又跟HR在小群吵了一架!
互斥锁、读写锁、自旋锁,以及原子操作指令xaddl、cmpxchg的使用场景剖析
114. How to find the cause of Fiori Launchpad routing error by single-step debugging
VR全景拍摄线上展馆,3D全景带你沉浸体验
GNSS[0]- Topic
typescript52-简化泛型函数调用
【OpenCV】-重映射
敏捷交付的工程效能治理
工程制图名词解释-重点知识
js中常用的几种遍历处理数据的方法梳理