λ°˜μ‘ν˜•

Framework 86

[React] κΈ°μ‘΄ λ°μ΄ν„°μ—μ„œ API Fetching ν›„(더보기 λ²„νŠΌ 클릭 ν›„) μƒˆλ‘œ 뢈러온 데이터 ν•©μΉ˜λŠ” 방법 / 더보기 λ²„νŠΌ νŽ˜μ΄μ§€λ„€μ΄μ…˜

Intro μ•ˆλ…•ν•˜μ„Έμš”. 이번 μ‹œκ°„μ—λŠ” Reactμ—μ„œ κΈ°μ‘΄ λ°μ΄ν„°μ—μ„œ 더보기 λ²„νŠΌ 클릭 ν›„ μƒˆλ‘œ 뢈러온 데이터 ν•©μΉ˜λŠ” 방법에 λŒ€ν•΄ μ•Œμ•„λ³΄κ² μŠ΅λ‹ˆλ‹€. 곡지사항 λͺ©λ‘ 쑰회 κΈ°λŠ₯을 κ΅¬ν˜„ν•˜λ˜ 도쀑 λ¦¬μŠ€νŠΈκ°€ λ§Žμ•„μ§ˆ 수 μžˆμ„ 것 κ°™μ•„ 더보기 λ²„νŠΌ UIλ₯Ό μΆ”κ°€ν•˜κΈ°λ‘œ κ²°μ •ν–ˆμŠ΅λ‹ˆλ‹€. 참고둜 APIλŠ” μŠ€ν”„λ§λΆ€νŠΈμ˜ Pageable λ₯Ό μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€. 즉 κΈ°μ‘΄ λ°μ΄ν„°μ—μ„œ 더보기 λ²„νŠΌ UIλ₯Ό 클릭할 λ•Œλ§ˆλ‹€ page κ°€ +1 μ”© μ¦κ°€ν•˜λ©΄μ„œ μƒˆλ‘œ 뢈러온 데이터λ₯Ό 화면에 λ³΄μ—¬μ€˜μ•Ό ν–ˆμŠ΅λ‹ˆλ‹€. How to implement μ•„λž˜μ™€ 같이 NoticeList μ»΄ν¬λ„ŒνŠΈκ°€ μžˆλ‹€κ³  κ°€μ •ν•΄λ΄…μ‹œλ‹€. fetchNoticeλΌλŠ” ν•¨μˆ˜λ₯Ό 뢈러올 λ•Œλ§ˆλ‹€, κΈ°μ‘΄ 데이터에 μƒˆλ‘œ λΆˆλ €μ§„ 데이터λ₯Ό μΆ”κ°€ν•΄μ€˜μ•Ό ν•©λ‹ˆλ‹€. ν•˜μ§€λ§Œ μœ„ μ½”λ“œμ—μ„œλŠ” μƒˆλ‘œ λΆˆλ €μ§„ λ°μ΄ν„°λ§Œμ„ setN..

Framework/React 2023.02.11

[Springboot] JPA Projection ν”„λ‘œμ μ…˜ ν•˜λŠ” 방법

