code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,12 @@
+import PageHandler from './PageHandler';
+import { getPopularMovie } from '../api/movie';
+
+export async function getNextPopularMovieList() {
+ const { page, done } = PageHandler.next();
+ const { results } = await getPopularMovie(page);
+ return {
+ page,
+ done,
+ nextMovieList: results... | JavaScript | `onClickMoreButton`์ `getNextPopularMovieList`๋ก ๋ณ๊ฒฝํ๋ฉด์ ์ญํ ์ ๋ถ๋ฆฌํด๋ณด์์ต๋๋ค! |
@@ -0,0 +1,42 @@
+const MOVIE_TOTAL_PAGE_LIMIT = 500;
+
+const INITIAL_VALUE = {
+ page: 1,
+ totalPages: MOVIE_TOTAL_PAGE_LIMIT,
+};
+
+function PageEventHandler() {
+ let attr = { ...INITIAL_VALUE };
+
+ return {
+ next() {
+ if (!this.hasNextPage()) {
+ return {
+ page: attr.page,
+ ... | JavaScript | ์ ๊ฑฐํ์์ต๋๋ค! ์ด์ ๋ ์์ ๋ง์๋๋ฆฐ ์ด์ ์ ๋์ผํฉ๋๋ค!
๊ผผ๊ผผํ ๋ฆฌ๋ทฐํด์ฃผ์
์ ๊ฐ์ฌ๋๋ฆฝ๋๋ค ๐ |
@@ -0,0 +1,12 @@
+import PageHandler from './PageHandler';
+import { getPopularMovie } from '../api/movie';
+
+export async function getNextPopularMovieList() {
+ const { page, done } = PageHandler.next();
+ const { results } = await getPopularMovie(page);
+ return {
+ page,
+ done,
+ nextMovieList: results... | JavaScript | ์... ์ด ๋ถ๋ถ์ ์ ๊ฐ ์๋ํ ๋ฐ์๋ ์กฐ๊ธ ๋ค๋ฅด๊ฒ ๋ณ๊ฒฝ๋ ๊ฒ ๊ฐ์ต๋๋ค!
์ ๊ฐ ์์ฌ ์ฝ๋๋ฅผ ์์ด๊ฐ๋ฉฐ ์ด๋ ์ ๋ ๋ณ๊ฒฝํด๋ณผ๊ฒ์! |
@@ -0,0 +1,18 @@
+export class LoadingHandler {
+ #loading;
+ constructor(initialValue) {
+ this.#loading = initialValue;
+ }
+
+ start() {
+ this.#loading = true;
+ }
+
+ end() {
+ this.#loading = false;
+ }
+
+ isLoading() {
+ return this.#loading;
+ }
+} | JavaScript | ์ฌ์ฉ์ฒ๋ฅผ ๋ณด๋ฉด, ๋ก๋ฉ ์ํ ์์ฒด๋ฅผ ํ์ฉํ๋ ๊ฒฝ์ฐ๊ฐ ํ ๋ฒ ๋ฐ์ ์๊ณ ,
start(), end() ์คํ๊ณผ ํจ๊ป DOM ์กฐ์ ๋ก์ง์ด ํจ๊ป ์ค๋ ๊ฒ ๊ฐ์์!
์ฌ๊ธฐ์ DOM ์กฐ์๋ ๊ฐ์ด ํด์ฃผ๊ณ , ์
๋ ฅ์ผ๋ก ์กฐ์ํ ์์๋ฅผ ๊ฐ์ด ๋ฐ์ผ๋ฉด ๋ ์์ง์ฑ์ด ๋์ ์ฝ๋๊ฐ ๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,18 @@
+const DEFAULT_SEARCH_PARAMS = {
+ api_key: process.env.API_KEY,
+ language: 'ko-KR',
+};
+const MOVIE_BASE_URL = 'https://api.themoviedb.org/3/movie';
+
+export async function getPopularMovie(page) {
+ const param = new URLSearchParams({
+ ...DEFAULT_SEARCH_PARAMS,
+ page,
+ });
+
+ const r... | JavaScript | ์ฌ๋ฌ๊ฐ์ ํจ์๋ฅผ ๋ฌถ์ด์ ๋ด๋ณด๋ด๊ธฐ ์ํจ์ด๋ค
-> ์ปจ๋ฒค์
๋ง ๋ง๋ค๋ฉด ์ด๋ค ๋ฐฉํฅ์ด๋ ์๊ด ์๋ค๊ณ ์๊ฐํฉ๋๋ค!
๋ค๋ง, ์ ๋ ํ๋์ ํจ์์ธ ์ํฉ์์ ํจ์๊ฐ ๋ ์ถ๊ฐ๋์ง ์์๋๋ฐ, ๋ ์ถ๊ฐ๋ ์์ ์ธ๋ฐ ์ด๋ ๊ฒ ํ์ ๊ฒ ๊ฐ์์
๋จ๊ธด ์ฝ๋ฉํธ์ด๊ธดํฉ๋๋ค! (๋ณธ๋ฌธ์ ์ฝ๋ฉํธ์ ๋์ผํ ๋ด์ฉ์
๋๋ค ใ
ใ
) |
@@ -11,12 +11,178 @@ on:
jobs:
code_review:
runs-on: ubuntu-latest
- name: ChatGPT Code Review
+ name: Gemini Code Review
steps:
- - uses: anc95/ChatGPT-CodeReview@main
+ - uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ ... | Unknown | ์ด ์ฝ๋๋ GitHub Actions๋ฅผ ์ด์ฉํ์ฌ Google Gemini API๋ฅผ ํตํด Pull Request์ ๋ํ ์ฝ๋ ๋ฆฌ๋ทฐ๋ฅผ ์๋ํํ๋ ์์
์
๋๋ค. ํ์ง๋ง ๋ช ๊ฐ์ง ๊ฐ์ ์ด ํ์ํฉ๋๋ค.
**1. ์ฝ๋์ ํ์ง๊ณผ ๊ฐ๋
์ฑ:**
* **๊ฐ๋
์ฑ ๊ฐ์ :** `reviewCode` ํจ์ ๋ด๋ถ์ JSON ๊ตฌ์กฐ๊ฐ ์ค์ฒฉ๋์ด ๊ฐ๋
์ฑ์ด ๋จ์ด์ง๋๋ค. ๋ ๋ช
ํํ ๋ณ์๋ช
์ ์ฌ์ฉํ๊ณ , JSON ์์ฑ ๋ถ๋ถ์ ์ฌ๋ฌ ์ค๋ก ๋๋์ด ๊ฐ๋
์ฑ์ ๋์ฌ์ผ ํฉ๋๋ค. ์๋ฅผ ๋ค์ด, `contents`, `parts` ๋ฑ์ ๋ณ์๋ช
์ ์ปจํ
์คํธ๋ฅผ ๋ช
ํํ ํ๋๋ก ์์ ํ ์ ์์ต๋๋ค.
* **์ค๋ฅ ์ฒ๋ฆฌ ๋ถ์กฑ:*... |
@@ -11,12 +11,178 @@ on:
jobs:
code_review:
runs-on: ubuntu-latest
- name: ChatGPT Code Review
+ name: Gemini Code Review
steps:
- - uses: anc95/ChatGPT-CodeReview@main
+ - uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ ... | Unknown | ## Gemini Code Review Workflow ํ์ผ ๋ฆฌ๋ทฐ (code_review.yml)
๋ค์์ ์ ๊ณต๋ `code_review.yml` ํ์ผ์ ๋ํ ์์ธ ๋ฆฌ๋ทฐ์
๋๋ค. ์๋์ด ๊ฐ๋ฐ์์ ๊ด์ ์์ ์ฝ๋ ํ์ง, ์ ์ฌ์ ๋ฌธ์ ์ , ์ฑ๋ฅ ๊ฐ์ , ๋ณด์ ์ด์ ๋ฐ ๊ฐ์ ์ ์์ ๋ค๋ฃน๋๋ค.
**1. ์ฝ๋์ ํ์ง๊ณผ ๊ฐ๋
์ฑ**
* **์ ๋ฐ์ ์ผ๋ก ์ํธ:** ์ฝ๋์ ๊ตฌ์กฐ๊ฐ ๋น๊ต์ ๋ช
ํํ๊ณ , ์ฃผ์์ด ์ ์ ํ๊ฒ ์ฌ์ฉ๋์ด ๊ฐ๋
์ฑ์ด ๋์ต๋๋ค. ํจ์๋ณ ์ญํ ๋ถ๋ด๋ ์ ๋์ด ์์ต๋๋ค.
* **ํจ์๋ช
:** ํจ์๋ช
(`reviewCode`, `processFile`)์ ์ญํ ์ ๋ช
ํํ ์ค๋ช
ํ๋ฉฐ... |
@@ -11,12 +11,178 @@ on:
jobs:
code_review:
runs-on: ubuntu-latest
- name: ChatGPT Code Review
+ name: Gemini Code Review
steps:
- - uses: anc95/ChatGPT-CodeReview@main
+ - uses: actions/checkout@v4
+
+ - name: Setup Node.js
+ uses: actions/setup-node@v4
+ with:
+ ... | Unknown | ## .github/workflows/code_review.yml ์ฝ๋ ๋ฆฌ๋ทฐ
๋ค์์ ์ฃผ์ด์ง `.github/workflows/code_review.yml` ํ์ผ์ ๋ํ ์ฝ๋ ๋ฆฌ๋ทฐ์
๋๋ค.
**1. ์ฝ๋ ํ์ง ๋ฐ ๊ฐ๋
์ฑ**
* **์ ๋ฐ์ ์ผ๋ก ์ํธ:** ์ฝ๋๋ ๋น๊ต์ ๊น๋ํ๊ณ ๊ฐ๋
์ฑ์ด ์ข์ต๋๋ค. ์ฃผ์๋ ์ ์ ํ๊ฒ ๋ฌ๋ ค ์์ด ์ฝ๋์ ์๋๋ฅผ ํ์
ํ๋ ๋ฐ ๋์์ด ๋ฉ๋๋ค.
* **์ผ๊ด์ฑ:** ๋ค์ฌ์ฐ๊ธฐ, ๋ณ์๋ช
๊ท์น ๋ฑ์ด ์ผ๊ด์ฑ์ ์ ์งํ๊ณ ์์ต๋๋ค.
* **๋ชจ๋ํ:** `reviewCode`, `processFile` ๋ฑ์ ํจ์๋ก ๋ก์ง์ ๋ถ๋ฆฌํ์ฌ ์ฌ์ฌ์ฉ์ฑ๊ณผ ์ ์ง... |
@@ -0,0 +1,109 @@
+package chess.domain.board;
+
+import chess.domain.command.MoveOptions;
+import chess.domain.piece.Color;
+import chess.domain.piece.Piece;
+import chess.domain.player.Player;
+import chess.domain.player.Position;
+
+import java.util.Collection;
+
+public class Board {
+ private final Player white... | Java | ์ ์ ๊ณ์ฐ์ ๋ํ ๋ช
๋ น์ด(`status`) ์ ์ฉ์ด ์๋์ด ์๋ ๊ฒ ๊ฐ์์! :) |
@@ -0,0 +1,58 @@
+package chess.domain.command;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+public enum Command {
+
+ START("start"),
+ END("end"),
+ MOVE("move"),
+ STATUS("status");
+
+ private static final Map<String, Command> COMMANDS = createCommands();
+
+ pr... | Java | Command๋ Enum์ผ๋ก ๊ด๋ฆฌํด๋ณด๋ฉด ์ด๋จ๊น์? :) |
@@ -0,0 +1,127 @@
+package chess.domain.player;
+
+import chess.domain.board.File;
+import chess.domain.piece.Color;
+import chess.domain.piece.Piece;
+import chess.domain.piece.PieceFactory;
+import chess.domain.piece.PieceResolver;
+
+import java.util.Collection;
+import java.util.EnumMap;
+import java.util.HashMap;
... | Java | ์ ๋ ๋ถ์ ์ฐ์ฐ์(`!`)๋ฅผ ์ฌ๋งํ๋ฉด ํผํ๋๋ฐ์ ใ
ใ
๊ฐ๋
์ฑ์ ๋ฌธ์ ๋ ์๊ณ , ์ฝ๋ ์ฌ๋์ด ํ๋ฒ ๋ ํด์์ ํด์ผํ๊ธฐ ๋๋ฌธ์ ๋ฉ์๋๋ฅผ ์ ๊ณตํ๋ ์ชฝ์์ ํ๋ฒ ๋ ์ถ์ํ์ํค๋ฉด ์ข์ ๊ฒ ๊ฐ์์ ใ
ใ
`piece.isNotPawn()` |
@@ -0,0 +1,127 @@
+package chess.domain.player;
+
+import chess.domain.board.File;
+import chess.domain.piece.Color;
+import chess.domain.piece.Piece;
+import chess.domain.piece.PieceFactory;
+import chess.domain.piece.PieceResolver;
+
+import java.util.Collection;
+import java.util.EnumMap;
+import java.util.HashMap;
... | Java | ์์๋ ๋ถ์ ์ฐ์ฐ์ ํผ๋๋ฐฑ์ ๋จ๊ฒผ๋๋ฐ์, ์ฌ๊ธฐ๋ ํ๋ฒ๋ ์ถ์ํ์ํค๋ฉด ์ข์ ๊ฒ ๊ฐ์์ ใ
ใ
์ ์ฒด์ ์ผ๋ก ํ๋ฒ ๋ ์ฒดํฌํด๋ด๋ ์ข๊ฒ ๋ค์ :) |
@@ -0,0 +1,109 @@
+package chess.domain.board;
+
+import chess.domain.command.MoveOptions;
+import chess.domain.piece.Color;
+import chess.domain.piece.Piece;
+import chess.domain.player.Player;
+import chess.domain.player.Position;
+
+import java.util.Collection;
+
+public class Board {
+ private final Player white... | Java | ์.. ํ์ด๋ถ repo์์ pullํ๊ณ ํธ์๋ฅผ ์ํ์๋ค์ ์ฃ์กํฉ๋๋คใ
ใ
๋ฐ์ํ์์ต๋๋ค! |
@@ -0,0 +1,127 @@
+package chess.domain.player;
+
+import chess.domain.board.File;
+import chess.domain.piece.Color;
+import chess.domain.piece.Piece;
+import chess.domain.piece.PieceFactory;
+import chess.domain.piece.PieceResolver;
+
+import java.util.Collection;
+import java.util.EnumMap;
+import java.util.HashMap;
... | Java | ๋ต๋ต! ํด๋น ํผ๋๋ฐฑ ์ฝ์ ํ ๋ถ์ ์ฐ์ฐ์ ์ฌ์ฉํ๋ ๊ณณ ๋ชจ๋ ์์ ํด์ฃผ์์ต๋๋ค :) |
@@ -0,0 +1,58 @@
+package chess.domain.command;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+public enum Command {
+
+ START("start"),
+ END("end"),
+ MOVE("move"),
+ STATUS("status");
+
+ private static final Map<String, Command> COMMANDS = createCommands();
+
+ pr... | Java | ์์๋ค์ด๊ธฐ ๋๋ฌธ์ Enum์ผ๋ก ๊ด๋ฆฌํ๋ ํธ์ด ๋ ์ข๊ฒ ๋ค์!
Enum ๊ฐ์ฒด๋ก ์์ ํ์์ต๋๋ค :) |
@@ -0,0 +1,88 @@
+import styled from "styled-components";
+
+export const ReviewSectionName = styled.h2`
+
+`;
+
+export const ReviewFormArea = styled.div`
+ position: absolute;
+ width: 918px;
+ height: 240px;
+ padding: 14px 23px;
+ background-color: #00462A;
+ border-radius: 20px;
+ flex-directi... | Unknown | styled-component ๊น๋ํ๊ฒ ์ ์ฐ์ ๊ฒ ๊ฐ์์! ์๊ณ ๋ง์ผ์
จ์ต๋๋ค~ |
@@ -0,0 +1,46 @@
+package lottodomain;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LottoGame {
+ private static final int PRICE_PER_LOTTO = 1000;
+
+ private List<Lotto> allLotto;
+ private int numberOfAllLotto;
+
+ public LottoGame(int inputMoney, List<List<Integer>> manualLottoN... | Java | ๋ณ์๋ช
์ด ๋๋ฌธ์๋ก ์์ํ๋ค์ ~ |
@@ -0,0 +1,25 @@
+package lottodomain;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.IntStream;
+
+public class LottoGenerator {
+ private static final List<Integer> LOTTO_NO_POOLS = IntStream.rangeClosed(1, 45).boxed().collect(Collectors.toLis... | Java | Lotto ์ factory method ์ ์ถ๊ฐํ์ฌ ์์ฑํด๋ณด๋ฉด ์ด๋จ๊น์?
ex> Lotto.ofAuto(), Lotto.ofManual("1,2,3,4,5,6) |
@@ -0,0 +1,25 @@
+package lottodomain;
+
+public class LottoNo {
+ private Integer value;
+
+ public LottoNo(int number) {
+ value = number;
+ }
+
+ public Integer getValue() {
+ return value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ ... | Java | LottoNo ๋ฅผ ์์ฑํ ๋ range ์ ๋ํ ์กฐ๊ฑด์ ๊ฒ์ฆํ๋ฉด ์ข ๋ ์๋ฏธ ์๋ wrapping class ๊ฐ ๋์ง ์์๊น์? |
@@ -0,0 +1,25 @@
+package lottodomain;
+
+public class LottoNo {
+ private Integer value;
+
+ public LottoNo(int number) {
+ value = number;
+ }
+
+ public Integer getValue() {
+ return value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ ... | Java | ๋ฌธ์ :
"๋ชจ๋ ์์๊ฐ๊ณผ ๋ฌธ์์ด์ ํฌ์ฅํ๋ค." ์์น์ ๋ฐ๋ผ ์ธ์คํด์ค๋ฅผ ์์ฑํ๋ค๋ณด๋ ๋๋ฌด ๋ง์ ๊ฐ์ฒด๊ฐ ์์ฑ๋๊ณ , GC๊ฐ ๋์ด ์ฑ๋ฅ์ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค.
ํนํ ๋ก๋ ๋ฒํธ ํ๋๊น์ง ๊ฐ์ฒด๋ก ํฌ์ฅํ ๊ฒฝ์ฐ ์์ฑ๋๋ ์ธ์คํด์ค์ ์๋ ์๋นํ ๋์ด๋๋ ๋ฌธ์ ๊ฐ ๋ฐ์ํ๋ค.
์์ ๊ฐ์ ๋ฌธ์ ๋ ์ด๋ป๊ฒ ํด๊ฒฐํ ์ ์์๊น์? (ํค์๋ : static, map) |
@@ -0,0 +1,25 @@
+package lottodomain;
+
+public class LottoNo {
+ private Integer value;
+
+ public LottoNo(int number) {
+ value = number;
+ }
+
+ public Integer getValue() {
+ return value;
+ }
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) {
+ ... | Java | ๋ถ๋ณ์ ๊ฐ์ wrapping ํ ํด๋์ค์ด๋ฏ๋ก final int value; ๋ก ์ ์ธํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,49 @@
+package lottoview;
+
+import lottodomain.Lotto;
+import lottodomain.LottoAnalyzer;
+import lottodomain.LottoNo;
+import lottodomain.Rank;
+
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+import java.util.stream.Stream;
+
+public class OutputView {
+ pub... | Java | analyzer ๊ฐ outputview ์ ์์ ๋น์ฆ๋์ค ๋ก์ง์ ์ํํ๊ณ ์๋๋ฐ์
๊ฒ์์ ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ LottoResults(DTO) ํด๋์ค์ Lotto list ๋ฅผ ๊ฐ์ธ๋ Lottos ํด๋์ค๋ฅผ ๋ง๋ค์ด์
outputview ์์ ๋น์ฆ๋์ค ๋ก์ง์ด ์คํ๋์ง ์๋๋ก ๋ณ๊ฒฝํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,63 @@
+package lottodomain;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+public class LottoAnalyzerTest {
+ private static final double DELTA = 1e-15;
+
... | Java | ์ข์ ์ ๋ํ
์คํธ ์์ฑ๋ฒ์๋ F.I.R.S.T ๋ผ๋ ์์น์ด ์๋๋ฐ์
https://coding-start.tistory.com/261
์ฒจ๋ถํ๊ณ ๊ฐ๋๋ค ~ |
@@ -0,0 +1,47 @@
+package lottodomain;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.stream.Collectors;
+
+import static org.junit.Assert.*;
+
+public class LottoGameTest {
+ private Lott... | Java | private method ๋ public ๋ณด๋ค ์๋์ ์์น์์ผ์ฃผ๋๊ฒ ๊ฐ๋
์ฑ์ ์ข์ต๋๋ค ~ |
@@ -0,0 +1,50 @@
+package lottodomain;
+
+import org.junit.After;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import static org.junit.Assert.*;
+
+public class WinningNosTest {
+ private WinningNos winningNos;
+
+ @Before
+ ... | Java | ์ ์ฒด์ ์ผ๋ก ์ฝ๋์ ๋นํด ํ
์คํธ ์ชฝ์ด ์กฐ๊ธ ์์ฌ์์
์๊ฐ์ด ๋์ ๋ค๋ฉด TDD ๋ฐฉ๋ฒ๋ก ์ ํตํด ๋ก๋๋ ๋ ์ด์ฑ ๊ฒ์์ ๋ค์ ๊ตฌํํด๋ณด๋ ๊ฒ๋ ๋ง์ด ๋์์ด ๋์ค ๊ฒ ๊ฐ์ต๋๋ค |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | ์ด ๋ ์กฐ๊ฑด์ &&๋ก ๊ฑธ๋ฉด state๋ฅผ ํ๋๋ง ์ฌ์ฉํ๊ณ validation์ ํ์ธํ ์ ์์ง ์์๊น์?
์ ์ ์ฆ์ดํํธ๋ฅผ ์ฐ์
จ๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | id์ pw๋ก ํ๋ฒ์ validationํ๊ณ activateBtn์ True/false๋ฅผ ์ง์ ํ๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค. isValidatedId๋ isValidatedPw๋ ํฌ๊ฒ ํ์ํ์ง ์์ ๊ฒ ๊ฐ์์. ๋ถํ์ํ ๋ฆฌ๋๋๋ง๋ ์ค์ผ ์ ์๋ค๊ณ ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,66 @@
+@use '../../../styles/mixin.scss' as mixin;
+@use '../../../styles/color.scss' as clr;
+
+body {
+ background: clr.$bg-login;
+
+ .login {
+ position: relative;
+ top: -80px;
+
+ #wrapper {
+ @include mixin.flex($align: center);
+ position: relative;
+ flex-direction: column;... | Unknown | input์ด inline-block์ด๊ณ ์์ง์ผ๋ก ์ ๋ ฌํ๋ ค๊ณ display: flex๋ฅผ ์ฐ์ ๊ฒ ๊ฐ์ต๋๋ค. ๊ต์ฅํ ์ข์๋ฐ์ ์ ๋ Input์ display: blockํด์ฃผ๋ ๊ฒ๋ ๊ด์ฐฎ์ ๋ฐฉ๋ฒ์ด์ง ์์๊น ์๊ฐํฉ๋๋ค. |
@@ -0,0 +1,66 @@
+@use '../../../styles/mixin.scss' as mixin;
+@use '../../../styles/color.scss' as clr;
+
+body {
+ background: clr.$bg-login;
+
+ .login {
+ position: relative;
+ top: -80px;
+
+ #wrapper {
+ @include mixin.flex($align: center);
+ position: relative;
+ flex-direction: column;... | Unknown | '๋ก๊ทธ์ธ' ์ด๋ผ๋ ๊ธ์ ์ผํฐ์ ๋ง์ถ๊ธฐ ์ํด display: flex์ฃผ์ ๊ฒ ๊ฐ์์. ์ข์๋ฐฉ๋ฒ์ด์ง๋ง flex์ ๊ทธ ์์ฑ๋ค์ด ์ข ๋จ์ด์ ธ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ด๋ ๊ฒ ์ฐ๊ด๋๋ css์์ฑ์ ๋ถ์ฌ ์ฃผ์๋ ๊ฒ ๋์ค์ ์ ์ง๋ณด์ ์ธก๋ฉด์์๋ ์ข์ ๊ฒ ๊ฐ์ ์ถ์ฒ ๋๋ฆฝ๋๋ค! |
@@ -0,0 +1,26 @@
+import React, { useState } from 'react';
+import { AiFillDelete, AiOutlineHeart, AiFillHeart } from 'react-icons/ai';
+
+const Comment = ({ id, userId, value, time, handleDelete }) => {
+ const [isLiked, setIsLiked] = useState(false);
+
+ const toggleLike = () => {
+ setIsLiked(!isLiked);
+ };
+... | Unknown | ์ ๋ฒ ์ธ์
์์ ๋ฉํ ๋์ด ํ์ ๊ฒ์ฒ๋ผ ๋ณ์๋ช
์ ์กฐ๊ธ ๋ ๊ตฌ์ฒด์ ์ผ๋ก ์ด๋ค ๋ด์ฉ์ ๋ด๊ณ ์๋์ง๋ฅผ ์์ฑํด ์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. commentVal์ด ๋๊ธ ์ ์ฒด๋ฅผ ๊ด๋ฆฌํ๋ ๋ฐฐ์ด์ด๊ณ el์ด ๊ฐ ๋ฐฐ์ด์ ์์์ด๋๊น
commentVal๋์ allComments, el๋์ comment๋ฑ์ผ๋ก (์ด๊ฑด ์ ๋ ์กฐ๊ธ ์ ๋งคํ๋ค์ .. ์ฃ์กํฉ๋๋ค) (๋ฐฐ์ด์ s๋ฅผ ๋ถ์ธ ๋ณ์๋ช
์ผ๋ก ํ๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!) |
@@ -0,0 +1,43 @@
+span.comment {
+ padding-left: 10px;
+
+ small {
+ color: #a3a3a3;
+ }
+
+ &:first-child {
+ padding: 10px;
+ font-weight: bold;
+ }
+
+ svg {
+ &.delete {
+ display: none;
+ cursor: pointer;
+ }
+
+ &.hearts {
+ color: #a3a3a3;
+ position: absolute;
+ ... | Unknown | span์ ๋ํด์๋ง ์คํ์ผ๋ง์ ํด์ฃผ์
จ๋๋ฐ ์ด๋ฌ๋ฉด ๋ค๋ฅธ ์ปดํฌ๋ํธ์ span์๋ ์ํฅ์ด ๊ฐ์ง ์์๊น ์กฐ์ฌ์ค๋ฝ๊ฒ ์๊ฐํด ๋ด
๋๋ค. ๊ฐ์ธ์ ์ผ๋ก className์ ์ฃผ๋ ๊ฒ ์กฐ๊ธ ๋ ์์ ํ ๊ฒ ๊ฐ์ต๋๋ค
์ถ๊ฐ์ ์ผ๋ก svgํ๊ทธ๋ span ๋ด๋ถ์ nestingํด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์.
```
svg {
&.red {}
&.blue {}
}
``` |
@@ -0,0 +1,87 @@
+import React, { useState } from 'react';
+import { AiFillHeart, AiOutlineComment, AiOutlineUpload } from 'react-icons/ai';
+import { BiDotsHorizontalRounded } from 'react-icons/bi';
+import { GrBookmark } from 'react-icons/gr';
+import './Feeds.scss';
+import Comments from './Comment/Comments';
+
+exp... | Unknown | ๊ต์ฅํ ์ ์ง์ ๊ฒ ๊ฐ์ต๋๋ค!! ๐ ๊ทธ๋ฐ๋ฐ ์์๊ฐ ์กฐ๊ธ ์ ๋งคํ ๊ฒ ๊ฐ์์. 17)์์ uploadComment ํธ์ถ์ ํ๊ณ 31)์์ currInputVal( " " ) -> 18 ) ์์ currInputVal( e.target.value ) ์์ผ๋ก ์งํ์ด ๋๋ค๋ฉด ๋๊ธ์ ์ถ๊ฐํ๋๋ผ๋ input์ ๋น์์ง์ง ์์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,101 @@
+@use '../../../../styles/mixin.scss' as mixin;
+@use '../../../../styles/color.scss' as clr;
+
+.feeds {
+ position: relative;
+ top: 77px;
+ width: 60%;
+ margin-bottom: 80px;
+ background: #fff;
+
+ .top_menu {
+ @include mixin.flex($justify: space-between, $align: center);
+ height: 82... | Unknown | Feeds.jsx์์ .feeds์ ๋ฐ๋ก ์์์์๊ฐ article์ด๋ผ article์ .feeds ๋ฐ๋ก ๋ค์์ ์จ์ฃผ๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ height์์๋ ์์์์๋ค์ ๋์ด์ ๋ฐ๋ผ ๊ฒฐ์ ๋๋๊น height: 100%๋ฅผ ์ฃผ์ด๋ feeds์ ๋์ด๊ฐ ๋ณํ์ง๋ ์์ ๊ฒ ๊ฐ๋ค๋ ์๊ฐ์ด ๋๋๋ฐ ํน์ ์ค์ ํ์ ์ด์ ๊ฐ ์์ผ์ ๊ฐ์? |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | ์ด ๋ ์กฐ๊ฑด์ &&๋ก ๊ฑธ๋ฉด state๋ฅผ ํ๋๋ง ์ฌ์ฉํ๊ณ validation์ ํ์ธํ ์ ์์ง ์์๊น์? => ๋ง๋ ๊ฒ ๊ฐ์ต๋๋ค.
์์ ์ ์ฝ๋์์ ์ ํจ์ฑ๊ฒ์ฌ๋ฅผ changeIdInput, changePwInput ๋ด์์ ๊ฐ๊ฐ ํด์คฌ์๋๋ฐ ํธํ์ฑ ๊ฒ์ฌ์ ๋๋ ์ด๊ฐ ์๊ฒจ์ useEffect๋ฅผ ์ฌ์ฉํ๋๊ฒ ํด๊ฒฐ์ฑ
์ด๋ผ ์๊ฐํ์ต๋๋ค. ์ด ๊ณผ์ ์์ changeIdInput, changePwInput ๋ด๋ถ์ ์ผํญ์ฐ์ฐ์๋ค์ useEffect ๋ด๋ถ๋ก ์๋ผ๋ด์ด ์ค๊ฒ ๋๋ฉด์ ๋ก์ง์ด ๊ธธ์ด์ง ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | [๊ณต์๋ฌธ์ React๋ก ์ฌ๊ณ ํ๊ธฐ](https://ko.reactjs.org/docs/thinking-in-react.html#step-3-identify-the-minimal-but-complete-representation-of-ui-state) ๋ฅผ ๋ณด์๋ฉด ์ด๋ค ๊ฐ๋ค์ด state๊ฐ ๋์ด์ผํ๋์ง์ ๋ํด ์ ํ์์ต๋๋ค. ๊ฐ๊ฐ ์ดํด๋ณด๊ณ ํด๋น ๋ฐ์ดํฐ๋ state๋ก ์ ์ ํ์ง ๋๊ธ๋ก ๋จ๊ฒจ์ฃผ์ธ์. ๊ฐ ๋ฐ์ดํฐ์ ๋ํด ์๋์ ์ธ ๊ฐ์ง ์ง๋ฌธ์ ํตํด ๊ฒฐ์ ํ ์ ์์ต๋๋ค
> 1. ๋ถ๋ชจ๋ก๋ถํฐ props๋ฅผ ํตํด ์ ๋ฌ๋ฉ๋๊น? ๊ทธ๋ฌ๋ฉด ํ์คํ state๊ฐ ์๋๋๋ค.
>
> 2. ์๊ฐ... |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | ๋ผ์ด๋ธ๋ฆฌ๋ทฐ ๋ ๋ง์๋๋ฆฐ ๊ฒ์ฒ๋ผ ์กฐ๊ฑด์ falsy, truthyํ ๊ฐ์ ์ด์ฉํด ๋ฆฌํฉํ ๋ง ํด์ฃผ์ธ์! :)
๋๋ state๋ฅผ ์ค์ผ ๊ฒฝ์ฐ ๋ถํ์ํ ์๋ ์๊ฒ ๋ค์ |
@@ -0,0 +1,66 @@
+@use '../../../styles/mixin.scss' as mixin;
+@use '../../../styles/color.scss' as clr;
+
+body {
+ background: clr.$bg-login;
+
+ .login {
+ position: relative;
+ top: -80px;
+
+ #wrapper {
+ @include mixin.flex($align: center);
+ position: relative;
+ flex-direction: column;... | Unknown | ์ ์ฝ๋๋ ์ด๋์ ์์ฑ๋๋ฉด ์ข์๊น์? |
@@ -0,0 +1,43 @@
+span.comment {
+ padding-left: 10px;
+
+ small {
+ color: #a3a3a3;
+ }
+
+ &:first-child {
+ padding: 10px;
+ font-weight: bold;
+ }
+
+ svg {
+ &.delete {
+ display: none;
+ cursor: pointer;
+ }
+
+ &.hearts {
+ color: #a3a3a3;
+ position: absolute;
+ ... | Unknown | ์์ฃผ ์ฌ์ฉ์ด ๋๋ ์ปฌ๋ฌ๊ฐ์ด๋ค์! ์ด๋ฐ ๊ฒฝ์ฐ sass variables ๊ธฐ๋ฅ์ ์ด์ฉํ๋๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,87 @@
+import React, { useState } from 'react';
+import { AiFillHeart, AiOutlineComment, AiOutlineUpload } from 'react-icons/ai';
+import { BiDotsHorizontalRounded } from 'react-icons/bi';
+import { GrBookmark } from 'react-icons/gr';
+import './Feeds.scss';
+import Comments from './Comment/Comments';
+
+exp... | Unknown | .ํด๋น ๋ถ๋ถ๋ ์ข ๋ ๋ฐ๋ณต๋๋ ๋จ์ด๋ฅผ ์ค์ผ ์ ์์์ง ๊ณ ๋ฏผํด๋ด
์๋ค.
๋๋ถ์ด ๋ถํ์ํ state๊ฐ๋ ๋ณด์ด๋ค์! ์ ๋ฆฌ๋ทฐ๋ฅผ ์ฐธ๊ณ ํด ์์ ํด์ฃผ์ธ์! |
@@ -0,0 +1,101 @@
+@use '../../../../styles/mixin.scss' as mixin;
+@use '../../../../styles/color.scss' as clr;
+
+.feeds {
+ position: relative;
+ top: 77px;
+ width: 60%;
+ margin-bottom: 80px;
+ background: #fff;
+
+ .top_menu {
+ @include mixin.flex($justify: space-between, $align: center);
+ height: 82... | Unknown | class๋ช
์ ์ด๋ค ํํ๊ฐ ์ข์๊น์?!
ํด๋น class๋ช
์ '๋์'์ ๋ํ๋ด๊ธฐ์ ํด๋์ค ๋ค์๋ณด๋ค๋ ํจ์๋ช
์ฒ๋ผ ๋๊ปด์ง๋๋ค! |
@@ -1,5 +1,98 @@
import React from 'react';
+import { useState, useEffect } from 'react';
+import { useNavigate } from 'react-router-dom';
+import './Login.scss';
-export default function Login() {
- return <div>Hello, Hyeonze!</div>;
-}
+const Login = () => {
+ const [idInput, setIdInput] = useState('');
+ const... | Unknown | - ๋ถํ์ํ ์ฃผ์์ฒ๋ฆฌ๋ ์ญ์ ํด์ฃผ์ธ์!
- ๋๋ถ์ด์ className ์์ฒด๋ฅผ '์'์ผ๋ก ์ง์ ํ๋ ๊ฒ์ ์ข์ ๋ค์ด๋ฐ์ ์๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ด๋ค ๋ค์ด๋ฐ์ด ์ ํฉํ ์ง ๊ณ ๋ฏผํ์
์ , ํด๋น ์์๊ฐ ๋ฌด์์ธ์ง๋ฅผ ์ ๋ํ๋ด๋ ๋ค์ด๋ฐ์ผ๋ก ์์ ํด์ฃผ์ธ์.
- ํ๋ฌ์ค! ์ฌ๊ธฐ์๋ ์ฌ์ฉํ์ง ์์๋ ๋๋ ์ผํญ์ฐ์ฌ์๊ฐ ์จ์ด์๋ค์! ํ์ธํด์ฃผ์ธ์ |
@@ -0,0 +1,101 @@
+@use '../../../../styles/mixin.scss' as mixin;
+@use '../../../../styles/color.scss' as clr;
+
+.feeds {
+ position: relative;
+ top: 77px;
+ width: 60%;
+ margin-bottom: 80px;
+ background: #fff;
+
+ .top_menu {
+ @include mixin.flex($justify: space-between, $align: center);
+ height: 82... | Unknown | ์ด๋ ๊ฒ ๊ฐ ์์์ background color๋ฅผ ๊ฐ๊ฐ ๋ค ๋ฃ์ด์ฃผ์ ์ด์ ๊ฐ ์์ผ์ค๊น์? |
@@ -0,0 +1,92 @@
+{
+ "stories": [
+ { "imgUrl": "images/joonyoung/stories/story1.jpg", "username": "Enna" },
+ { "imgUrl": "images/joonyoung/stories/story2.jpg", "username": "Jesy" },
+ { "imgUrl": "images/joonyoung/stories/story3.jpg", "username": "Denial" },
+ { "imgUrl": "images/joonyoung/stories/story... | Unknown | mockData king ์ค์๋๐ ์ ๋ง ๊ฐ์ฌํฉ๋๋ค. ์ธ๋ถ ๋ด์ฉ์ ์์๋ก ๋ณ๊ฒฝํ ํ, ๋ฐ์ดํฐ์ ํ์์ข ๋น๋ ค๋ค ์ฐ๊ฒ ์ต๋๋ค ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,7 @@
+package nextstep.security.role;
+
+import java.util.Collection;
+
+public interface RoleHierarchy {
+ Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities);
+} | Java | > ๊ทธ๋ฐ๋ฐ Spring Security ์ฝ๋ ์ ๋ฐ์์๋ Authority๋ฅผ ์ฃผ๋ก ์ฌ์ฉํ๋๋ฐ,
> RoleHierarchy์์ ํน๋ณํ Role์ด๋ผ๋ ์ฉ์ด๋ฅผ ์ฌ์ฉํ๋ ์ด์ ๊ฐ ๊ถ๊ธํ๋ค์.
> ์ด๋ ๊ฒ Role์ด๋ผ๋ ์ฉ์ด๋ฅผ ์ฌ์ฉํ๋ ์ด์ ๋ ์ญํ ๋ก ๋น๊ตํ๋ค๊ณ ๋ช
์์ ์ผ๋ก ๋ณด์ฌ์ฃผ๊ธฐ ์ํด์ ์ผ๊น์??
ํน์ ์ด๋ ์ฝ๋์์ `RoleHierarchy.getReachableRoles`๋ก ๋์ด์์๊น์? ์ค์ ์คํ๋ง ์ํ๋ฆฌํฐ ์ฝ๋์์๋ ๋ง์ํด์ฃผ์ ๋๋ก authority๋ผ๋ ํํ์ ์ฌ์ฉํ๊ณ ์์ด์.
```java
Collection<? extends GrantedAuthority>... |
@@ -17,6 +17,7 @@
import nextstep.security.matcher.AnyRequestMatcher;
import nextstep.security.matcher.MvcRequestMatcher;
import nextstep.security.matcher.RequestMatcherEntry;
+import nextstep.security.role.*;
import nextstep.security.userdetails.UserDetails;
import nextstep.security.userdetails.UserDetailsService... | Java | ์ ์ถ๊ฐํด์ฃผ์
จ๋ค์ ๐ |
@@ -0,0 +1,10 @@
+package nextstep.security.role;
+
+import java.util.Collection;
+
+public class NullRoleHierarchy implements RoleHierarchy {
+ @Override
+ public Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities) {
+ return authorities;
+ }
+} | Java | `RoleHierarchy`์ ์๋ฌธ๋ช
๊ทธ๋๋ก ์ด ์ธํฐํ์ด์ค์ ์ญํ ์ "์ญํ ๊ณ์ธต"์ ๋ง๋ค์ด์ฃผ๋ ๊ฒ์ด์์. ๊ทธ๋์ ๊ตฌํ์ฒด๋ค๋ ์ญํ ๊ณ์ธต์ ๋ง๋ค์ด์ฃผ๋ ๊ฒ์ผ๋ก ๊ตฌ์ฑ์ด ๋์ด์ผํ๋๋ฐ์.
`NullRoleHierarchy`์ด๋ผ๋ ๊ฒ์ null์ด๋ผ๋ ๋ง์ด ํํ๋์ด์๊ธฐ๋ํ์ง๋ง ์ง์ญํ๋ฉด "์ญํ ๊ณ์ธต์ด ์๋ค"์
๋๋ค. ๊ณ์ธต์ด ์๋ค๋ ๊ฒ์ด์ง authority๊ฐ ์๋ค๋ ๋ป์ ์๋๊ธฐ ๋๋ฌธ์ empty๋ฅผ ๋ฐํํ๊ธฐ๋ณด๋ค๋ ์ธ์
๋ ํ๋ผ๋ฉํฐ๋ฅผ ๊ทธ๋๋ก ๋ฐํํด์ฃผ๋ ๊ฒ์ด ๊ทธ ๋ชฉ์ ์ด๋ผ๊ณ ๋ณผ ์ ์์ด์. |
@@ -0,0 +1,96 @@
+package nextstep.security.role;
+
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+
+public class RoleHierarchyImpl implements RoleHierarchy {
+
+ private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
+
+ private final Map<String, Set<Grant... | Java | ```suggestion
private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
private final Map<String, Set<GrantedAuthority>> roleHierarchy;
```
์์๋ ์๋ฐ ์ปจ๋ฒค์
์ ๊ฐ์ฅ ์์ ์์ด์ผํ๊ณ , `roleHierarchy`๋ ์ ๊ทผ์ ์ด๊ฐ ํ์ํด๋ณด์ด๋ค์ :) |
@@ -0,0 +1,96 @@
+package nextstep.security.role;
+
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+
+public class RoleHierarchyImpl implements RoleHierarchy {
+
+ private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
+
+ private final Map<String, Set<Grant... | Java | `RoleHierarchyImpl`์ ๋ํ ํ
์คํธ๋ ์ถ๊ฐํด๋ณด๋ฉด ์ด๋จ๊น์? ๊ธฐ๋ฅ์ด ๋ณต์กํ ๊ฐ์ฒด์ด๋ ์ด๋ฅผ ๋ฌธ์ํํ๋ค๋ ๋๋์ผ๋ก ํ
์คํธ๋ฅผ ์ง๋ณด์
๋ ์ข์ ๊ฒฝํ์ด ๋ ๊ฒ ๊ฐ์์ :) |
@@ -0,0 +1,7 @@
+package nextstep.security.role;
+
+import java.util.Collection;
+
+public interface RoleHierarchy {
+ Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities);
+} | Java | ์ ๊ฐ ์๋ชป ์ง๋ฌธ์ ๋๋ ธ๋ค์. ์ฃ์กํฉ๋๋ค.
getReachableRoles๋ ๋ฏธ์
์ฝ๋์ ๋ถ๋ถ์ด์๋ค์. ๐
๊ทธ๋๋ Role ์ด๋ฆ์ ์ํ๋ฆฌํฐ์ RoleHierarchy์ ๊ตฌํ์ฒด ์ฝ๋์๋ ์ข
์ข
์ฌ์ฉ๋๋ ๊ฒ ๊ฐ์์
์๋ฅผ ๋ค์ด์ getReachableGrantedAuthorities ์ ๊ตฌํ ๋ฉ์๋ ์ค
``` java
Set<GrantedAuthority> lowerRoles = this.rolesReachableInOneOrMoreStepsMap.get(authority.getAuthority());
if (lowerRoles == null) {
... |
@@ -0,0 +1,10 @@
+package nextstep.security.role;
+
+import java.util.Collection;
+
+public class NullRoleHierarchy implements RoleHierarchy {
+ @Override
+ public Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities) {
+ return authorities;
+ }
+} | Java | ์ํ ์ ๋ NULL์ ์ ์ฐ์ง ๋ผ๋ ์๋ฌธ์ด ์์๋๋ฐ , ๋น ๊ถํ์ ์ฃผ๋ ๊ฒ์ด ์๋๋ผ ๋ง ๊ทธ๋๋ก RoleHierarchy ๊ฐ ์๋ค๋ผ๋ ์๋ฏธ๊ตฐ์! |
@@ -0,0 +1,96 @@
+package nextstep.security.role;
+
+import org.springframework.util.StringUtils;
+
+import java.util.*;
+
+public class RoleHierarchyImpl implements RoleHierarchy {
+
+ private static final List<GrantedAuthority> EMPTY_AUTHORITIES = Collections.emptyList();
+
+ private final Map<String, Set<Grant... | Java | ์์ ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,7 @@
+package nextstep.security.role;
+
+import java.util.Collection;
+
+public interface RoleHierarchy {
+ Collection<GrantedAuthority> getReachableRoles(Collection<GrantedAuthority> authorities);
+} | Java | ๋ค spring security์์๋ ์ธ๊ฐ์ฒ๋ฆฌ ๊ถํ(Authority)๊ฐ ์์ง๋ง, ๊ทธ ๊ถํ์ ์ญํ ๋ณ๋ก ๊ณ์ธต์ผ๋ก ๋ถ๋ฆฌํ๋ คํ๊ณ ๊ทธ๋ ๊ฒ ๋์จ ๊ฒ์ด `RoleHierarchy`๋ผ๊ณ ๋ณด์๋ฉด ๋ ๊ฒ ๊ฐ์์.
๋ ์ ๋ณด๊ฐ ๋์ผํ ์๋ ์๋๋ฐ ์ฐ์์ ์์ฒด๊ฐ ๊ถํ, ๊ถํ๋ณ ์ญํ ๋ก ํ๋ฒ ๋ ์ชผ๊ฐ์ง๋ค๊ณ ๋ณด์๋ฉด ๋ ๊ฒ ๊ฐ์ต๋๋ค.
https://docs.spring.io/spring-security/reference/servlet/authorization/architecture.html?utm_source=chatgpt.com#authz-hierarchical-roles |
@@ -0,0 +1,101 @@
+package nextstep.security.role;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullAndEmptySource;
+import org.junit.jupiter.params... | Java | junit5์์๋ ์ด๊ธฐํ ๋จ์๊ฐ ๋ฉ์๋ ๋จ์์ด๊ธฐ ๋๋ฌธ์ ๋ฐ๋ก setup์ผ๋ก ์ด๊ธฐํํด์ฃผ์ ์์ผ์
๋ ๋ฉ๋๋ค.
https://junit.org/junit5/docs/current/user-guide/#writing-tests-test-instance-lifecycle |
@@ -0,0 +1,101 @@
+package nextstep.security.role;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullAndEmptySource;
+import org.junit.jupiter.params... | Java | 1. ์ถ๊ฐํ๋ค๊ธฐ๋ณด๋ค๋ ๊ณ์ธต์ ๊ฐ์ ธ์จ๋ค์ ๋ ๊ฐ๊น์ด ํ
์คํธ๋ก ๋ณด์ด๋ค์.
2. `SimpleGrantedAuthority authority = new SimpleGrantedAuthority(target);`๋ ๊ทธ๋์ ๋ฐ์ง๊ณ ๋ณด๋ฉด ์ฃผ์ด์ง ๋ฐ์ดํฐ์ธ given์ ๋ ๊ฐ๊น์ต๋๋ค. when์๋ ํ
์คํธ๋ฅผ ์ฆ๋ช
ํ๊ณ ์ํ๋ ๋์์ ์คํ ๊ทธ์์ฒด๋ง์ ๋ฃ์ด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์.
3. expected ๋ํ given์ ๋ค์ด๊ฐ๋ ๊ฒ์ด ๋ง๊ฒ ์ฃ . 74๋ฒ๋ผ์ธ์ ๊ฐ์ ๊ทธ๋๋ก ๋ฃ๋ ๊ฒฝ์ฐ๋ ์๊ด์ด ์์ง๋ง ๊ธฐ๋๊ฐ ๋ํ ์ฃผ์ด์ง ๋ฐ์ดํฐ๋ผ๊ณ ๋ณด๋ ํธ์
๋๋ค. |
@@ -0,0 +1,101 @@
+package nextstep.security.role;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullAndEmptySource;
+import org.junit.jupiter.params... | Java | ๊ทธ๋์ ์ถ๊ฐํจ(`addImplies`)๋ฅผ ํ
์คํธํ๊ณ ์ถ๋ค๋ฉด ์ ๋ง ๊ฐ์ด ์ถ๊ฐ๋์๋์ง ๊ทธ ์์ฒด๋ง์ ํ
์คํธํ๋ ๊ฒ์ด ๋์ ์๋ ์์ด์. `private final Map<String, Set<GrantedAuthority>> rolesReachableInOneOrMoreStepsMap;`์ ์ํ๋ ๊ฐ์ด ์๋์ง ํ์ธํ๋ ๊ฒ์ผ๋ก์. |
@@ -0,0 +1,101 @@
+package nextstep.security.role;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullAndEmptySource;
+import org.junit.jupiter.params... | Java | `@CsvSource`๋ฅผ ํ์ฉํ๋ฉด ๊ธฐ๋๊ฐ์ ๋ํ ๋ถ๊ธฐ์ฒ๋ฆฌ๋ฅผ ํ
์คํธ์์ ํ์ง ์์๋ ๋ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,101 @@
+package nextstep.security.role;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullAndEmptySource;
+import org.junit.jupiter.params... | Java | ํ
์คํธ๋ก ์ด๋ค ๊ธฐ๋ฅ์ด ์๋์ง ์ ๋ณด์ด๋ค์ ๐ |
@@ -0,0 +1,101 @@
+package nextstep.security.role;
+
+import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.NullAndEmptySource;
+import org.junit.jupiter.params... | Java | ์ ์ฒด ๋์์ด ์๋ rolesReachableInOneOrMoreStepsMap ์์ฒด์ ๊ฐ์ด ์ ์ฅ๋์ด์๋์ง ํ์ธํ๋๊ฒ ์ถ๊ฐ๋์๋๊ฐ ์ ๋ํ ํ
์คํธ๋ก ๋ ์ขํ์ง๊ฒ ๋ค์! |
@@ -0,0 +1,31 @@
+package com.sparta.tentenbackend.domain.ai.entity;
+
+import com.sparta.tentenbackend.global.BaseEntity;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+impo... | Java | GenerationbType.AUTO๋ณด๋ค GenerationbType.UUID๋ก ๋ช
์์ ์ผ๋ก ํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,34 @@
+package com.sparta.tentenbackend.domain.review.entity;
+
+import com.sparta.tentenbackend.global.BaseEntity;
+import jakarta.persistence.Column;
+import jakarta.persistence.Entity;
+import jakarta.persistence.GeneratedValue;
+import jakarta.persistence.GenerationType;
+import jakarta.persistence.Id;
+... | Java | ์ ๋ถ๋ถ๋ GenerationType.UUID๋ก ๊ณ ์น๋๊ฒ ๋์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,12 @@
+.header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: fixed;
+ width: calc(430px - 48px);
+ height: 64px;
+ padding: 0 24px;
+ background-color: black;
+ color: #fff;
+ z-index: 1000;
+} | Unknown | ํผ๊ทธ๋ง ์์ width๊ฐ 430px์ด์๊ณ , ์ ์ padding์ด 24์์ด์ ์ด๋ฐ calc ์ฝ๋๊ฐ ๋์์ต๋๋ค..
โ๐ป๋ณดํต ์ด๋ ๊ฒ ์ฒ๋ฆฌํ์๋์ง, ํน์ ๋ ์ ์ฐํ ๋ฐฉ์์ด ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -4,13 +4,15 @@
"version": "0.0.0",
"type": "module",
"scripts": {
- "dev": "vite",
+ "dev": "vite --host",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest"
},
"depend... | Unknown | ๊ต์ฅํ ์ฌ์ํ์ง๋ง ์ปค๋ฐ ๋ฉ์์ง ๊ด๋ จ ๋ฆฌ๋ทฐ ๋จ๊ฒจ๋ด
๋๋ค..! ์ ๋ ํจํค์ง ๊ด๋ จ ์ค์น๋ chore๋ฅผ ์ฌ์ฉํฉ๋๋ค..! ์ด๊ฒ ์๋ฒฝํ๊ฒ ์ ํํ ์ง๋ ๊ฒ์ฆํด๋ณด์ง ์์์ผ๋, ์ฐธ๊ณ ํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์์!
[์ข์ ์ปค๋ฐ ๋ฉ์์ง ์์ฑ๋ฒ](https://velog.io/@iamjm29/Git-%EC%A2%8B%EC%9D%80-%EC%BB%A4%EB%B0%8B-%EB%A9%94%EC%8B%9C%EC%A7%80-%EC%9E%91%EC%84%B1%EB%B2%95)
[AngularJS Commit Convention](https://gist.github.com/stephenparish/... |
@@ -0,0 +1,12 @@
+.header {
+ display: flex;
+ justify-content: space-between;
+ align-items: center;
+ position: fixed;
+ width: calc(430px - 48px);
+ height: 64px;
+ padding: 0 24px;
+ background-color: black;
+ color: #fff;
+ z-index: 1000;
+} | Unknown | ๋๋ฐ ์ ์ด์ ์์์ง..? ๐ |
@@ -0,0 +1,48 @@
+package com.ioteam.order_management_platform.review.entity;
+
+import com.ioteam.order_management_platform.global.entity.BaseEntity;
+import com.ioteam.order_management_platform.review.dto.CreateReviewRequestDto;
+import com.ioteam.order_management_platform.review.dto.ReviewResponseDto;
+import jakart... | Java | P5: ๋จ์ ๊ถ๊ธ์ฆ์
๋๋ค! ๊ธฐ๋ณธ ์ง์์ด ๋ถ์กฑํ์ฌ Boolean์ default ๊ฐ์ด null์ด๊ณ , boolean์ false์ธ ๊ฒ์ด ์ฐจ์ด์ ์ด๋ผ๋ ๊ฒ๋ง ์๊ณ ์ฌ์ญค๋ณด๋ ์ .. ์ํด๋ถํ๋๋ฆฝ๋๋ค..! ๐
Boolean์ ์ฌ์ฉํ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค.
P4: ๊ณต๊ฐ ์ฌ๋ถ ๊ธฐ๋ณธ๊ฐ์ด true ์ด๋ฏ๋ก @ColumnDefault ๋ก ๊ธฐ๋ณธ๊ฐ ์ค์ ์ด ํ์ํ์ง ์์๊น์?? ๐ |
@@ -0,0 +1,48 @@
+package com.ioteam.order_management_platform.review.entity;
+
+import com.ioteam.order_management_platform.global.entity.BaseEntity;
+import com.ioteam.order_management_platform.review.dto.CreateReviewRequestDto;
+import com.ioteam.order_management_platform.review.dto.ReviewResponseDto;
+import jakart... | Java | @Ryujy ๋, ์๊ฒฌ ๊ฐ์ฌํฉ๋๋ค! @ColumnDefault ๋ก ๊ธฐ๋ณธ๊ฐ ์ค์ ํ๋ ๋ถ๋ถ์ ๋์ณค๋ค์. ์ถ๊ฐํ๊ฒ ์ต๋๋ค.
Boolean์ ์ฌ์ฉํ๋ ์ด์ ๋ ํน๋ณํ๋ ์์ต๋๋ค. |
@@ -0,0 +1,48 @@
+package com.ioteam.order_management_platform.review.entity;
+
+import com.ioteam.order_management_platform.global.entity.BaseEntity;
+import com.ioteam.order_management_platform.review.dto.CreateReviewRequestDto;
+import com.ioteam.order_management_platform.review.dto.ReviewResponseDto;
+import jakart... | Java | @Ryujy ๋ Boolean ์ฌ์ฉํ ์ด์ ๊ณต๋ถํด๋๊ณ ๊น๋จน๊ณ ์์๋ค์.
- boolean์ผ๋ก ์ฌ์ฉํ๋ ๊ฒฝ์ฐ ์๋ฐ ๋น ๊ท์ฝ์ ๋ฐ๋ฅด๋ฉด getter ๋ฉ์๋๊ฐ isXXX() ํํ๋ก ์์ฑ๋์ด์ผ ํฉ๋๋ค.
- ๊ทธ๋์ getter ๋ฉ์๋ ์๋์์ฑ(๋กฌ๋ณต, ์ธํ
๋ฆฌ์ ์ด ํ์ฉ)ํ๋ ๊ฒฝ์ฐ์ ๊ฐ์ฒด ํ๋กํผํฐ์ ๋ค์ด๋ฐ์์ ๋ฌธ์ (isXXX ์ด ์๋ XXX ํํ๋ก ๋ค์ด๋ฐ์ด ๋๋ ๋ฌธ์ )๊ฐ ๋ฐ์ํ๊ฒ ๋ฉ๋๋ค.
- ํด๊ฒฐ ๋ฐฉ์์ผ๋ก ๋ช ๊ฐ์ง๊ฐ ์กด์ฌํ๋๋ฐ( [์ ๋ธ๋ก๊ทธ์ ๊ฐ๋จํ ์ ๋ฆฌํด๋์ด์.](https://ichmww2.tistory.com/87)) ์ ๋ wrapper ํด๋์ค๋ก ์ฌ์ฉํ๋ ๊ฒ์ ์ ํธํด์... |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ๋ฉ์์ง ๊ด๋ฆฌ์ ๋ํด์ static์ด ์ข์์ง enum์ด ์ข์์ง ์ด์ผ๊ธฐ ๋๋ ๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. ํญ์ ์ด๋ค๊ฒ ๋์์ง ๊ณ ๋ฏผํด์ ๋งค๋ฒ ์ธ๋๋ง๋ค ํ๋ฒ์ ์ด๋ ๊ฒ ํ๋ฒ์ ์ ๋ ๊ฒ ํ์๊ฑฐ๋ ์. |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ์ ๋ System.out.print~์ฌ์ฉํ๋ ๋ถ๋ถ์ ์ ๋ถ ์ถ๋ ฅ์ผ๋ก ์ฌ์ฉ์์๊ฒ ๋ณด์ฌ์ง๋ ๋ถ๋ถ์ด๋ผ๊ณ ์๊ฐํด์ ๋ชจ๋ OutputView์ ์์ฑํ๊ณ ์์ต๋๋ค. ์ฌ์ค ์ฒจ์ ์ ๋ InputView์ ์จ๋ ๋ ์ง ๊ณ ๋ฏผํ๋๋ฐ ์ด ๋ถ๋ถ์ ๋ํด์๋ ์ด๋ป๊ฒ ์๊ฐํ์๋์ง ๊ถ๊ธํฉ๋๋ค. |
@@ -0,0 +1,38 @@
+package racingcar.view;
+
+import java.util.stream.Collectors;
+import racingcar.domain.RacingCar;
+import racingcar.domain.RacingCars;
+import racingcar.domain.Winner;
+
+public class OutputView {
+ private static final String RACE_RESULT_MESSAGE = "\n์คํ ๊ฒฐ๊ณผ";
+ private static final String DISTA... | Java | Winnerํด๋์ค์ getWinner()์์ ์๋ ์ฐ์ฐ์ด ๋๋ ๊ฒฐ๊ณผ๋ฅผ ๋ฆฌํดํ๋ฉด getter๋ฅผ ์ฌ์ฉํ์ง ์๊ณ ๋ ๊ฒฐ๊ณผ๋ฅผ ๋ฐ์์ฌ ์ ์๋ค๊ณ ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class CarNameTest {
+ @Parameterized... | Java | assertThatCode๋ฅผ ์ด์ฉํด์ ์์ธ๊ฐ ๋ฐ์ํ์ง ์๊ณ ์ฌ๋ฐ๋ฅด๊ฒ ๋๋์ง ํ๋ฒ ํ
์คํธ ํด๋ณด๋ ๊ฒ๋ ์ถ์ฒ ๋๋ฆฝ๋๋ค. |
@@ -0,0 +1,22 @@
+package racingcar.domain;
+
+public enum ErrorMessage {
+ ERROR("[ERROR] "),
+ INVALID_NAME_LENGTH(ERROR + "์ฐจ๋ ์ด๋ฆ์ 1-5๊ธ์ ์ฌ์ด์ฌ์ผ ํฉ๋๋ค."),
+ INVALID_NAME_TYPE(ERROR + "์ฐจ๋ ์ด๋ฆ์ ํน์๋ฌธ์๋ฅผ ํฌํจํ ์ ์์ต๋๋ค."),
+ DUPLICATED_NAME(ERROR + "์ฐจ๋ ์ด๋ฆ์ ์ค๋ณต๋ ์ ์์ต๋๋ค."),
+ INVALID_RACING_CARS_SIZE(ERROR + "๊ฒฝ์ฃผ์๋ ์ต์ 2๋์... | Java | ERROR์ ๋ณํจ ์์ ๊ฒ ๊ฐ์๋ฐ ์์๋ก ๋๊ณ ์์ฑ์ ๋ถ๋ถ์์
this.message = "ERROR" + message๋ก ํ๋ค๋ฉด ๋ฉ์์ง ์์ฑํ ๋ ์ค๋ณต์ ํผํ๋๋ฐ ๋์ ๋ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,63 @@
+package racingcar.domain;
+
+import static racingcar.domain.ErrorMessage.CANT_FIND_CAR;
+import static racingcar.domain.ErrorMessage.DUPLICATED_NAME;
+import static racingcar.domain.ErrorMessage.INVALID_RACING_CARS_SIZE;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Ra... | Java | return์ ๋ฐ๋ก ์์ฑํ๋ฉด ๊ฐ๋
์ฑ์ด ์กฐ๊ธ ๋จ์ด์ ธ ๋ณด์ผ๊น์?
์ด ๋ฉ์๋ ์ฒ๋ผ ํ๋ฒ๋ง ์ฌ์ฉํ๋ ๋ณ์๋ผ๋ฉด ๋ณ์๋ก ์ง์ ํ์ง ์๊ณ ๋ฐ๋ก ์์ฑํด๋ ๋ ๊ฒ ๊ฐ์๋ฐ...
์ด๋ฌ๋ฉด ๊ฐ๋
์ฑ์ด ๋จ์ด์ ธ ๋ณด์ด๊ธฐ๋ ํ ๊ฒ ๊ฐ์ ๊ณ ๋ฏผ์ด ๋์ ์ฌ์ญค๋ด
๋๋ค. |
@@ -0,0 +1,51 @@
+package racingcar.domain;
+
+import static racingcar.domain.ErrorMessage.INVALID_NAME_LENGTH;
+import static racingcar.domain.ErrorMessage.INVALID_NAME_TYPE;
+
+import java.util.Objects;
+import java.util.regex.Pattern;
+
+public class CarName {
+ private static final int MAX_LENGTH = 5;
+ priva... | Java | ์ ๊ทํํ์์ ๋ฌธ์์ง์ ํ ํ {1,5}์ ์ฌ์ฉํ๋ฉด ๊ธ์ ์ ์ ํ ํ๋๋ฐ๋ ๋์์ด ๋ ๊ฑฐ์์. |
@@ -0,0 +1,35 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import java.util.List;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit... | Java | 2๋ ์ด์์ธ ๊ฒฝ์ฐ / ์ด๋ฆ ์ค๋ณต๋๋ฉด ์๋๋ ๊ฒฝ์ฐ์ ๋ํด ๋ฉ์๋๋ฅผ ๋๋ ์ ํ
์คํธ ํด๋ ์ข์๊ฑฐ๊ฐ์ด๋ค |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class TurnTest {
+ @ParameterizedTes... | Java | ์ ๋ validate ๋ก์ง์ ๋ํด์
1. ์ซ์๋ง ์
๋ ฅ ๋ฐ์์ผํ๋ ๋ณ์์ ๋ฌธ์ ์
๋ ฅ๋๋ ๊ฒฝ์ฐ -> input์์ ๊ฒ์ฆ
2. 1ํ ๋ฏธ๋ง์ผ๋ก ์
๋ ฅ๋ฐ๋ ๋ฉ์๋ ๊ด๋ จ ๊ฒ์ฆ -> turn๋ฉ์๋์์ ๊ฒ์ฆ ํ๋ ๋ฐฉ์์ผ๋ก ํญ์ ์์ฑํด ์๋๋ฐ ์ด๋ถ๋ถ์ ๋ํด์ ์ด๋ป๊ฒ ์๊ฐํ๋์ง ๊ถ๊ธํฉ๋๋ค ! |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ์ ๋ ์ด๋ฒ์ ํ๋ฆฌ์ฝ์ค๋ฅผ ์งํํ๋ฉด์ ๋๋ฆ์ ๊ธฐ์ค์ ์ธ์๋ดค์ต๋๋ค!
1. enum์ผ๋ก ์ฌ์ฉํ ๋งํผ ์์์ ๊ฐ์๊ฐ ์ถฉ๋ถํ์ง? ์ต์ 3๊ฐ ์ด์
2. ํ๋ก๊ทธ๋จ์ด ํ์ฅ๋๋ค๋ฉด ํด๋น enum ์ ์์๊ฐ ์ถ๊ฐ๋ ๊ฐ๋ฅ์ฑ์ด ์๋์ง?
3. ๋ค๋ฅธ ํด๋์ค์์๋ ์ฌ์ฉ๋ ๊ฐ๋ฅ์ฑ์ด ์๋์ง? |
@@ -0,0 +1,18 @@
+package racingcar.view;
+
+import camp.nextstep.edu.missionutils.Console;
+
+public class InputView {
+ private static final String ASK_CAR_NAMES = "๊ฒฝ์ฃผํ ์๋์ฐจ ์ด๋ฆ์ ์
๋ ฅํ์ธ์.(์ด๋ฆ์ ์ผํ(,) ๊ธฐ์ค์ผ๋ก ๊ตฌ๋ถ)";
+ private static final String ASK_TURN = "์๋ํ ํ์๋ ๋ชํ์ธ๊ฐ์?";
+
+ public static String readCarNames() {
+ ... | Java | ์ ๋ ์ฒ์์ 1์ฃผ์ฐจ ๋ฏธ์
์ ์งํํ ๋๋ ์ฌ์ฉ์์๊ฒ ๋ณด์ด๋ ๋ถ๋ถ์ด๋ผ๊ณ ์๊ฐํ์ฌ OutputView์ ์์ฑํ์๋๋ฐ ๋ง์ ๋ถ๋ค ์ฝ๋๋ฅผ ๋ณด๋ค๋ณด๋ ์
๋ ฅ์ ์์ฒญํ๋ ๋ฉ์์ง๋ InputView์์ ์ฒ๋ฆฌํ์๋๋ผ๊ตฌ์. ๊ทธ๋ฆฌ๊ณ ๊ฒฐ์ ์ ์ผ๋ก ์ฐํ
์ฝ์์ ์ ๊ณตํ ์๊ตฌ์ฌํญ ๋ถ๋ถ์ ๋ณด์๋ฉด ์
๋ ฅ์ ์๊ตฌํ๋ ๋ฉ์์ง๋ฅผ InputView์์ ์ฌ์ฉํ๋๊ฑธ ๋ณด์ค ์ ์์ต๋๋ค.
<img width="914" alt="image" src="https://github.com/parksangchu/java-racingcar-6/assets/142131857/87aa54ff-07c6-4c03-87fe-331d6ab... |
@@ -0,0 +1,22 @@
+package racingcar.domain;
+
+public enum ErrorMessage {
+ ERROR("[ERROR] "),
+ INVALID_NAME_LENGTH(ERROR + "์ฐจ๋ ์ด๋ฆ์ 1-5๊ธ์ ์ฌ์ด์ฌ์ผ ํฉ๋๋ค."),
+ INVALID_NAME_TYPE(ERROR + "์ฐจ๋ ์ด๋ฆ์ ํน์๋ฌธ์๋ฅผ ํฌํจํ ์ ์์ต๋๋ค."),
+ DUPLICATED_NAME(ERROR + "์ฐจ๋ ์ด๋ฆ์ ์ค๋ณต๋ ์ ์์ต๋๋ค."),
+ INVALID_RACING_CARS_SIZE(ERROR + "๊ฒฝ์ฃผ์๋ ์ต์ 2๋์... | Java | enum ์์ฑ์์ ๋ํ ์ดํด๊ฐ ๋ถ์กฑํ๋๊ฒ ๊ฐ์ต๋๋ค ! ์ข์ ์กฐ์ธ ๊ฐ์ฌํฉ๋๋ค ใ
ใ
|
@@ -0,0 +1,63 @@
+package racingcar.domain;
+
+import static racingcar.domain.ErrorMessage.CANT_FIND_CAR;
+import static racingcar.domain.ErrorMessage.DUPLICATED_NAME;
+import static racingcar.domain.ErrorMessage.INVALID_RACING_CARS_SIZE;
+
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Ra... | Java | ์ ๊ฐ 3์ฃผ์ฐจ ๋ฏธ์
์ ํ ๋ ๊ฒช์๋ ์๋ก์ฌํญ์ด ๋ฉ์๋๋ด ๋ชจ๋ ์ฝ๋๋ฅผ ์ถ์ฝ์ ์ํค๋ค๋ณด๋ ๋์ค์ ์ ๊ฐ ๊ทธ ์ฝ๋๋ฅผ ๋ณด์์๋ ๋ฌด์จ ์ฝ๋์ธ์ง ํ๋์ ์๊ธฐ๊ฐ ํ๋ค๋๊ตฐ์ ใ
ใ
๊ทธ๋์ 4์ฃผ์ฐจ๋๋ถํฐ๋ ์ด๋์ ๋ ์ ์ ํด์ ์ถ์ฝ์ ํด๋ณด๋ ๊ฐ๋
์ฑ์ด ํจ์ฌ ๋์์ก์๋ ๊ฒฝํ์ด ์์ด์ ์ด๋ฒ์๋ ์ด๋ฐ ๋ฐฉ์์ผ๋ก ์งํ์ ํด๋ดค์ต๋๋ค! |
@@ -0,0 +1,38 @@
+package racingcar.view;
+
+import java.util.stream.Collectors;
+import racingcar.domain.RacingCar;
+import racingcar.domain.RacingCars;
+import racingcar.domain.Winner;
+
+public class OutputView {
+ private static final String RACE_RESULT_MESSAGE = "\n์คํ ๊ฒฐ๊ณผ";
+ private static final String DISTA... | Java | ๋ฐ์์จ ๋ฐ์ดํฐ๋ฅผ ์ด๋ค์์ผ๋ก ์ฒ๋ฆฌํ ์ง ๊ฒฐ์ ํ๋ ๊ฒ์ OutputView์ ์ฑ
์์ด๋ผ๊ณ ์๊ฐํด์ ํด๋น ๋ฐฉ์์ผ๋ก ์งํํ์ต๋๋ค~
3์ฃผ์ฐจ ๊ณตํต ํผ๋๋ฐฑ์์๋ view์์ ์ฌ์ฉํ๋ ๋ฐ์ดํฐ๋ getter๋ฅผ ์ฌ์ฉํ๋ผ๊ณ ์ธ๊ธ์ด ๋์ด์๊ตฌ์!
<img width="619" alt="image" src="https://github.com/parksangchu/java-racingcar-6/assets/142131857/99c1b2c6-7c6d-49ee-8154-e9d7c306bd0b"> |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class CarNameTest {
+ @Parameterized... | Java | ์ฒ์ ๋ณด๋ ๋ฉ์๋์๋๋ฐ ํ๋ฒ ์ฌ์ฉํด๋ณด๊ฒ ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค ใ
ใ
|
@@ -0,0 +1,35 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThat;
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import java.util.List;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import org.junit... | Java | ์ฝ๋๋ฅผ ์ค์ด๋ ค๊ณ ๋๋ฌด ์์ฌ์ ๋ด๋ค๋ณด๋ ๊ทธ๋ง ... ใ
์๋ฌด๋๋ ๋ฐ๋ก ํ
์คํธํ๋๊ฒ ๊ฐ๋
์ฑ ์ธก๋ฉด์์๋ ์ข์๊ฑฐ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,17 @@
+package racingcar.domain;
+
+import static org.assertj.core.api.AssertionsForClassTypes.assertThatThrownBy;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.ValueSource;
+
+class TurnTest {
+ @ParameterizedTes... | Java | ์ ๋ ์๋๋ ๊ทธ๋ฐ ๋ฐฉ์์ผ๋ก ๊ฒ์ฆ์ ์งํํด์ค๋ค๊ฐ ์ด๋ฒ์ 'InputView์์ domain์์ ์ฐ์ผ ๋ฐ์ดํฐ ํํ๋ฅผ ์๋๊ฒ ๋ง์๊น?'ํ๋ ์๋ฌธ์ด ๋ค์ด ํด๋น ๋ฐฉ์์ผ๋ก ์งํ์ ํด๋ดค์ต๋๋ค. ๊ทธ๋ฆฌ๊ณ 'RacingCar'์ ๊ฐ์ ํด๋น ํ๋ก๊ทธ๋จ์ ๋๋ฉ์ธ์์ ์ฐ์ด๋ ๊ฐ์ฒด๋ฅผ ์์ฑํด์ ๋๊ธฐ๋ ๊ฒ๋ง ์๋๋ผ๋ฉด int์ ๊ฐ์ ๊ธฐ๋ณธ๊ฐ ํํ๋ inputView์์ ๊ฒ์ฆํด๋ ๊ด์ฐฎ๊ฒ ๋ค๋ผ๋ ๊ฒฐ๋ก ์ ๋์ต๋๋ค. |
@@ -0,0 +1,14 @@
+<!DOCTYPE html>
+<html lang="en">
+ <head>
+ <meta charset="UTF-8" />
+ <link rel="icon" type="image/svg+xml" href="/vite.svg" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+ <title>react-shopping-products</title>
+ <script type="module" crossorigin src=... | Unknown | dist ํด๋๊ฐ git ignore๋์ง ์์๊ตฐ์ฉ |
@@ -0,0 +1,10 @@
+/**
+ * generateBasicToken - Basic auth๋ฅผ ์ํ ํ ํฐ์ ๋ง๋๋ ํจ์์
๋๋ค.
+ * @param {string} userId - USERNAME์
๋๋ค.
+ * @param {string} userPassword - PASSWORD์
๋๋ค.
+ * @returns {string}
+ */
+export function generateBasicToken(userId: string, userPassword: string): string {
+ const token = btoa(`${userId}:${userPas... | TypeScript | ์ฌ์ธํ jsdocs ๐๐๐๐ |
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ๊ณตํต ๋ก์ง์ ๋ฌถ์ด์ฃผ๋ ๊ฒ ๋๋ฌด ์ข์ต๋๋ค~! |
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ์ฅ๋ฐ๊ตฌ๋์ 100๊ฐ ๋๊ฒ ๋ด์ ์ ์๋ case๊ฐ ์กด์ฌํ ๊ฒ ๊ฐ์์~! |
@@ -0,0 +1,50 @@
+.loaderContainer {
+ height: 60px;
+ display: flex;
+ justify-content: center;
+ align-items: center;
+}
+
+.loader {
+ width: 60px;
+ display: flex;
+ justify-content: space-evenly;
+}
+
+.ball {
+ list-style: none;
+ width: 12px;
+ height: 12px;
+ border-radius: 50%;
+ background-color: ... | Unknown | ๊ท์ฌ์ด ์ ๋๋ฉ์ด์
์ ๋ง๋ค์๊ตฐ์ฉ ๐๐๐ |
@@ -0,0 +1,15 @@
+export const productCategories = {
+ all: '์ ์ฒด',
+ fashion: 'ํจ์
',
+ beverage: '์๋ฃ',
+ electronics: '์ ์์ ํ',
+ kitchen: '์ฃผ๋ฐฉ์ฉํ',
+ fitness: 'ํผํธ๋์ค',
+ books: '๋์',
+} as const;
+
+export const sortOptions = { priceAsc: '๋ฎ์ ๊ฐ๊ฒฉ์', priceDesc: '๋์ ๊ฐ๊ฒฉ์' } as const;
+
+export const FIRST_FETCH_PAGE = 0;
+... | TypeScript | ์์ํ ๐๐๐ |
@@ -0,0 +1,32 @@
+import React, { createContext, useState, useCallback, ReactNode } from 'react';
+import ErrorToast from '../components/ErrorToast/ErrorToast';
+
+export interface ToastContextType {
+ showToast: (message: string) => void;
+}
+
+export const ToastContext = createContext<ToastContextType | undefined>(u... | Unknown | ๋ณ๋์ Provider๋ก ๋ง๋ค์ด ์ค ๊ฒ ๋๋ฌด ์ข๋ค์ |
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ๋ง์์... ์์๋ฐฉํธ์ด์๋๋ฐ ๊ทธ๋ฅ ๊น๋จน๊ณ ๋์ด๊ฐ๋ค์ ใ
ใ
|
@@ -0,0 +1,95 @@
+import { CartItemType, ProductType } from '../types';
+import { generateBasicToken } from './auth';
+
+const API_URL = import.meta.env.VITE_API_URL;
+const USER_ID = import.meta.env.VITE_USER_ID;
+const USER_PASSWORD = import.meta.env.VITE_USER_PASSWORD;
+
+/**
+ * ๊ณตํต ์์ฒญ์ ์ฒ๋ฆฌํ๋ ํจ์
+ * @param {string} e... | TypeScript | ๊ทธ๋ฐ๋ฐ.. ์ด๋ฒ ์ฅ๋ฐ๊ตฌ๋ api๋ 20๊ฐ๋ง ๋ด์ ์ ์๊ฒ ๋ง๋ค์ด์ ธ์๋๋ผ๊ตฌ์..
์ง๊ธ api ๊ตฌํ์ฌํญ์ ๋ง์ถ์ง, ์๋๋ฉด ๋ฏธ๋์ ๋ณ๊ฒฝ์๋ ์ฉ์ดํ๊ฒ ์ฝ๋๋ฅผ ๋ฐ๊ฟ์ง๋ ์๊ฐํด ๋ด์ผํ ๋ฌธ์ ์ธ ๊ฒ ๊ฐ์์.
์ด ๋ถ๋ถ์ ๋ฐ๊ฟ์ผ ํ๋ค๋ฉด
์์
>if (key === 'category' && value === 'all')
์ด ์ฝ๋์์๋ default๋ก ๋ค์ด๊ฐ ์ ์๋ sort=id,asc๋ ์๊ฐํด๋ด์ผ ํ ๊ฒ ๊ฐ๊ณ ์ |
@@ -0,0 +1,21 @@
+import { SelectHTMLAttributes, PropsWithChildren } from 'react';
+import styles from './Select.module.css';
+
+interface Props extends PropsWithChildren<SelectHTMLAttributes<HTMLSelectElement>> {
+ options: Record<string, string>;
+}
+
+const Select = ({ options, defaultValue, children, ...props }: P... | Unknown | entries๋ผ๋ ํจ์๋ ์์ผ๋ ์ฐพ์๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์..!
``` js
Object.entries(options).map([optionEn,optionKo])=>{
...
}
``` |
@@ -0,0 +1,11 @@
+package baseball.util;
+
+import java.util.Random;
+
+public class RamdomNumberGenerator {
+ private static final Random RANDOM = new Random();
+
+ public static Integer generate() {
+ return RANDOM.nextInt(9) + 1;
+ }
+} | Java | ๋ฌด์์์ ์ซ์๋ฅผ ์์ฑํ๋ ํด๋์ค๋ฅผ ๋ฐ๋ก ๋นผ์ ํ
์คํธ๋ฅผ ์ฉ์ดํ๊ฒ ํ ์ ์๊ฒ ํ ๊ฒ ์ข๋ค์! |
@@ -0,0 +1,101 @@
+package baseball.domain;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+public class NumericBalls implements Iterable {
+ private List<NumericBall> numericBalls;
+
+ public NumericBalls() {
+ numericBalls = new ArrayList<>();
+ }
+
+ publi... | Java | ๋ฆฌ์คํธ์ ๋ฃ๊ณ ๋งต์ ๋ค์ ๋ฃ๋ ๊ฒ๋ณด๋ค ์ฒ์๋ถํฐ ํ๋๋ฅผ ๋งต์ผ๋ก ์ ์ธํ๊ณ ๋งต์ ์ซ์์ ์ธ๋ฑ์ค๋ฅผ ๋น๊ตํ๋ฉด ํจ์จ์ด ๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,23 @@
+package baseball.view;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Scanner;
+
+public class InputView {
+ private static final Scanner SCANNER = new Scanner(System.in);
+ public static List<Integer> inputNumbers() {
+ System.out.println("์ซ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์ : ");
+ List<Integer>... | Java | ๊ฐ์ฒด๋ฅผ ์์๋ก ์ ์ธํ๋ฉด ์ฝ๋๊ฐ ํจ์ฌ ๊ฐํธํด์ง์ง๋ง, final์์๋ ๊ฐ์ด ๋ฐ๋ ์ ์์ด ๊ด๋ จ์ด์๊ฐ ์์ ์๋ ์์ต๋๋ค. ์ ์ํ๊ณ ์ฌ์ฉํด์ฃผ์ธ์:) |
@@ -0,0 +1,40 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import nextstep.security.core.Authentication;
+imp... | Java | BasicAuthenticationFilter ํํฐ๋ฅผ ์์ฑํ ๋ UserDetailsService ๋์ AuthenticationManager๋ฅผ ์ฃผ์
๋ฐ์ผ๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,35 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import java.util.Map;
+import nextstep.security.core.Authentication;
+import nextstep.s... | Java | ์ฌ๊ธฐ๋ ๋ง์ฐฌ๊ฐ์ง๋ก UserDetailsService ๋์ AuthenticationManager๋ฅผ ์ฃผ์
๋ฐ์ผ๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,40 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import nextstep.security.core.Authentication;
+imp... | Java | Authentication ์์ฑ์ ์ฑ
์์ ๋ณ๋์ ํด๋์ค๋ก ๋ถ๋ฆฌํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,40 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import java.io.IOException;
+import nextstep.security.core.Authentication;
+imp... | Java | convert ๋ฉ์๋๋ Token์ผ๋ก ๋ณํํด์ฃผ๋ ์ญํ ๋ง ํ๋ฉด ์ด๋จ๊น์? |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.