Kim ByeungHyun
build.gradle, @Api, @Slf4j, @ApiOperation 본문
build.gradle 주석 정리
//spring-web and test
implementation 'org.springframework.boot:spring-boot-starter-web'
testImplementation 'org.springframework.boot:spring-boot-starter-test'
//lombok
implementation 'org.projectlombok:lombok'
annotationProcessor("org.projectlombok:lombok")
//jpa
implementation 'org.springframework.boot:spring-boot-starter-data-jpa'
//Switching
//database
//h2
implementation('com.h2database:h2')
//mysql
implementation 'mysql:mysql-connector-java'
// spring-security
testImplementation("org.springframework.security:spring-security-test")
implementation 'org.springframework.boot:spring-boot-starter-security'
// Querydsl 추가
implementation 'com.querydsl:querydsl-jpa'
// JWT Token
implementation 'io.jsonwebtoken:jjwt:0.9.1'
implementation 'org.json:json:20210307'
//MVC
implementation 'org.springframework.boot:spring-boot-starter-thymeleaf'
//Swagger
implementation group: 'io.springfox', name: 'springfox-boot-starter', version: '3.0.0'
@Api
Api가 어떤 역할을 하는 지 표시 |
- 클래스를 Swagger 리소스 대상으로 표시.
- 위에 스웨거 추가 해야함.
@Slf4j
- 로깅에 대한 추상 레이어를 제공하는 인터페이스의 모음이다.
- lombok 라이브러리 있으면 댐.
- 인터페이스를 사용하여 로깅을 구현하게 되면 좋은점은 추후에 필요로 의해 로깅 라이브러리를 변경 할 때 코드의 변경 없이 가능하다는 점이다.
log.trace("가장 디테일한 로그");
log.warn("경고");
log.info("정보성 로그");
log.debug("디버깅용 로그");
log.error("에러",e);
- 로깅 레벨은 (많은 로깅) trace > warn > info > debug > error (적응 로깅) 순이다.
@ApiOperation
- 작업에 대한 간단한 설명을 제공합니다. (120자 미만으로 유지해야한다)
ex)
@ApiOperation(value = "Gets customer by ID")