当前位置:网站首页>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
边栏推荐
猜你喜欢

LeetCode简单题之两个数组间的距离值

学习DAVID数据库(1)

Graphical lower_bound & upper_bound

SQL injection Less54 (limited number of SQL injection + union injection)

Local area network computer hardware information collection tool

JS 函数 this上下文 运行时点语法 圆括号 数组 IIFE 定时器 延时器 self.备份上下文 call apply

SQL注入 Less46(order by后的注入+rand()布尔盲注)

Software accumulation -- Screenshot software ScreenToGif

The whole process scheduling, MySQL and Sqoop

mycat的主从关系 垂直分库 水平分表 以及mycat分片联表查询的配置详解(mysql5.7系列)
随机推荐
Graphical lower_bound & upper_bound
分布式系统架构需要解决的问题
编译Hudi
TCP详解(一)
【C语言基础】解决C语言error: expected ‘;‘, ‘,‘ or ‘)‘ before ‘&‘ token
【Android】Room —— SQLite的替代品
Mathematics to solve the problem - circular linked list
JS function this context runtime syntax parentheses array IIFE timer delay self.backup context call apply
C primer plus学习笔记 —— 8、结构体
[C language foundation] Solve C language error: expected ';', ',' or ')' before '&' token
How to build a private yum source
YOLOV5 study notes (3) - detailed explanation of network module
The difference between link and @import
Chapter 9 SVM Practice
SonarQube的BUG定义
CMOS和TTL的区别?
Compile Hudi
Unity3D Button 鼠标悬浮进入与鼠标悬浮退出按钮事件
Unity3D Button mouse hover enter and mouse hover exit button events
【C语言】预处理操作