当前位置:网站首页>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
边栏推荐
- 2022 Nioke Multi-School League Game 4 Solution
- 工程(五)——小目标检测tph-yolov5
- LeetCode简单题之找到和最大的长度为 K 的子序列
- The difference between link and @import
- 编译Hudi
- 11. Redis implements follow, unfollow, and follow and follower lists
- 共模电感的仿真应用来了,满满的干货送给大家
- 【Cocos Creator 3.5】缓动系统停止所有动画
- SonarQube的BUG定义
- 你们程序员为什么不靠自己的项目谋生?而必须为其他人打工?
猜你喜欢

公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部

Mycat's master-slave relationship, vertical sub-database, horizontal sub-table, and detailed configuration of mycat fragmented table query (mysql5.7 series)

TCP详解(三)

7. List of private messages

你们程序员为什么不靠自己的项目谋生?而必须为其他人打工?

分布式与集群是什么 ? 区别是什么?

字体压缩神器font-spider的使用

StringJoiner in detail

QML的使用

8. Unified exception handling (controller notifies @ControllerAdvice global configuration class, @ExceptionHandler handles exceptions uniformly)
随机推荐
工程(五)——小目标检测tph-yolov5
f.grid_sample
SQL注入 Less54(限制次数的SQL注入+union注入)
Mysql 45讲学习笔记(二十五)MYSQL保证高可用
11、Redis实现关注、取消关注以及关注和粉丝列表
公司官网建站笔记(六):域名进行公安备案并将备案号显示在网页底部
How to build a private yum source
分布式与集群是什么 ? 区别是什么?
YOLOV5 study notes (2) - environment installation + operation + training
6. Display comments and replies
C primer plus学习笔记 —— 8、结构体
遗留系统的自动化策略
分布式系统架构需要解决的问题
WebSocket Session为null
CloudCompare&PCL 计算两个点云之间的重叠度
4. Sensitive word filtering (prefix tree)
【Android】Room —— SQLite的替代品
共模电感的仿真应用来了,满满的干货送给大家
8. Unified exception handling (controller notifies @ControllerAdvice global configuration class, @ExceptionHandler handles exceptions uniformly)
观察者模式