当前位置:网站首页>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 onlyController (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
边栏推荐
- TCP详解(一)
- JetPack组件Databinding
- SQL注入 Less54(限制次数的SQL注入+union注入)
- 【C语言基础】解决C语言error: expected ‘;‘, ‘,‘ or ‘)‘ before ‘&‘ token
- SQL injection Less54 (limited number of SQL injection + union injection)
- Software accumulation -- Screenshot software ScreenToGif
- Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)
- CentOS7下mysql5.7.37的安装【完美方案】
- 7. List of private messages
- IDEA 注释报红解决
猜你喜欢

CentOS7下mysql5.7.37的安装【完美方案】

工程(五)——小目标检测tph-yolov5

Huawei od dice js
![Installation of mysql5.7.37 under CentOS7 [perfect solution]](/img/ef/a89d8bfd09377dc30034bad99dfd07.png)
Installation of mysql5.7.37 under CentOS7 [perfect solution]

Moxa NPort device flaw could expose critical infrastructure to devastating attack

10 Permission introduction

经典链表OJ强训题——快慢双指针高效解法

10. Redis implements likes (Set) and obtains the total number of likes

Discourse Custom Header Links

10、Redis实现点赞(Set)和获取总点赞数
随机推荐
YOLOV5学习笔记(三)——网络模块详解
try-catch中含return
Modbus on AT32 MCUs
开题报告之论文框架
Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)
The difference between link and @import
11、Redis实现关注、取消关注以及关注和粉丝列表
4、敏感词过滤(前缀树)
CorelDRAW2022 streamlined Asia Pacific new features in detail
LeetCode中等题之分数加减运算
软件积累 -- 截图软件ScreenToGif
图解lower_bound&upper_bound
【C语言】进制转换一般方法
10 权限介绍
经典链表OJ强训题——快慢双指针高效解法
【Android】Room —— SQLite的替代品
YOLOV5 study notes (2) - environment installation + operation + training
分布式系统架构需要解决的问题
学习DAVID数据库(1)
IDEA 注释报红解决