当前位置:网站首页>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 直接查看

边栏推荐
猜你喜欢

5.scrapy中间件&分布式爬虫

typescript50 - type specification between cross types and interfaces

Jmeter cross-platform operation CSV files

MongoDB数据接入实践

What warehouse management problems can WMS warehouse management system solve in the electronics industry?

typescript58-泛型类

The 600MHz band is here, will it be the new golden band?

nodejs installation and environment configuration

typescript54 - generic constraints

typescript53-泛型约束
随机推荐
typescript52-简化泛型函数调用
GNSS【0】- 专题
Summary of GNSS Articles
如何通过API接口从淘宝(或天猫店)复制宝贝到拼多多接口代码对接教程
typescript57-数组泛型接口
Web3 security risks daunting?How should we respond?
Array_Sliding window | leecode brushing notes
阿里云技术专家邓青琳:云上跨可用区容灾和异地多活最佳实践
《The Google File System》新说
循环绕过问题
VR全景拍摄线上展馆,3D全景带你沉浸体验
typescript55 - generic constraints
nodejs installation and environment configuration
特征值与特征向量
Promise 解决阻塞式同步,将异步变为同步
nodejs+express realizes the access to the database mysql and displays the data on the page
快速入门EasyX图形编程
持续投入商品研发,叮咚买菜赢在了供应链投入上
typescript53-泛型约束
WMS仓储管理系统能解决电子行业哪些仓库管理问题