Spring ์คํ๋ง ๐
application.properties
@RestController : api ๊ฐ ์ ๋ฌ์ ์ฐ์ธ๋ค. / @Controller : ์ฃผ๋ก api๊ฐ ์๋ ์นํ์ด์ง๋ฅผ ์ ๊ณตํ๋๋ฐ์ ์ฐ์ธ๋ค.
public DataDto getAll(@RequestParam DataDto dto) { return dto; }
public DataDTO post(@RequestBody DataDTO dto) { return dto; }
ResponseEntity<T> print(@RequestBody Dto dto) { return ResponseEntity.status(404); }
@JsonNaming(value = PropertyNamingStrategies.SnakeCaseStrategy.class) @JsonInclude(JsonInclude.Include.NON_NULL) @JsonProperty("์คํ")
ObjectMapper ๐
์ถ๊ฐ ์ค ๐ง
๋ชฐ๋๋ธ ๊ฐ์ mockito ํ์ ๐ธ๐
Mockito ์์ ๋ชฉํน์ ์ฌ์ฉ๋๋ ArgumentCaptor ํด๋์ค๋ ์ด๋ฆ์์ ๋ณผ ์ ์๋ฏ์ด ๋ฉ์๋์ ๋งค๊ฐ๋ณ์๋ฅผ ๋ถ์ก์ ๊ฒ์ฆํ๋๋ฐ ์ฌ์ฉํ๋ค.
์์๊ด๊ณ์ ์๋ ํด๋์ค์ ๋ํด builder ํจํด ์ ์ฉ์ ์ํผ๋น๋ ์ด๋ ธํ ์ด์ ์ฌ์ฉ
๋ค์์ ๋ค์ ์ ๋ฆฌํด๋ณด๊ธฐ๋ก ๋ค์ง..๐
๋ฐ์ดํฐ ์์์ฑ์ ๊ด๋ฆฌํ๋ Object Relation Mapper
application-SECRET.properties
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE) LocalDate date
@Transactional
yml: key: value: ์คํธ๋ผ
StringUtils.getFilenameExtension(file.getOriginalFilename())
์ด๋ฏธ์ง ํ์ผ ์์น : /resources/static/imgs
๊ฐ์ ๋ฐ๋ก ์ถ๋ ฅํ ๋๋ ' ' ๋ก ํ๋ฒ ๋ ๊ฐ์ธ๊ธฐ
spring.datasource.driver-class-name / url / username / password
@Mapper
๋ฐ์ดํฐ ์ฃผ์ํด์ ์ฝ๊ฒ ๊ฐ์ ธ์ค๊ธฐ
ํธํ๊ฒ ์ธ ๋ ๊น์ง ๊ณ์ ์ฝ์ด๋ณด๊ธฐ ๐ฌ
spring-boot-starter-validation
๐ข
@RestControllerAdvice + @ExceptionHandler
์๋ต/์์ฒญ์ ํด๋ผ์ด์ธํธ์ ์ ์ผ ๊ทผ์ ํ ๊ณณ์์ ํ์ธ ํ๋ ค๋ฉด Filter ์ด์ฉ
๋ณ์ ์ถ๋ ฅ : Log.info(" 1 : {} , 2 : {} " , user , drink );
@Scheduled(cron = "0 0 0 * * FRI") public void ohyeah() { }
HandlerInterceptor , WebMvcConfigurer
Spring ์์ ๋น๋๊ธฐ ๊ฒฝํํด๋ณด๊ธฐ ๐ข
RestTemplate ์ฌ์ฉํด์ local Server to local Server ์์ฒญ / ์๋ต ๋ฐ์ดํฐ ๋ค๋ค๋ณด๊ธฐ
์ธ๋ถ api์ ๊ฐ ์์ฒญํด๋ณด๊ธฐ
mockaroo.com ์ด์ฉ
h2 DB
@EntityListener(value = MyListener.class) , @PrePersist , @PreUpdate , @PreRemove
@OneToOne(optional = false) || @OneToOne(mappedBy = "this์ํฐํฐ") @ToString.exclude
@OneToMany : A ํ ์ด๋ธ์ B ํ ์ด๋ธ ๋ฐ์ดํฐ ์ฌ๋ฌ๊ฐ
thymeleaf , enum , @modelAttribute , model.attibute( ) , th:object , th:field , th:value , th:for
warning ์ก์์ผ๋จ
๋งํฌ๋ง ์์ --> https://dev-gorany.tistory.com/139 , https://recordsoflife.tistory.com/1438
(๋งํฌ) spring boot devtools --> https://velog.io/@bread_dd/Spring-Boot-Devtools
(๋งํฌ) hibernate SQL ์ฟผ๋ฆฌ ๋ณด๊ธฐ ์ต์ --> https://zzang9ha.tistory.com/399
๋งํฌ๋ง ์์ --> https://ifuwanna.tistory.com/200
๐
์ ๋ฆฌ ์ ๋์ด์๋ ๋งํฌ : https://ykh6242.tistory.com/entry/JPA-OSIVOpen-Session-In-View%EC%99%80-%EC%84%B1%EB%8A%A5-%EC%B5%9C%EC%A0%81%ED%99%94
Spring Data JPA N+1 ๋ฌธ์ ์ ๋ํ ๋งํฌ --> https://programmer93.tistory.com/83
kakao ๐ซ
swagger ui ๐
Spring Security Cross Site Request Forgery --> https://tlatmsrud.tistory.com/77
Spring Data Rest (+ Projection) --> https://supawer0728.github.io/2018/03/20/spring-data-rest/
๐๏ธใ
๐ณ Docker๊ฐ ์คํ์ค์ธ์ง ํ์ธ ํ ํ์ ํ ์คํธ ์คํ
๋๋ฅด๋ง๋ฌด ๋๋ฅด๋ง๋ฌด ๐ง
server.servlet.context-path=/context/path
ใ
ใ
๊ฐ๋ฒผ์ด ๋ฐ์ดํฐ๋ฅผ ๋ค๋ฃฐ๋ ์ ์ฉํ ๊ฒ ๊ฐ๋ค.
ใ
๋ค๋์ ์ง์๋ฌธ ํ๋ฒ์ ๋ ๋ฆฌ๊ธฐ ๐ฌ
https://n1tjrgns.tistory.com/266
ใ
java -Dํค="๊ฐ" -jar ./jar์์น
https://velog.io/@hosunghan0821/Spring-spring-data-envers
https://jhkimmm.tistory.com/29
ํ๊ฒฝ๋ณ์ ์ ๋ ฅ์ ์ ๋ ฅ ํ๋ ์ ํ์ธํ๊ณ ์ ๋ ฅ
https://forkyy.tistory.com/10
https://monny.tistory.com/264
https://devocean.sk.com/blog/techBoardDetail.do?ID=163499
https://ittrue.tistory.com/233
https://programforlife.tistory.com/107
https://greeng00se.tistory.com/130
ใ
ใ
https://colabear754.tistory.com/99
ใ
ใ
ใ
ใ
https://sabarada.tistory.com/127
๐ฅธ
https://boomrabbit.tistory.com/255
https://m.blog.naver.com/sthwin/222131873998
https://gisungcu.tistory.com/415?category=1081268
https://tansfil.tistory.com/59?category=255594
https://s-core.co.kr/insight/view/spring-cloud-gateway-๊ธฐ๋ฐ์-api-๊ฒ์ดํธ์จ์ด-๊ตฌ์ถ/
server.port=0
ใ
https://jongmin4943.tistory.com/entry/Spring-Security-6-hasIpAddress-์ฌ์ฉํ๋๋ฒ
https://www.inflearn.com/questions/794221/comment/244600
https://mangkyu.tistory.com/253
https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#_encryption_and_decryption