Intro μ•ˆλ…•ν•˜μ„Έμš”. 이번 μ‹œκ°„μ—λŠ” Springboot μŠ€ν”„λ§λΆ€νŠΈ JPAμ—μ„œ ν”„λ‘œμ μ…˜ ν•˜λŠ” 방법에 λŒ€ν•΄ μ•Œμ•„λ³΄κ² μŠ΅λ‹ˆλ‹€. Projection? λ¨Όμ € 듀어가기에 μ•žμ„œ κ°„λ‹¨ν•˜κ²Œ ν”„λ‘œμ μ…˜μ— λŒ€ν•œ 의미λ₯Ό μ‚΄νŽ΄λ³Όκ²Œμš”. ν”„λ‘œμ μ…˜μ€ μ—”ν‹°ν‹°μ˜ 속성이 λ§Žμ„ λ•Œ 일뢀 λ°μ΄ν„°λ§Œ κ°€μ Έμ˜€λŠ” 방법을 μ˜λ―Έν•©λ‹ˆλ‹€. 더 μžμ„Έν•œ λ‚΄μš©μ΄ κΆκΈˆν•˜μ‹œλ©΄ 일전에 μ œκ°€ 정리해놓은 ν¬μŠ€νŒ… μ°Έκ³  λ°”λžλ‹ˆλ‹€ :) [MongoDB] ν”„λ‘œμ μ…˜ (Projection) μ΄λž€? projection query μ‚¬μš©λ²• How to do μ•„λž˜μ˜ User domain 객체λ₯Ό μ°Έκ³ ν•˜μ—¬ μ„€λͺ…ν•΄λ³΄κ² μŠ΅λ‹ˆλ‹€. @Document(collection = "user") class User( val userId: String?, val userName: String?, val user..

[Springboot] Postman Rest API μš”μ²­ Getting not supported media type error / 415 Unsupported MediaType

Intro μ•ˆλ…•ν•˜μ„Έμš”. μŠ€ν”„λ§λΆ€νŠΈμ—μ„œ Api ν…ŒμŠ€νŠΈλ₯Ό ν•˜κΈ° μœ„ν•΄ postman 을 μ‚¬μš©ν•˜λ˜ 도쀑 λ‹€μŒμ˜ μ• λŸ¬κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. 415 Unsupported MediaType 참고둜, μ €λŠ” 컨트둀러 λ‹¨μ—μ„œ @PostMappingκ³Ό @RequestBody μ–΄λ…Έν…Œμ΄μ…˜μ„ μ‚¬μš©ν–ˆκ³ , Put μš”μ²­μœΌλ‘œ μ•„λž˜ λ‚΄μš©μ„ 전달해 μ—…λ°μ΄νŠΈλ₯Ό μ‹œμΌœμ€˜μ•Ό ν–ˆμŠ΅λ‹ˆλ‹€. { "isOwner": true, "isStaff": false, } Why? μ§€μ›ν•˜μ§€ μ•ŠλŠ” λ―Έλ””μ–΄ νƒ€μž…μ΄λΌλŠ” μ˜λ―Έμž…λ‹ˆλ‹€. μ†ŒμŠ€ μžμ²΄μ— λ¬Έμ œκ°€ μžˆλŠ” 쀄 μ•Œκ³ , μ—΄μ‹¬νžˆ ꡬ글링 ν–ˆμ§€λ§Œ λ¬Έμ œλŠ” λ”°λ‘œ μžˆμ—ˆμŠ΅λ‹ˆλ‹€. How to solve the problem 처음 ν…ŒμŠ€νŠΈλ₯Ό μœ„ν•΄ Postman > Body νƒ­ > rawλ₯Ό 선택 ν›„ ν•΄λ‹Ή json νŒŒμΌμ„ λ„£μ–΄ μš”μ²­μ„ ν•΄μ€¬λŠ”λ°μš”, μ•Œκ³ ..

[Springboot] μŠ€ν”„λ§λΆ€νŠΈ+μ½”ν‹€λ¦° jar.enabled = true not working 였λ₯˜ λ°œμƒ

Intro μ•ˆλ…•ν•˜μ„Έμš”. Springboot + kotlin 개발 ν™˜κ²½μ—μ„œ gradle μ„€μ •μ˜ "jar.enabled = true" 이 λ™μž‘ν•˜μ§€ μ•ŠλŠ” 였λ₯˜κ°€ λ°œμƒν•˜μ˜€μŠ΅λ‹ˆλ‹€. 일반 Springboot + Java 개발 ν™˜κ²½μ—μ„œλŠ” λ‹€μŒμ˜ 섀정이 잘 μž‘λ™ν•˜λŠ”λ°, μ½”ν‹€λ¦°μ—μ„œλŠ” μž‘λ™ν•˜μ§€ μ•Šλ”λΌκ³ μš”. How to solve the problem ꡬ글링 ν›„, μ•„λž˜μ˜ μ½”λ“œλ₯Ό μ°Ύμ•„ μ μš©ν•΄λ΄€λ”λ‹ˆ μ •μƒμ μœΌλ‘œ μž‘λ™ν•˜μ˜€μŠ΅λ‹ˆλ‹€. 이 외에도 μ—¬λŸ¬ 방법이 μžˆλŠ” 것 κ°™μœΌλ‹ˆ ν¬μŠ€νŒ… ν•˜λ‹¨ μ‚¬μ΄νŠΈλ₯Ό μ°Έκ³ ν•΄μ£Όμ‹œλ©΄ 쒋을 것 κ°™μŠ΅λ‹ˆλ‹€. tasks.withType { archiveBaseName.set("octo-mobile-api") } https://github.com/spring-projects/spring-boot/issues/10238

[Springboot] gradlew command not found / IntelliJ μΈν…”λ¦¬μ œμ΄ gradlew λΉŒλ“œ 였λ₯˜

Intro μ•ˆλ…•ν•˜μ„Έμš”. μΈν…”λ¦¬μ œμ΄ ν„°λ―Έλ„μ—μ„œ gradlew λΉŒλ“œλ₯Ό ν•˜λ €λ˜ 도쀑 μ•„λž˜μ™€ 같은 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. Why? μ €λŠ” μ•„λž˜μ™€ 같은 λͺ…λ Ήμ–΄λ₯Ό μ‚¬μš©ν•˜μ˜€λŠ”λ°μš”, ꡬ글링을 ν•˜λ‹€κ°€ μ²˜μŒμ—λŠ” κΆŒν•œ 문제인 쀄 μ•Œκ³  κΆŒν•œμ„ λ°”κΏ”λ΄€μŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ 계속 같은 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. κ·Έλž˜μ„œ 더 ꡬ글링을 ν•΄λ΄€κ³ , μ œκ°€ 바보같은 μ‹€μˆ˜λ₯Ό ν•˜κ³  μžˆμ—ˆμŒμ„ κΉ¨λ‹¬μ•˜μŠ΅λ‹ˆλ‹€. gradlew build How to solve the problem λ°”λ‘œ λͺ…λ Ήμ–΄ μ•žμ— ./ λ₯Ό 뢙여주지 μ•Šμ•˜κΈ° λ•Œλ¬Έμž…λ‹ˆλ‹€. πŸ˜… λ¦¬λˆ…μŠ€/λ§₯κ³Ό μœˆλ„μš° λͺ…λ Ήμ–΄ μ‚¬μš©λ²•μ΄ λ‹€λ₯΄λ‹ˆ μ•„λž˜ λ‚΄μš© μ°Έκ³  λΆ€νƒλ“œλ¦½λ‹ˆλ‹€. Linux / MacOS ./gradlew Windows .\gradlew https://stackoverflow.com/questions/41700798/gr..

[Springboot] Http Status 415 error 였λ₯˜ (415 Unsupported Media Type)

Intro μ•ˆλ…•ν•˜μ„Έμš”. Springboot λ₯Ό μ‚¬μš©ν•˜λ˜ 도쀑 Http Status 415 error μ—λŸ¬κ°€ λ°œμƒν•˜μ˜€μŠ΅λ‹ˆλ‹€. 415 Unsupported Media Type Why? κΈ°μ‘΄ μ»¨νŠΈλ‘€λŸ¬μ—μ„œ λ§€κ°œλ³€μˆ˜λ₯Ό λ°›κΈ° μœ„ν•΄ @RequestParam μ–΄λ…Έν…Œμ΄μ…˜μ„ μ‚¬μš©ν–ˆμŠ΅λ‹ˆλ‹€. λ§€κ°œλ³€μˆ˜ 5개λ₯Ό λ°›κ³  있던 터라 μƒλ‹Ήνžˆ λ³΅μž‘ν•΄ 보여 ν•΄λ‹Ή λ§€κ°œλ³€μˆ˜λ“€μ„ ν•˜λ‚˜μ˜ Dto Req 객체둜 λ°”κΏ”μ£Όμ—ˆμŠ΅λ‹ˆλ‹€. 이후 μ½”λ“œ 싀행을 ν–ˆλŠ”λ°, λ‹€μŒκ³Ό 같은 μ—λŸ¬κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. Springboot λ₯Ό 잘 λͺ°λΌμ„œ, ν•΄λ§Έμ§€λ§Œ 저희에겐 κ΅¬κΈ€λ‹˜μ΄ μžˆμŠ΅λ‹ˆλ‹€. 🀧 !! ꡬ글링 ν›„, μ œκ°€ μ‚¬μš©ν•œ μ–΄λ…Έν…Œμ΄μ…˜μ΄ 잘λͺ» λ˜μ—ˆλ‹€λŠ” 것을 μ•Œκ²Œ λ˜μ—ˆμŠ΅λ‹ˆλ‹€. @RequestParam λŠ” 단일 데이터λ₯Ό λ°›κΈ° μœ„ν•΄μ„œ μ‚¬μš©ν•˜κΈ° λ•Œλ¬Έμ—, λ‹€μŒκ³Ό 같이 μ—¬λŸ¬ λ§€κ°œλ³€μˆ˜κ°€ λ“€μ–΄..

[React] Moment.js AM/PM을 μ˜€μ „/μ˜€ν›„λ‘œ ν‘œμ‹œν•˜λŠ” 방법

Intro μ•ˆλ…•ν•˜μ„Έμš”. 이번 μ‹œκ°„μ—λŠ” Moment.js λΌμ΄λΈŒλŸ¬λ¦¬μ—μ„œ AM/PMκ°€ μ•„λ‹Œ μ˜€μ „/μ˜€ν›„λ‘œ ν‘œμ‹œν•˜λŠ” 방법에 λŒ€ν•΄ μ•Œμ•„λ³΄λ„λ‘ ν•˜κ² μŠ΅λ‹ˆλ‹€. 참고둜, Moment.jsλŠ” λ‚ μ§œ 및 μ‹œκ°„ 데이터λ₯Ό μ‰½κ²Œ λ‹€λ£° 수 μžˆλ„λ‘ λ„μ™€μ£ΌλŠ” 라이브러리 쀑 ν•˜λ‚˜μž…λ‹ˆλ‹€. How to solve the problem 제 경우, λ‚ μ§œ 데이터λ₯Ό "μ˜€ν›„ 10:00" 둜 ν‘œμ‹œν•΄μ•Ό ν–ˆμŠ΅λ‹ˆλ‹€. ν•˜μ§€λ§Œ "10:00 PM"으둜 λ‚˜μ˜€λ”κ΅°μš”. ꡬ글링을 ν•΄λ³Έ κ²°κ³Ό λ‹€μŒμ˜ 해결책을 μ°Ύμ•˜μŠ΅λ‹ˆλ‹€. λ°”λ‘œ moment/local/ko λ₯Ό μž„ν¬νŠΈ ν•΄μ£ΌλŠ” 것! import 'moment/locale/ko' μœ„ μ½”λ“œλ₯Ό μž„ν¬νŠΈ ν•΄μ€€ 이후, 화면을 μ‚΄νŽ΄λ³΄λ‹ˆ 10:00 PM 이 μ•„λ‹Œ μ˜€ν›„ 10:00 둜 잘 ν‘œμ‹œκ°€ 되고 μžˆμ—ˆμŠ΅λ‹ˆλ‹€.

Framework/React 2023.01.10

[Modern React] section1 : Let's Dive in!

1. How to Get Help pass 2. Join Our Community! done 3. Course Resourse pass 4. Let's Build an App! μ–΄λ–»κ²Œ λ¦¬μ•‘νŠΈλ₯Ό 빨리 λ°°μ› μ„κΉŒλΌλŠ” μ§ˆλ¬Έμ„ 많이 λ°›μŠ΅λ‹ˆλ‹€. 이 μ§ˆλ¬Έμ— λ‹΅ν•  수 μžˆλŠ” λŒ€λ‹΅μ€ λ”± ν•œκ°€μ§€μž…λ‹ˆλ‹€. You have to write code and you have to work on projects 5. Critical Questions 1. What's React All about? λ¦¬μ•‘νŠΈλŠ” (1) HTML을 λ³΄μ—¬μ£Όκ±°λ‚˜ (2) μ‚¬μš©μžκ°€ 무언가λ₯Ό ν•  λ•Œ, HTML이 λ³€ν•œλ‹€. 6. A Few More Critical Questions 2. How does a React app start up? 1. All of your p..

Framework/React 2023.01.08

[React] react-datepicker νŠΉμ •/μ§€λ‚œ λ‚ μ§œ μ œμ™Έν•˜λŠ” 방법

Intro react-datepicker 라이브러리λ₯Ό μ‚¬μš©ν•˜λ˜ 도쀑, λλ‚ μ§œκ°€ μ‹œμž‘ λ‚ μ§œλ₯Ό 선택할 수 없도둝 λ‚ μ§œλ₯Ό μ œμ™Έν•΄μ•Ό ν–ˆμŠ΅λ‹ˆλ‹€. How to solve the problem ꡬ글링 ν›„ μ•„λž˜μ™€ 같은 닡변을 μ°Ύμ•˜μŠ΅λ‹ˆλ‹€. DatePicker μ†μ„±μ˜ minDateλ₯Ό μ‚¬μš©ν•˜μ—¬ μ œμ™Έν•  λ‚ μ§œλ₯Ό λ„£μ–΄μ£Όλ©΄ λ©λ‹ˆλ‹€. https://stackoverflow.com/questions/50626937/react-datepicker-exclude-past-dates

Framework/React 2023.01.04

[React] react-datepicker 라이브러리 css/style 적용 μ•ˆλ˜λŠ” μ—λŸ¬

Intro react-datepicker 라이브러리λ₯Ό μ‚¬μš©ν•˜λ˜ 도쀑 CSS κ°€ 적용 μ•ˆλ˜λŠ” μ—λŸ¬κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. 참고둜 μ €λŠ” νƒ€μž…μŠ€ν¬λ¦½νŠΈλ„ μ μš©ν•΄μ•Ό ν–ˆκΈ° λ•Œλ¬Έμ— 라이브러리 μ„€μΉ˜λŠ” μ•„λž˜μ™€ 같이 μ§„ν–‰ν•˜μ˜€μŠ΅λ‹ˆλ‹€. yarn add react-datepicker yarn add @types/react-datepicker react-datepicker 곡식 ν™ˆνŽ˜μ΄μ§€μ— μžˆλŠ” Default 예제λ₯Ό μ½”λ“œμ— λ„£μ–΄ μ‹€ν–‰ν•˜μž, cssκ°€ μ „ν˜€ μ μš©λ˜μ§€ μ•ŠλŠ” μƒνƒœλ‘œ 화면에 λœ¨λ”κ΅°μš”. () => { const [startDate, setStartDate] = useState(new Date()); return ( setStartDate(date)} /> ); }; Why? λ°”λ‘œ ꡬ글링을 ν•΄λ΄€μŠ΅λ‹ˆλ‹€. 저와 λΉ„μŠ·ν•œ μ—λŸ¬λ₯Ό κ²ͺμœΌμ‹  λΆ„λ“€..

Framework/React 2023.01.03
λ°˜μ‘ν˜•