Spring Boot常用注解
没有解释各个注解是希望能够第一时间想起来他们所对应的功能以及用途
-
@SpringBootApplication
-
@RestController
-
@RequestMapping
-
@RequestParam(name = “”, defaultValue = “” , required = true/false )
-
@DataTimeFormat( pattern = " " )
-
@RequestBody
-
@PathVariable
-
@Component
- @Controller
- @Service
- @Repository
-
@Autowired
- @Qualifier
-
@Primary
-
@Resource( name = “” )
-
@ComponentScan
-
@Mapper
- @Select()
- @Delete()
- @Update()
- @Insert()
-
@Test
-
Lombok
- @Data
- @AllArgsConstructor
- @NoArgsConstructor
-
@Slf4j
-
@CrossOrigin(origins = “”)
-
@Value(${“配置文件中的key”})
-
@ConfigurationProperties(prefix = “”)
- @Data
- @Component
-
@Bean
-
@Import
- ImportSelector -> 接口
-
@Conditional
- @ConditionalOnProperty
- @ConditionalMissingBean
- @ConditionalOnClass
JWT令牌:
生成JWT令牌:
校验 JWT令牌: