当前位置:网站首页>Annotation usage meaning
Annotation usage meaning
2022-07-31 03:02:00 【Gerald Peake Shea】
Annotation usage meaning
Explain the separation of front and back ends in terms of layers
Backend
XXApplication Layer
- @SpringBootApplication SpringBoot program entry
// The field in brackets after the annotation is the specified package to [email protected](scanBasePackages = "com.zaofeng.good")
@EnableEurekaClient // Service Provider
@EnableDiscoveryClient // Service Consumer
The difference between @EnableEurekaClient and @EnableDiscoveryClient
- @EnableFeignClients // enable feign clients
- @MapperScan(basePackages = {"com.zaofeng.good.common.mapper", "com.zaofeng.good.service.digiccy.mapper" }) // Function: specify to changeThe package where the interface of the implementation class is located, and then all interfaces under the package will generate corresponding implementation classes after compilation.Add location: add above the Springboot startup class
@MapperScan detailed explanation
- @EnableSwagger2 //Indicates enabling Swagger
Mapper (DAO) layer
- @Repository // Spring has introduced some annotations since version 2.0 to simplify the development of Spring.The @Repository annotation was one of the first to be introduced and is used to identify classes in the data access layer (DAO layer) as Spring Beans.Specifically, just mark the annotation on the DAO class.At the same time, in order for Spring to scan the classes in the classpath and recognize the @Repository annotation, it is necessary to enable the automatic scanning of beans in the XML configuration file, which can be achieved through context:component-scan/.
- @CacheNamespace//Enable L2 cache
@CacheNamespace(implementation = RedisCache.class)
Service(layer)
impl
@Service
@Service Explained@Autowired // Establish connection between Servic and Dao (understanding)
@Autowired Explained@Override // Override method
@Overrid detailed explanation@Transactional
@Transactional(readOnly = true) // read only
Controller (layer)
@Controller
@RestController
The difference between @Controller and @RestController@Autowired // Usually related to Service
@RequestMapping
Details of @RequestMapping@ApiOperation(value = "Exchange List")... // Documentation Comments
@ApiOperation(value = "Exchange List")@ApiImplicitParams({@ApiImplicitParam(name = "pageNum", value = "page number", required = true, dataType = "int", paramType = "path"),@ApiImplicitParam(name = "pageSize", value = "Number of Pens", required = true, dataType = "int", paramType = "path"),@ApiImplicitParam(name = "tbDigiccyExchangeJson", value = "Object JSON format", required = false, dataTypeClass = String.class, paramType = "json")})
Detailed explanation of documentation
before
边栏推荐
- LeetCode简单题之两个数组间的距离值
- 11、Redis实现关注、取消关注以及关注和粉丝列表
- 【C语言】求两个整数m和n的最大公因数和最小公倍数之和一般方法,经典解法
- Software accumulation -- Screenshot software ScreenToGif
- SQALE 是什么
- The modification is not properly placed in the sandbox, causing Apple compatibility issues
- StringJoiner详解
- Crypto Firms Offer Offer To Theft Hackers: Keep A Little, Give The Rest
- 2022牛客多校联赛第四场 题解
- Number 16, top posts
猜你喜欢
Classic linked list OJ strong training problem - fast and slow double pointer efficient solution
Crypto Firms Offer Offer To Theft Hackers: Keep A Little, Give The Rest
【C语言】进制转换一般方法
19. Support Vector Machines - Intuitive Understanding of Optimization Objectives and Large Spacing
YOLOV5学习笔记(二)——环境安装+运行+训练
递归查询单表-单表树结构-(自用)
QML的使用
LeetCode简单题之找到和最大的长度为 K 的子序列
Basic learning about Redis related content
Project (5) - Small target detection tph-yolov5
随机推荐
SonarQube的BUG定义
解析小结—自用
Local area network computer hardware information collection tool
12 磁盘相关命令
php 网站的多语言设置(IP地址区分国内国外)
Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)
【异常】The field file exceeds its maximum permitted size of 1048576 bytes.
SQL injection Less46 (injection after order by + rand() Boolean blind injection)
SQL注入 Less46(order by后的注入+rand()布尔盲注)
JetPack component Databinding
Go 项目实战-获取多级分类下的全部商品
注解用法含义
观察者模式
接口测试关键技术
局域网电脑硬件信息收集工具
CorelDRAW2022精简亚太新增功能详细介绍
什么是分布式锁?实现分布式锁的三种方式
Installation of mysql5.7.37 under CentOS7 [perfect solution]
SQL注入 Less47(报错注入) 和Less49(时间盲注)
【CV项目调试】CUDNN_CONVOLUTION_FWD_SPECIFY_WORKSPACE_LIMIT问题