SpringBoot註解
一、Controller層
1 | @SpringBoorApplication | springboot啓動註解 |
2 | @configuration | springboot |
3 | @EnableAutoConfiguration | |
4 | @RestController | controller層註解,相當於@ResponseBody和@Controller的組合註解 |
5 | @Controller | controller層註解 |
6 | @ResponseBody | 返回json格式,與@Controller搭配使用 |
7 | @RequestMapping | 請求路徑限制 |
8 | @RequestParam | 讀取請求參數 |
9 |
二、Service層
1 | @Service | service層註解 |
2 | @Autowired | 自動裝配 |
3 | @Resource | 注入對象之間的關係 |
4 | @Value |
三、持久層
@Mapper1 | @Mapper | Dao層註解 |
2 | @Query | |
3 | @Param | |
4 | @Repository
四、表的映射
1 | @Entity | 實體類註解 |
2 | @Table | 表名 |
3 | @Id | 表中的id |
4 | @Transient |