[Spring Cloud] Eureka Registered instance ์ œ๊ฑฐํ•˜๊ธฐ
ยท
Backend/Spring Boot
โ“ ๋ฌธ์ œ ์ƒํ™ฉ  Spring Cloud Gateway Service๋กœ ์—ฐ๊ฒฐํ–ˆ์„ ๋•Œ ์—ฐ๊ฒฐ์ด localhost๋กœ ๋˜์—ˆ๋‹ค๊ฐ€ ์„œ๋น„์Šคํ•˜๊ณ  ์žˆ๋Š” host๋กœ ์—ฐ๊ฒฐ์ด ๋˜์—ˆ๋‹ค๊ฐ€ ํ–ˆ๋‹ค.. Eureka Service url๋กœ ๋“ค์–ด๊ฐ€์„œ Eureka์— ๋“ฑ๋ก๋œ ์•ฑ๊ณผ ์ธ์Šคํ„ด์Šค๋“ค์„ ํ™•์ธํ•˜๋‹ˆ ํ•œ ์•ฑ์— ์—ฌ๋Ÿฌ ์ธ์Šคํ„ด์Šค๋“ค์ด ๋“ฑ๋ก๋˜์–ด ์žˆ์—ˆ๋‹ค. ๋งˆ์ดํฌ๋กœ์„œ๋น„์Šค๋“ค์„ Eureka Discovery Service ์„œ๋ฒ„์— ์—ฐ๊ฒฐํ•œ์ฑ„๋กœ ์“ฐ๋‹ค๊ฐ€ ํ•œ ์„œ๋ฒ„์— ์—ฌ๋Ÿฌ ๊ฐœ์˜ ์ธ์Šคํ„ด์Šค๋“ค์ด ์ƒ์„ฑ๋˜์—ˆ๋‹ค. ์„œ๋น„์Šค๊ฐ€ ์ฃฝ์—ˆ์Œ์—๋„ DOWN์ด ๋˜์ง€ ์•Š์•˜๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด ์ง์ ‘ ์ˆ˜๋™์œผ๋กœ ์ธ์Šคํ„ด์Šค๋ฅผ ๋‚ด๋ ค์•ผ ํ•˜๋Š”๋ฐ ์•„๋ฌด๋ฆฌ ๊ตฌ๊ธ€๋งํ•ด๋„ ๋‚ด๋ฆฌ๋Š” ๋ฐฉ๋ฒ•์„ ์ฐพ๊ธฐ๊ฐ€ ์–ด๋ ค์› ๋‹ค.         ๐Ÿ’ก ํ•ด๊ฒฐChatGPT์—๊ฒŒ ๋ฌผ์–ด์™”๋‹ค!    SpringApplication.java@SpringBootApplic..
[Infra] Jenkins ์ปจํ…Œ์ด๋„ˆ ์•ˆ Docker ์„ค์น˜ํ•˜๊ธฐ(Docker In Docker)
ยท
Infra
๐Ÿ’ป ๋ฌธ์ œJenkins๋ฅผ Docker๋กœ ์„ค์น˜๋ฅผ ํ•ด์„œ ๋‚ด๋ถ€์—์„œ ๋„์ปค๋กœ ์‹คํ–‰์‹œํ‚ค๊ณ  ์‹ถ์—ˆ๋‹ค. (Docker In Docker)  ํ•˜์ง€๋งŒ ์ฒ˜์Œ์— ์ด๋ ‡๊ฒŒ Jenkins๋ฅผ ์„ค์น˜ํ–ˆ๋‹ค๊ฐ€ ๋ฌด์ˆ˜ํ•œ ์‚ฝ์งˆ์„ ํ•˜๊ฒŒ ๋˜์—ˆ๋‹ค. sudo docker run -d --name jenkins -p 8080:8080 jenkins/jenkins:jdk11  1. Jenkins๋ฅผ ์‹คํ–‰ํ–ˆ์„ ๋•Œ, ๋‚ด๋ถ€์— ๋„์ปค๊ฐ€ ์„ค์น˜๋˜์–ด ์žˆ์ง€ ์•Š์•„์„œ Docker ๋ช…๋ น์–ด๋ฅผ ์‹คํ–‰ํ•  ์ˆ˜ ์—†์—ˆ๋‹ค.2. ๊ทธ๋ž˜์„œ Jenkins ์•ˆ์— Docker๋ฅผ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ–ˆ๋”๋‹ˆ root๋กœ ์ ‘์†ํ•˜๋ผ๊ณ  ํ•œ๋‹ค.3. ๊ทธ๋ž˜์„œ root๋กœ ์ ‘์†ํ•ด์„œ ์„ค์น˜ํ•˜๋ ค๊ณ  ํ–ˆ๋”๋‹ˆ cli๋กœ ์„ค์น˜๊ฐ€ ์•ˆ๋œ๋‹ค๊ณ  ํ•œ๋‹ค.     ๐Ÿ”Ž ์›์ธ1) ๋„์ปค ์ปจํ…Œ์ด๋„ˆ ๋‚ด๋ถ€์—์„œ ๋„์ปค๋กœ ์‹คํ–‰์‹œํ‚ค๋ ค๋ฉด, ๋„์ปค ์†Œ์ผ“์œผ๋กœ ์—ฐ๊ฒฐํ•ด์•ผ ํ•œ๋‹ค.  * ..
ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค - ์ฃผ์ฐจ ์š”๊ธˆ ๊ณ„์‚ฐ
ยท
Algorithm/ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค
https://school.programmers.co.kr/learn/courses/30/lessons/92341 ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค ์ฝ”๋“œ ์ค‘์‹ฌ์˜ ๊ฐœ๋ฐœ์ž ์ฑ„์šฉ. ์Šคํƒ ๊ธฐ๋ฐ˜์˜ ํฌ์ง€์…˜ ๋งค์นญ. ํ”„๋กœ๊ทธ๋ž˜๋จธ์Šค์˜ ๊ฐœ๋ฐœ์ž ๋งž์ถคํ˜• ํ”„๋กœํ•„์„ ๋“ฑ๋กํ•˜๊ณ , ๋‚˜์™€ ๊ธฐ์ˆ  ๊ถํ•ฉ์ด ์ž˜ ๋งž๋Š” ๊ธฐ์—…๋“ค์„ ๋งค์นญ ๋ฐ›์œผ์„ธ์š”. programmers.co.kr ๐Ÿ“‘ ๋ฌธ์ œ ์š”์•ฝ ์ž…๋ ฅ ์ž…๋ ฅ๊ฐ’ : ์ฃผ์ฐจ ์š”๊ธˆํ‘œ(fees), ์ฐจ๋Ÿ‰์˜ ์ž…์ฐจ/์ถœ์ฐจ ๊ธฐ๋ก(records) ์˜ˆ์‹œ fees [180, 5000, 10, 600] : ๊ธฐ๋ณธ ์‹œ๊ฐ„(๋ถ„), ๊ธฐ๋ณธ ์š”๊ธˆ(์›), ๋‹จ์œ„ ์‹œ๊ฐ„(๋ถ„), ๋‹จ์œ„ ์š”๊ธˆ(์›) records ["05:34 5961 IN", "06:00 0000 IN", "06:34 0000 OUT", "07:59 5961 OUT", "07:59 0148 IN", "18:..
[Spring] Spring Boot์— QueryDSL ๋„์ž…๊ธฐ
ยท
Backend/Spring Boot
์ผ๋ฐ˜์ ์œผ๋กœ Spring Boot ํ™˜๊ฒฝ์—์„œ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๋ฐ, Spring Data JPA๊ฐ€ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋ณธ CRUD  ๋ฉ”์†Œ๋“œ์™€ Named Query ๋ฉ”์†Œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜๊ฒŒ ๋œ๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์•ˆ๋˜๋Š” ๊ฒฝ์šฐ๋Š” JPQL์ด๋‚˜ Native Query๋กœ ์ž‘์„ฑํ•˜๊ฒŒ ๋œ๋‹ค. ํ•˜์ง€๋งŒ ๋ณต์žกํ•œ ์ฟผ๋ฆฌ ๋กœ์ง์„ ๊ฐ€์ง„ ๊ฒฝ์šฐ์—๋Š” ๋ฉ”์†Œ๋“œ๋‚˜ ์ฟผ๋ฆฌ๋ฌธ์ด ๊ธธ์–ด์ ธ์„œ ๊ฐ€๋…์„ฑ์ด ๋–จ์–ด์ง€๊ฒŒ ๋œ๋‹ค. ํŠนํžˆ Paging์ด๋‚˜ Sorting์„ ๊ตฌํ˜„ํ•˜๊ฒŒ ๋  ๊ฒฝ์šฐ, ๊ตฌํ˜„์ด ๋ณต์žกํ•ด์ง€๊ฒŒ ๋œ๋‹ค.     ๐Ÿšจ ๋ฌธ์ œ ์ƒํ™ฉ ๋‚˜์˜ ๊ฒฝ์šฐ์—๋„ ์ด์ „ ํ”„๋กœ์ ํŠธ๊นŒ์ง€ Spring Data JPA๊ฐ€ ๊ธฐ๋ณธ์ ์œผ๋กœ ์ œ๊ณตํ•˜๋Š” CRUD ๋ฉ”์†Œ๋“œ์™€ Named Query๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ๊ฐ€์ ธ์˜ค๋Š” ๋กœ์ง์„ ๊ตฌํ˜„ํ–ˆ์—ˆ๊ณ , ์กฐ๊ธˆ ๋” ๋ณต์žกํ•œ ์ฟผ๋ฆฌ์˜ ๊ฒฝ์šฐ์—๋Š” ๊ฐ€๋…์„ฑ์€ ์กฐ๊ธˆ์€ ๋–จ์–ด์ง€์ง€๋งŒ Native Query๋กœ ๋ณ„ ๋ฌธ์ œ์—†์ด ๊ตฌํ˜„์„..
[ํ”„๋กœ์ ํŠธ ํšŒ๊ณ ] 2์ฐจ ํ”„๋กœ์ ํŠธ๋ฅผ ๋งˆ์น˜๋ฉฐ
ยท
Project
6์ฃผ ๊ฐ„, 2023.2.27 ~ 2023.4.7 ๊ธฐํš๋ถ€ํ„ฐ ์„ค๊ณ„, ๊ฐœ๋ฐœ, ๋ฐœํ‘œ๊นŒ์ง€ ํŒ€ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ–ˆ๋‹ค. ๋‘ ๋ฒˆ์งธ๋กœ ์ง„ํ–‰ํ•œ ํ”„๋กœ์ ํŠธ์˜€์ง€๋งŒ ์ฒซ ๋ฒˆ์งธ์™€๋Š” ๋งŽ์ด ๋‹ฌ๋ž๋‹ค.  ์šฐ์„  ๊ฐœ๋ฐœ์ ์œผ๋กœ๋Š” ํŒ€์ด ์„ ํƒํ•œ ํŠธ๋ž™์— ๋งž๋Š” '๋น…๋ฐ์ดํ„ฐ ๋ถ„์‚ฐ' ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ•ด์•ผ ํ–ˆ์—ˆ๋‹ค๋Š” ์ ์—์„œ ๊ธฐํš๊ณผ ๊ธฐ์ˆ ์  ์ œ์•ฝ ๋•Œ๋ฌธ์— ๋‚œ์ด๋„๊ฐ€ ๋†’์•˜๋‹ค. ๊ทธ๋ฆฌ๊ณ  ์ฒซ ๋ฒˆ์งธ ํ”„๋กœ์ ํŠธ ๋๋‚˜์ž๋งˆ์ž ๋ฐ”๋กœ ๋‘ ๋ฒˆ์งธ ํ”„๋กœ์ ํŠธ์— ํˆฌ์ž…์ด ๋˜์–ด์„œ ์ฒด๋ ฅ์ ์œผ๋กœ๋„ ์ง€์ณค์—ˆ๋‹ค. ์ด ๋‘ ๊ฐ€์ง€ ์š”์ธ์ด ํ•ฉ์ณ์ ธ์„œ ํž˜๋“ค๊ฒŒ ํ”„๋กœ์ ํŠธ๋ฅผ ์ง„ํ–‰ํ–ˆ๋‹ค.  ์„ธ๋ฒˆ์งธ ํ”„๋กœ์ ํŠธ์— ๋ฐ”๋กœ ๋“ค์–ด๊ฐ€๊ฒŒ ๋˜์–ด์„œ ๋ฐ”๋น ์ง€๊ธฐ ์ „์—, ๊ทธ๋ฆฌ๊ณ  ์žŠ์–ด๋ฒ„๋ฆฌ๊ธฐ ์ „์— ์ง€๋‚œ 6์ฃผ ๊ฐ„์˜ ํ”„๋กœ์ ํŠธ ๊ณผ์ •์„ ๋Œ์•„๋ณด๊ณ ์ž ํ•œ๋‹ค. (๐Ÿฅ•์‰ฌ๊ณ  ์‹ถ์–ด์š”..๐Ÿฅ•)     ๐Ÿ“ข ํ”„๋กœ์ ํŠธ ์†Œ๊ฐœํ”„๋กœ์ ํŠธ ์ธ์› : 6๋ช… (ํ”„๋ก ํŠธ์—”๋“œ 2๋ช…, ๋ฐฑ์—”๋“œ 4๋ช… (๋ฐฑ์—”๋“œ 1..
[Spring] TypeError: Failed to execute 'fetch' on 'Window' : Request with GET/HEAD method cannot have body.
ยท
Backend/Spring Boot
Swagger์—์„œ API๋ฅผ ํ…Œ์ŠคํŠธํ•˜๋Š”๋ฐ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ๋‹ค!     ๐Ÿ’ป ์—๋Ÿฌ ๋ฉ”์‹œ์ง€Failed to execute 'fetch' on 'Window' : Request with GET/HEAD method cannot have body.     ๐Ÿ”Ž ์›์ธGet ๋ฐฉ์‹์œผ๋กœ RequestBody๋กœ ๋ณด๋‚ด๋ ค๊ณ  ํ–ˆ๋˜ ๊ฒƒ์ด ์›์ธ์ด์—ˆ๋‹ค. ์•„๋ฌด ์ƒ๊ฐ์—†์ด ์กฐํšŒ๋‹ˆ๊นŒ Get๋ฐฉ์‹์œผ๋กœ ํ•ด์•ผ์ง€~ ํ–ˆ๋‹ค.. @GetMapping("/one") public ResponseEntity list(@RequestBody TicketReq ticketReq) { try { List list = ticketService.getTicketList(ticketReq); if (list != nul..
giraffe_
'๋ถ„๋ฅ˜ ์ „์ฒด๋ณด๊ธฐ' ์นดํ…Œ๊ณ ๋ฆฌ์˜ ๊ธ€ ๋ชฉ๋ก (12 Page)