'๋ฐฑ์๋(Back-End) ๊ฐ๋ฐ' ์นดํ
๊ณ ๋ฆฌ์ ๊ธ ๋ชฉ๋ก (4 Page)
DEVELOPER / DBA ๐ฑ
๋ฐฑ์๋(Back-End) ๊ฐ๋ฐ/SpringBoot
[SpringBoot] 4_์คํ๋ง ๋น๊ณผ ์์กด๊ด๊ณ
2025.02.25
์คํ๋ง ๋น์ ๋ฑ๋กํ๊ณ , ์์กด๊ด๊ณ ์ค์ ํ๊ธฐ * ํ์ ์ปจํธ๋กค๋ฌ์ ์์กด๊ด๊ณ ์ถ๊ฐpackage hello.hello_spring.controller;import hello.hello_spring.service.MemberService;import org.springframework.beans.factory.annotation.Autowired;import org.springframework.stereotype.Controller;@Controllerpublic class MemberController { private final MemberService memberService; //์์ฑ์ ์์ฑ ๋จ์ถํค : alt + Insertํค @Autowired // ์์กด๊ด๊ณ ์ฃผ์
public Memb..

๋ฐฑ์๋(Back-End) ๊ฐ๋ฐ/SpringBoot
[SpringBoot] 3.3_ํ์ ์๋น์ค ๊ฐ๋ฐ ๋ฐ ํ
์คํธ
2025.02.25
ํ์ ๊ฐ์
& ํ์ ์กฐํpackage hello.hello_spring.service;import hello.hello_spring.domain.Member;import hello.hello_spring.repository.MemberRepository;import hello.hello_spring.repository.MemoryMemberRepository;import java.util.List;import java.util.Optional;public class MemberService { // private final MemberRepository memberRepository = new MemoryMemberRepository(); // DI (์์กด์ฑ ์ฃผ์
) ํจํด์ผ๋ก ๋ฐ๊พธ๊ธฐ pri..
๋ฐฑ์๋(Back-End) ๊ฐ๋ฐ/SpringBoot
[SpringBoot] 3.2_ํ์ ๋ฆฌํฌ์งํ ๋ฆฌ ํ
์คํธ ์ผ์ด์ค ์์ฑ
2025.02.25
๊ฐ๋ฐํ ๊ธฐ๋ฅ์ ์คํํด์ ํ
์คํธ ํ ๋ ์๋ฐ์ main ๋ฉ์๋๋ฅผ ํตํด์ ์คํํ๊ฑฐ๋, ์น ์ ํ๋ฆฌ์ผ์ด์
์ ์ปจํธ๋กค๋ฌ๋ฅผ ํตํด์ ํด๋น๊ธฐ๋ฅ์ ์คํํ๋ค. ์ด๋ฌํ ๋ฐฉ๋ฒ์ ์ค๋นํ๊ณ ์คํํ๋๋ฐ ์ค๋ ๊ฑธ๋ฆฌ๊ณ , ๋ฐ๋ณต ์คํํ๊ธฐ ์ด๋ ต๊ณ ์ฌ๋ฌ ํ
์คํธ๋ฅผ ํ๋ฒ์ ์คํํ๊ธฐ ์ด๋ ต๋ค๋ ๋จ์ ์ด ์๋ค. ์๋ฐ๋ JUnit์ด๋ผ๋ ํ๋ ์์ํฌ๋ก ํ
์คํธ๋ฅผ ์คํํด์ ์ด๋ฌํ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ๋ค. * ํ์ ๋ฆฌํฌ์งํ ๋ฆฌ ๋ฉ๋ชจ๋ฆฌ ๊ตฌํ์ฒด ํ
์คํธ (src/test/java ํ์ ํด๋์ ์์ฑ) package hello.hello_spring.repository;import hello.hello_spring.domain.Member;import org.assertj.core.api.Assertions;import org.junit.jupiter.api.AfterEach;i..
๋ฐฑ์๋(Back-End) ๊ฐ๋ฐ/SpringBoot
[SpringBoot] 3.1_ํ์ ๋ฆฌํฌ์งํ ๋ฆฌ ๊ตฌํ
2025.02.25
๋น์ฆ๋์ค ์๊ตฌ์ฌํญ ์ ๋ฆฌ๋ฐ์ดํฐ : ํ์ID, ์ด๋ฆ๊ธฐ๋ฅ : ํ์ ๋ฑ๋ก, ์กฐํ์์ง ๋ฐ์ดํฐ ์ ์ฅ์๊ฐ ์ ์ ๋์ง ์์(๊ฐ์์ ์๋๋ฆฌ์ค)* ์ผ๋ฐ์ ์ธ ์น ์ดํ๋ฆฌ์ผ์ด์
๊ณ์ธต ๊ตฌ์กฐ์ปจํธ๋กค๋ฌ -> ์๋น์ค -> ๋ฆฌํฌ์งํ ๋ฆฌ -> ( DB ) \ | / ( ๋๋ฉ์ธ)์ปจํธ๋กค๋ฌ : ์น MVC์ ์ปจํธ๋กค๋ฌ ์ญํ ์๋น์ค : ํต์ฌ ๋น์ฆ๋์ค ๋ก์ง ๊ตฌํ๋ฆฌํฌ์งํ ๋ฆฌ : ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ๊ทผ, ๋๋ฉ์ธ ๊ฐ์ฒด๋ฅผ DB์ ์ ์ฅํ๊ณ ๊ด๋ฆฌ๋๋ฉ์ธ : ๋น์ฆ๋์ค ๋๋ฉ์ธ ๊ฐ์ฒด, ex) ํ์, ์ฃผ๋ฌธ, ์ฟ ํฐ ๋ฑ๋ฑ ์ฃผ๋ก ๋ฐ์ดํฐ๋ฒ ์ด์ค์ ์ ์ฅํ๊ณ ๊ด๋ฆฌ๋จ ํ์ ๋๋ฉ์ธ๊ณผ ๋ฆฌํฌ์งํ ๋ฆฌ ๋ง๋ค๊ธฐ * ํ์ ๊ฐ์ฒดpackage hello.hello_spring.domain;public class Member {..

๋ฐฑ์๋(Back-End) ๊ฐ๋ฐ/SpringBoot
[SpringBoot] 2.3_API (@ResponseBody)
2025.02.25
@ResponseBody ๋ฌธ์ ๋ฐํpackage hello.hello_spring.controller;import org.springframework.stereotype.Controller;import org.springframework.ui.Model;import org.springframework.web.bind.annotation.GetMapping;import org.springframework.web.bind.annotation.RequestParam;import org.springframework.web.bind.annotation.ResponseBody;import org.springframework.web.service.annotation.GetExchange;@Controllerpubli..