以下为SpringBoot入门级别常用注解,务必熟悉其特性及使用场景
1. Spring
IOC
- @Service
- @Resource
- @Autowired
- @Component
- @Configuration
- @Bean
- @Primary
- @Qualifier
- @Value
- @PropertySource
AOP
- @Aspect
- @Pointcut
- @Before
- @After
- @AfterThrowing
- @AfterReturning
- @Around
- @SuppressAjWarnings
其他
@Transactional
@MapperScan
@ComponentScan
@ControllerAdvice
@ExceptionHandler
@Target({ElementType.METHOD, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
2. SpringMVC
- @RequestMapping
- @RequestParam
- @PathVariable
- @RequestBody
3. SpringBoot
@SpringBootApplication
@RestController
@GetMapping
@PostMapping
@PutMapping
@DeleteMapping
@ConfigurationProperties