Study/Java
[Spring] 자주 사용하는 spring annotation(@) 정리 (수정 中)
NaChoon
2022. 5. 9. 14:25
728x90
@Controller
- url을 요청 받는 곳
@RestController
- url을 요청 받는 곳
@Service
- Business Logic 구현
@Getter
- Getter Method 자동 생성
@Setter
- Setter Method 자동 생성
@AllArgsConstructor
- 생성자 생성
@Autowired
@Transactional
@PathVariable
- Parameter를 받을 때 사용
- Header(url)의 입력값을 parameter로 받는다.
@RequestBody
- Parameter를 받을 때 사용
- Body(raw / Json)의 입력값을 parameter로 받는다.
@Mapper
- Interface
@SpringBootApplication
- Spring 실행
728x90