code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | int ๊ฐ์ผ๋ก ๋ฐํํ๋ ๋ฉ์๋๋ก ์ฒ์ ๊ตฌํํ์๋๋ฐ ๋ฆฌํฉํ ๋ง ๊ณผ์ ์์ boolean ํ์
์ผ๋ก ๋ฐ๊ฟ๋ ๊น๋นกํ ๊ฒ๊ฐ๋ค์.. ์ค์ํ์ง ์๋๋ก ์ฃผ์ํ๊ฒ ์ต๋๋ค |
@@ -1,20 +1,36 @@
package model;
+import java.util.ArrayList;
import java.util.List;
public class Lotto {
- private List<String> lottoNumbers;
+ private List<LottoNo> lottoNumbers;
- public Lotto(List<String> lottoNumbers) {
+ public Lotto(List<LottoNo> lottoNumbers) {
this.lottoNumbers ... | Java | set๊ณผ List์ ๊ฐ์ฅ ํฐ ์ฐจ์ด์ ์ ์ค๋ณต์ ํ์ฉํ๋์ง ์ํ๋์ง๋ก ์๊ณ ์์ต๋๋ค.
์ด๋ถ๋ถ์์ set์ ํ์ฉํ์๋ ๋ก๋ ๋ฒํธ๊ฐ 6๊ฐ๊ฐ ๋ ๋๊น์ง ๋๋ค ์ซ์๋ฅผ ๋ฐ๋ ๋ฐฉ๋ฒ์ด ์๊ฒ ๋ค์ ์๋ํด๋ณด๊ฒ ์ต๋๋ค. |
@@ -0,0 +1,33 @@
+package com.hansarangdelivery.config;
+
+import com.hansarangdelivery.entity.PageType;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.data.domain.PageRequest;
+import org.springframework.data.domain.Pageable;
+import org.springframework.data.domain.Sort;
+imp... | Java | ์ด ๋ถ๋ถ์์ size๋ฅผ 10,30,50 ์ ์ฉ์์ผ์ผ ํ ๊ฒ ๊ฐ์์ |
@@ -1,5 +1,12 @@
+import EventController from "./controller/EventController.js";
+
class App {
- async run() {}
+ constructor() {
+ this.eventController = new EventController();
+ }
+ async run() {
+ await this.eventController.eventStart();
+ }
}
export default App; | JavaScript | App ์์ฒด๊ฐ Controller๋ผ๊ณ ์๊ฐํ๊ณ ๊ตฌํ์ ํ๋ ๋ฐฉ๋ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,111 @@
+import { MENU, MESSAGE, ARRAY, CALENDAR, BENEFIT_AMOUNT, BADGE, BOUNDARY } from "../commons/constants.js";
+import Order from "./Order.js";
+import { getMenu, getMenuCount } from "../commons/utils.js";
+
+class Benefit {
+ #date;
+ #menu;
+ #order;
+ #benefitResult;
+
+ constructor(date, menu) {... | JavaScript | benefitResult๋ฅผ Obejct๋ก ๊ตฌํํ๋ฉด ์ข ๋ ๊ฐ๋
์ฑ์ด ์ข์ง ์์๊น ์ถ์ต๋๋ค |
@@ -0,0 +1,88 @@
+import Benefit from "../src/model/Benefit.js";
+import { orderIntoArray } from "../src/commons/utils.js";
+
+describe("Benefit ํด๋์ค ํ
์คํธ(ํํ ์๋ ๊ฒฝ์ฐ)", () => {
+ //given
+ const date = "3";
+ const menu = orderIntoArray("ํฐ๋ณธ์คํ
์ดํฌ-1,๋ฐ๋นํ๋ฆฝ-1,์ด์ฝ์ผ์ดํฌ-2,์ ๋ก์ฝ๋ผ-1");
+ const benefit = new Benefit(date, menu);
+
+ ... | JavaScript | ํ
์คํธ๊ฐ ๋๋ฌด ํ์ ๋์ด ์๋๊ฒ ๊ฐ์ต๋๋ค test.each๋ฅผ ์ฌ์ฉํ์ฌ ์ข ๋ ๋ฒ์์ฑ ์๊ฒ ํ
์คํธ๋ฅผ ๊ตฌํํ๋ ๋ฐฉ๋ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,63 @@
+import InputView from "../view/InputView.js";
+import OutputView from "../view/OutputView.js";
+import Order from "../model/Order.js";
+import Benefit from "../model/Benefit.js";
+import { print } from "../commons/utils.js";
+import { MENU } from "../commons/constants.js";
+
+class EventController {
+... | JavaScript | ๊ฐ๊ฐ์ ๋๋ ํ ๋ฆฌ์ index.js ๋ฅผ ์ถ๊ฐํ๊ณ , ๊ณตํต๋๊ฒ export ์ํค๋ฉด, import ๋ฅผ ๊ฐ๋จํ๊ฒ ํ ์ ์์ต๋๋ค!
*view/index.js*
```javascript
export {default as InputView.js} from './InputView.js'
export {default as OutputView.js} from './OutputView.js'
```
*EventController.js*
```javascript
import { InputView, OutputView } '../view/index.js'
``` |
@@ -0,0 +1,111 @@
+import { MENU, MESSAGE, ARRAY, CALENDAR, BENEFIT_AMOUNT, BADGE, BOUNDARY } from "../commons/constants.js";
+import Order from "./Order.js";
+import { getMenu, getMenuCount } from "../commons/utils.js";
+
+class Benefit {
+ #date;
+ #menu;
+ #order;
+ #benefitResult;
+
+ constructor(date, menu) {... | JavaScript | ```javascript
this.#benefitResult = Array.from({length:5(ํํ์ ๊ธธ์ด๋ฅผ ๋ํ๋ด๋ ์์๋ก ์์ )}, () => 0)
```
์ ๊ฐ์ด ๋ฐ๊พธ๋ ๊ฒ์ ์ด๋จ๊น์? |
@@ -0,0 +1,111 @@
+import { MENU, MESSAGE, ARRAY, CALENDAR, BENEFIT_AMOUNT, BADGE, BOUNDARY } from "../commons/constants.js";
+import Order from "./Order.js";
+import { getMenu, getMenuCount } from "../commons/utils.js";
+
+class Benefit {
+ #date;
+ #menu;
+ #order;
+ #benefitResult;
+
+ constructor(date, menu) {... | JavaScript | ํด๋์ค ๋ถ๋ฆฌ์ ๋๋ฌด ์ง์คํ๋๋ผ
ํํ์ ํ์ธํ๋ ํด๋์ค์ ํํ์ ์ ์ฉํ๋ ํด๋์ค๋ก ๋ถ๋ฆฌํด์ ์์ฑํ์๋๋ฐ,
ํ๋์ ํด๋์ค์ ๋ฌถ์ด์ ์์ฑํ๋ ๊ฒ๋ ๊ด์ฐฎ์ ๋ณด์ด๋ค์๐ |
@@ -0,0 +1,63 @@
+import InputView from "../view/InputView.js";
+import OutputView from "../view/OutputView.js";
+import Order from "../model/Order.js";
+import Benefit from "../model/Benefit.js";
+import { print } from "../commons/utils.js";
+import { MENU } from "../commons/constants.js";
+
+class EventController {
+... | JavaScript | Controller์ ํ๋๋ model์ ํ๋๋ฅผ ํตํด ๋ถ๋ฌ์ฌ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค!
ํ๋๋ฅผ ์ค์ฌ๋ณด๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,63 @@
+import InputView from "../view/InputView.js";
+import OutputView from "../view/OutputView.js";
+import Order from "../model/Order.js";
+import Benefit from "../model/Benefit.js";
+import { print } from "../commons/utils.js";
+import { MENU } from "../commons/constants.js";
+
+class EventController {
+... | JavaScript | ERROR์ ์ถ๋ ฅ๋ util ์ด ์๋ OutputView ์์ ํด์ฃผ๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,56 @@
+import { print, priceToString } from "../commons/utils.js";
+import { MESSAGE, ARRAY, BENEFIT_AMOUNT } from "../commons/constants.js";
+
+const OutputView = {
+ printStart() {
+ print(MESSAGE.START);
+ },
+
+ printOrderInformation(date, menu) {
+ print(MESSAGE.MONTH + date + MESSAGE.SHOW_BENE... | JavaScript | else ๋ฅผ ์ง์ํ๋ผ๋ ์๊ตฌ์ฌํญ์ด ์์ด์,
์์ if๋ฌธ์ return ํด์ฃผ๋ ๋ฐฉ์์ ์ถ์ฒํฉ๋๋ค! |
@@ -1,8 +1,8 @@
export type User = {
id: number;
- email: string;
+ email?: string;
name: string;
- companyName: string;
+ companyName?: string;
image: string | null;
};
@@ -13,3 +13,52 @@ export type GatheringParticipant = {
joinedAt: string;
User: User;
};
+
+export type ReviewQuery = {
+ gat... | TypeScript | _:hammer_and_wrench: Refactor suggestion_
**์ค๋ณต๋๋ ํ์
์ ์ ํตํฉ ํ์**
`ReviewsResponse`์ `ReviewData` ํ์
์ด ๋์ผํ ๊ตฌ์กฐ๋ฅผ ๊ฐ์ง๊ณ ์์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ํ์
์ ํตํฉํ๋ ๊ฒ์ด ์ข๊ฒ ์ต๋๋ค:
```diff
-// ์ค์ ๋ฐ์ดํฐ ์๋ต๊ฐ
-export type ReviewsResponse = {
- data: Review[];
- totalItemCount: number;
- currentPage: number;
- totalPages: number;
-};
-
-// ๋ฆฌ๋ทฐ ์ ์ ๋ฐ์ดํฐ
-exp... |
@@ -0,0 +1,54 @@
+import { useMemo } from "react";
+import Arrow from "@/images/arrow.svg";
+import { cn } from "@/utils/classnames";
+
+type PaginationProps = {
+ currentPage: number;
+ totalPages: number;
+ onClick: (page: number) => void;
+ pageLimit?: number;
+};
+
+export default function Pagination({ currentP... | Unknown | _:hammer_and_wrench: Refactor suggestion_
**๋ค์ ํ์ด์ง ๊ทธ๋ฃน ๋ฒํผ ์ ๊ทผ์ฑ ๊ฐ์ ํ์**
๋ค์ ํ์ด์ง ๊ทธ๋ฃน ๋ฒํผ์๋ ์ ์ ํ aria ๋ ์ด๋ธ์ด ํ์ํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ๊ฐ์ ํด๋ณด์ธ์:
```diff
<button
onClick={() => onClick(currentStartPage + pageLimit)}
disabled={currentStartPage + pageLimit > totalPages}
+ aria-label="๋ค์ ํ์ด์ง ๊ทธ๋ฃน์ผ๋ก ์ด๋"
>
... |
@@ -0,0 +1,54 @@
+import { useMemo } from "react";
+import Arrow from "@/images/arrow.svg";
+import { cn } from "@/utils/classnames";
+
+type PaginationProps = {
+ currentPage: number;
+ totalPages: number;
+ onClick: (page: number) => void;
+ pageLimit?: number;
+};
+
+export default function Pagination({ currentP... | Unknown | _:hammer_and_wrench: Refactor suggestion_
**ํ์ด์ง ๋ฒํผ ์ ๊ทผ์ฑ ๋ฐ ํ์ฌ ํ์ด์ง ํ์ ๊ฐ์ ํ์**
ํ์ด์ง ๋ฒํผ์ ํ์ฌ ํ์ด์ง ํ์์ aria ์์ฑ์ด ๋ถ์กฑํฉ๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ๊ฐ์ ํด๋ณด์ธ์:
```diff
{pages.map((page) => (
<button
key={page}
onClick={() => onClick(page)}
+ aria-label={`${page}ํ์ด์ง๋ก ์ด๋`}
+ aria-current={current... |
@@ -0,0 +1,54 @@
+import { useMemo } from "react";
+import Arrow from "@/images/arrow.svg";
+import { cn } from "@/utils/classnames";
+
+type PaginationProps = {
+ currentPage: number;
+ totalPages: number;
+ onClick: (page: number) => void;
+ pageLimit?: number;
+};
+
+export default function Pagination({ currentP... | Unknown | _:hammer_and_wrench: Refactor suggestion_
**์ ๊ทผ์ฑ ๊ฐ์ ํ์**
ํ์ด์ง๋ค์ด์
๋ฒํผ์ ์ ์ ํ aria ๋ ์ด๋ธ์ด ์์ต๋๋ค.
๋ค์๊ณผ ๊ฐ์ด ์ ๊ทผ์ฑ์ ๊ฐ์ ํด๋ณด์ธ์:
```diff
- <button onClick={() => onClick(currentStartPage - pageLimit)} disabled={currentPage <= pageLimit}>
+ <button
+ onClick={() => onClick(currentStartPage - pageLimit)}
+ disabled... |
@@ -1,8 +1,8 @@
export type User = {
id: number;
- email: string;
+ email?: string;
name: string;
- companyName: string;
+ companyName?: string;
image: string | null;
};
@@ -13,3 +13,52 @@ export type GatheringParticipant = {
joinedAt: string;
User: User;
};
+
+export type ReviewQuery = {
+ gat... | TypeScript | ReviewData๋ ๋ณด๊ธฐ์๋ ReviewsResponse๋ ๊ฐ์ ๋ณด์ด๋๋ฐ ๋ฌด์จ ์ฉ๋์ ํ์
์ธ๊ฐ์? |
@@ -1,8 +1,8 @@
export type User = {
id: number;
- email: string;
+ email?: string;
name: string;
- companyName: string;
+ companyName?: string;
image: string | null;
};
@@ -13,3 +13,52 @@ export type GatheringParticipant = {
joinedAt: string;
User: User;
};
+
+export type ReviewQuery = {
+ gat... | TypeScript | ReviewsResponse๋ ์ค์ ์๋ต ๋ฐ์ดํฐ ํ์
์ด๊ณ ReviewData๋ ์์๋ก ํด๋
ผ ๊ฑด๋ฐ ์ง๊ธ ์ฝ๋ ๋ฆฌํฉํ ๋ง ๋ง์น๋ฉด ํ์
์ ๋ฆฌํ ๊ฒ ๊ฐ์์ต.. |
@@ -1,8 +1,8 @@
export type User = {
id: number;
- email: string;
+ email?: string;
name: string;
- companyName: string;
+ companyName?: string;
image: string | null;
};
@@ -13,3 +13,52 @@ export type GatheringParticipant = {
joinedAt: string;
User: User;
};
+
+export type ReviewQuery = {
+ gat... | TypeScript | ๋ต ์๊ฒ ์ต๋๋ค. |
@@ -0,0 +1,135 @@
+package christmas.validator;
+
+import christmas.constant.Constants;
+import christmas.constant.ErrorMessage;
+import christmas.constant.Menu;
+import christmas.util.Utils;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+impo... | Java | https://www.inflearn.com/questions/819415/verify-validate-check-is
verify, validate, check, is ์ ๋ค์ด๋ฐ ์ฐจ์ด์ ๋ํด์ ์ค๋ช
ํ๋ ๊ธ์ธ๋ฐ ์ฐธ๊ณ ํ์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,25 @@
+package christmas.validator;
+
+import christmas.constant.ErrorMessage;
+
+public class DateValidator implements Validator{
+ @Override
+ public void check(final String input) {
+ checkInteger(input);
+ checkOutOfRange(input);
+ }
+
+ private void checkInteger(final String in... | Java | 1๊ณผ 31์ด ๋งค์ง๋๋ฒ๋ผ๊ณ ์๊ฐํด์! ์์๋ก ๋นผ์ฃผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,28 @@
+package christmas.domain;
+
+import christmas.util.Utils;
+import christmas.view.OutputView;
+
+public class OrderPrice {
+ // ๊ธ์ก๊ณผ ๊ด๋ จ๋ ํด๋์ค์
๋๋ค.
+ // ํ ์ธ ์ ์ด ์ฃผ๋ฌธ๊ธ์ก, ํ ์ธ ํ ์์ ๊ฒฐ์ ๊ธ์ก ๋ฑ์ ๊ด๋ฆฌํ๋ ํด๋์ค ์
๋๋ค.
+ private static final String UNIT = "์";
+ private OrderRepository orders;
+ private int total... | Java | '์' ๊ฐ์ ๋จ์๋ ์ถ๋ ฅ ๋ฐ ํฌ๋งคํ
๊ณผ ๊ด๊ณ์์ผ๋ฏ๋ก OutputView์ ์๋ ๊ฒ์ด ์ข ๋ ์ ์ ํ๋ค๊ณ ์๊ฐํ๋๋ฐ ์ด๋ป๊ฒ ์๊ฐํ์๋์??ใ
ใ
|
@@ -0,0 +1,40 @@
+package christmas.domain;
+
+import christmas.view.OutputView;
+
+public class EventBadge {
+ // ์ด๋ฒคํธ ๋ฑ์ง๋ฅผ ๊ด๋ฆฌ ํ๋ ํด๋์ค ์
๋๋ค.
+ private static final int SANTA_MINIMUM_LIMIT = 20000;
+ private static final int TREE_MINIMUM_LIMIT = 20000;
+ private static final int STAR_MINIMUM_LIMIT = 20000;
+ ... | Java | ์ฒ์๋ณด๋ ์ฌ๋์ discountAmount์ -๋ฅผ ์ ๋ถ์ด์ง? ๋ผ๊ณ ์๊ฐํ ์ ์๋ค๊ณ ์๊ฐํฉ๋๋ค!
์ ๋ ๋น์ทํ๊ฒ ๊ตฌํํ๊ณ ํผ๋๋ฐฑ์ ๋ฐ์๋๋ฐ
๋ณ์์ด๋ฆ๊ณผ final์ ์ด์ฉํด -๋ฅผ ๋ถ์ธ ๋ณ์๊ฐ ๋ฌด์์ ๋ปํ๋์ง ํ๋ฒ ๋ ์ ์ํด์ฃผ๋ ๊ฒ๋ ์ข๋ค๊ณ ์๊ฐํด์! |
@@ -0,0 +1,178 @@
+package christmas.domain;
+
+import christmas.constant.Constants;
+import christmas.constant.Menu;
+import christmas.constant.MenuType;
+import christmas.util.Utils;
+import christmas.view.OutputView;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.util.ArrayList;
+import java.... | Java | ๋งค์ง๋๋ฒ๊ฐ ๋ง์ด ์ฐ์ธ ๊ฒ ๊ฐ์ต๋๋ค! ์์์ ์์๋ก ์ ์ธํด์ฃผ๋ฉด ์ข์ ๊ฒ ๊ฐ์์~!! |
@@ -0,0 +1,105 @@
+package christmas.controller;
+
+import christmas.domain.BenefitInformation;
+import christmas.domain.Date;
+import christmas.domain.EventBadge;
+import christmas.domain.GiftMenu;
+import christmas.domain.Order;
+import christmas.domain.OrderManager;
+import christmas.domain.OrderPrice;
+import chris... | Java | ๋๋ฉ์ธ๋ณด๋ค๋ controller์์ outputView๋ฅผ ํธ์ถํด์ฃผ๋ ๊ตฌ์กฐ๊ฐ ๋์ด์ผํ๋ค๊ณ ์๊ฐํฉ๋๋ค ใ
ใ
๋ง์ฝ mvc ๊ตฌ์กฐ๋ผ๋ฉด์!! |
@@ -0,0 +1,21 @@
+package christmas.constant;
+
+public enum Constants {
+ EVENT_START_DATE(1),
+ EVENT_END_DATE(25),
+ MENU_LIMIT(20),
+ CHAMPAGNE_LIMIT(120000),
+ MINIMUM_DISCOUNT_ABLE_AMOUNT(10000),
+ THIS_YEAR(2023),
+ EVENT_MONTH(12);
+
+ public int constants;
+
+ Constants(final int con... | Java | ํด๋น ์์ ๊ฐ๋ค์ ํ์ํ ๊ฐ ๋๋ฉ์ธ์ด ๋ค๊ณ ์๋ ๊ฒ์ ์ด๋ค๊ฐ์~~?? ๊ทธ๋ ๊ฒ ํ๋ฉด ํด๋์ค์ ์์ง๋๋ฅผ ์กฐ๊ธ ๋ ๋์ผ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,13 @@
+package christmas.domain;
+
+public class Date {
+ private int date;
+
+ public Date(final int date) {
+ this.date = date;
+ }
+
+ public int getDate() {
+ return this.date;
+ }
+}
\ No newline at end of file | Java | ํด๋น ํด๋์ค๊ฐ ์กด์ฌํ๋ ์ด์ ๊ฐ ์๋์?!! ํด๋์ค๋ก์ ์์ ํ๋ ค๋ฉด Date์ ๊ด๋ จ๋ validate ์ฝ๋๊ฐ ์์ฑ์ ์์ ์์ด์ผํ ๊ฒ ๊ฐ์ต๋๋ค..!!! |
@@ -0,0 +1,13 @@
+package christmas.domain;
+
+public class Date {
+ private int date;
+
+ public Date(final int date) {
+ this.date = date;
+ }
+
+ public int getDate() {
+ return this.date;
+ }
+}
\ No newline at end of file | Java | ๋ํ record๋ก ๋ฐ๊ฟ๋ ์ข์ ๊ฒ ๊ฐ๋ค์ ใ
ใ
|
@@ -0,0 +1,21 @@
+package christmas.constant;
+
+public enum Constants {
+ EVENT_START_DATE(1),
+ EVENT_END_DATE(25),
+ MENU_LIMIT(20),
+ CHAMPAGNE_LIMIT(120000),
+ MINIMUM_DISCOUNT_ABLE_AMOUNT(10000),
+ THIS_YEAR(2023),
+ EVENT_MONTH(12);
+
+ public int constants;
+
+ Constants(final int con... | Java | ๊ฐ ๋๋ฉ์ธ์ด ๋ค๋ฉฐ ์์ง๋๋ฅผ ๋ํ๋ ๋ฐฉ๋ฒ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! ๐ซ |
@@ -0,0 +1,105 @@
+package christmas.controller;
+
+import christmas.domain.BenefitInformation;
+import christmas.domain.Date;
+import christmas.domain.EventBadge;
+import christmas.domain.GiftMenu;
+import christmas.domain.Order;
+import christmas.domain.OrderManager;
+import christmas.domain.OrderPrice;
+import chris... | Java | MVC ๋ง์ด ๊ณต๋ถํด์ผ ๊ฒ ๋ค์ ใ
ใ
|
@@ -0,0 +1,13 @@
+package christmas.domain;
+
+public class Date {
+ private int date;
+
+ public Date(final int date) {
+ this.date = date;
+ }
+
+ public int getDate() {
+ return this.date;
+ }
+}
\ No newline at end of file | Java | recordํ์ ์์ฐ๋ ์ฝ๋ ๋ณด๋ฉด์ ์ฒ์ ๋ฐฐ์ ๋๋ฐ ์ ์ฉํ๊ฒ ์ ์ฌ์ฉํ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค !
`date`์ `validate`๊ฐ ์๋ ์ด์์ ์ฌ์ค ์๋ฏธ๊ฐ ์๋๊ฑฐ ๊ฐ๋ค์,,ใ
ใ
|
@@ -0,0 +1,40 @@
+package christmas.domain;
+
+import christmas.view.OutputView;
+
+public class EventBadge {
+ // ์ด๋ฒคํธ ๋ฑ์ง๋ฅผ ๊ด๋ฆฌ ํ๋ ํด๋์ค ์
๋๋ค.
+ private static final int SANTA_MINIMUM_LIMIT = 20000;
+ private static final int TREE_MINIMUM_LIMIT = 20000;
+ private static final int STAR_MINIMUM_LIMIT = 20000;
+ ... | Java | ๋ชจ๋ฅด๋ ์ฌ๋์ด ์ฝ๋๋ฅผ ๋ณด๋ฉด ์ ์์ง? ์๊ฐํ ์๋ ์๊ฒ ๋ค์!
๋ณ์๋ช
๊ณผ, ์ฃผ์์ ํตํด ์๋ฏธ๋ฅผ ๋ํ๋ด๋ ๊ฒ๋ ์ข์ ๋ฐฉ๋ฒ์ธ ๊ฒ ๊ฐ๋ค์ ๐ซ |
@@ -0,0 +1,28 @@
+package christmas.domain;
+
+import christmas.util.Utils;
+import christmas.view.OutputView;
+
+public class OrderPrice {
+ // ๊ธ์ก๊ณผ ๊ด๋ จ๋ ํด๋์ค์
๋๋ค.
+ // ํ ์ธ ์ ์ด ์ฃผ๋ฌธ๊ธ์ก, ํ ์ธ ํ ์์ ๊ฒฐ์ ๊ธ์ก ๋ฑ์ ๊ด๋ฆฌํ๋ ํด๋์ค ์
๋๋ค.
+ private static final String UNIT = "์";
+ private OrderRepository orders;
+ private int total... | Java | ๋ฐ๋ก OutputView ํด๋์ค์ ์ ์ธํ๋๊ฒ ์ข ๋ ์ ์ ํด ๋ณด์ด๋ค์ ใ
ใ
|
@@ -0,0 +1,135 @@
+package christmas.validator;
+
+import christmas.constant.Constants;
+import christmas.constant.ErrorMessage;
+import christmas.constant.Menu;
+import christmas.util.Utils;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+impo... | Java | ์ข์ ์ ๋ณด ๊ฐ์ฌํฉ๋๋ค ๐ฅ๐ฅ |
@@ -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,88 @@
+import { createGlobalStyle } from 'styled-components'
+import reset from 'styled-reset'
+
+const MainStyles = createGlobalStyle`
+ .relative{position:relative}
+ .absolute{position:absolute}
+ .fixed{position:fixed}
+
+ .flex-center-between {
+ display: flex;
+ align-ite... | TypeScript | ์ด๋ ๊ฒ ์ฐ๊ณ ์ถ๋ค๋ฉด, ๊ด๋ จ `styles/mixin.ts`์ mixin ํจ์๋ฅผ ๋ง๋ค ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
// flex๊ด๋ จ mixin
```suggestion
interface FlexMixin={
justifyContent?:'center' | 'flex-end' | 'flex-start' | 'space-evenly'
alignItems? :'center' | 'flex-end'
}
export const MixinFlex({ alignItems,justifyContent } : FlexMixin) {
... |
@@ -0,0 +1,35 @@
+package db;
+
+import db.HttpSessions;
+import model.User;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import webserver.domain.Session;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class HttpSessionsTest {
+
+ @Test
+ @DisplayName("์ธ์
... | Java | ํ
์คํธ๋ Session ์ถ๊ฐ์์ ๊ฐ์ด ํด์ฃผ์
จ๋ค์. ๐ |
@@ -0,0 +1,35 @@
+package db;
+
+import db.HttpSessions;
+import model.User;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import webserver.domain.Session;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class HttpSessionsTest {
+
+ @Test
+ @DisplayName("์ธ์
... | Java | ๋ถ์ผ์น๊น์ง ๐ |
@@ -0,0 +1,35 @@
+package db;
+
+import db.HttpSessions;
+import model.User;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+import webserver.domain.Session;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+public class HttpSessionsTest {
+
+ @Test
+ @DisplayName("์ธ์
... | Java | ์ฌ์ฉํ์ง ์๋ import๋ ์ ๊ฑฐํ์ฃ ๐ |
@@ -16,10 +16,10 @@ public class HttpResponse {
private HttpStatusCode httpStatusCode;
private Map<String, String> headers;
- private List<Cookie> cookies;
+ private Cookies cookies;
private byte[] body;
- public HttpResponse(HttpStatusCode httpStatusCode, Map<String, String> headers, List<C... | Java | ์ง๊ธ์ ์ ๊ฑฐํ์
จ์ง๋ง ๋๋ฒ๊น
๋ชฉ์ ์ผ๋ก System.out.println์ด ์๋๋ผ logger.debug๋ฅผ ์ฌ์ฉํด์ฃผ์
จ์๋ค์. ๐ฏ |
@@ -105,9 +105,15 @@ public String getBody() {
}
public boolean containsCookie(String cookie) {
- return this.headers
- .get(HttpHeader.COOKIE)
- .contains(cookie);
+ String requestCookie = this.headers.get(HttpHeader.COOKIE);
+ if (requestCookie != null) {... | Java | ์ฝ๊ฐ์ ๊ฐ์ธ์ ์ธ ์ ํธ์ธ๋ฐ ์ง๊ธ์ ๋ณต์กํ์ง ์์์ ์ฐจ์ด๊ฐ ํฌ์ง ์์ง๋ง ์ฌ๋์ ๋ถ์ ๋ณด๋ค๋ ๊ธ์ ์ ๋ ์์ฐ์ค๋ฝ๊ฒ ์ฝ๋ ๊ฒฝํฅ์ด ์์ด์ ๊ฐ๋ฅํ๋ค๋ฉด ๊ธ์ ์ ์กฐ๊ฑด์ ์ ํํ๋ ํธ์
๋๋ค.
```java
if (StringUtils.hasText(requestCookie)) {
return requestCookie.contains(cookie);
}
return false;
```
๋น ๋ฌธ์์ด์ผ ๋๋ ์ด๋ป๊ฒ ํด์ผํ ์ง๋ ์ด์ง ๊ณ ๋ฏผ๋๋ค์. |
@@ -0,0 +1,31 @@
+package db;
+
+import webserver.domain.Session;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+public class HttpSessions {
+ private static final Map<String, Session> sessions = new HashMap<>();
+
+ public static String getId() {
+ return UUID.randomUUID().... | Java | ์ ํ๋ฆฌ์ผ์ด์
๊ณตํต์ ์ผ๋ก ์ฌ์ฉ๋ ์ ์๊ฒ DB๋ก ์ฌ์ฉํด ์ฃผ์
จ๋ค์ ๐ |
@@ -0,0 +1,31 @@
+package db;
+
+import webserver.domain.Session;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+public class HttpSessions {
+ private static final Map<String, Session> sessions = new HashMap<>();
+
+ public static String getId() {
+ return UUID.randomUUID().... | Java | ํค ์์ฑ์ ์ด๋ป๊ฒ ํ ๊น ๊ณ ๋ฏผํ๋ค๊ฐ DB๊ฐ ํค์์ฑ์ ํ๋๊ฑธ ๊ณ ๋ คํ์ฌ ์ฌ๊ธฐ ๋ฃ์ด ์ฃผ์ ๊ฒ ๊ฐ๋ค์.
DB์์ ๋ณดํต ์ด์ ๊ฐ์ ๋์๋ก ํค๋ฅผ ๋ง๋ค์ง๋ ์๊ณ , HttpSessions๊ฐ ์๋ ๋ค๋ฅธ DB, ์๋ฅผ ๋ค๋ฉด Redis๋ฅผ ์ฌ์ฉํ๋ฉด ๋จ์ํ DB๋ฅผ ๋ฐ๊พธ๋ ๊ฑธ๋ก ์์
์ด ๋๋์ง ์๊ณ ๋์ ์์ฑ์ ๋ํ ๊ณ ๋ฏผ์ ํ์
์ผ ํ ํ
๋ฐ ์ด์ ๋ํ ์ญํ ์ DB๊ฐ ์๋ ๊ณณ์ผ๋ก ๋๊ฒจ๋ณด์ฃ .
์ด๊ฑด ์๋ Request๊ด๋ จ ๋ด์ฉ์ ๋จ๊ธธ๊ฒ์! |
@@ -1,24 +1,43 @@
package webserver.controller;
import db.DataBase;
+import db.HttpSessions;
import model.User;
+import org.checkerframework.checker.units.qual.C;
import webserver.domain.*;
+import java.util.UUID;
+
public class LoginController extends AbstractController {
@Override
public HttpRespon... | Java | Session์ ๋ํ ์ถ๊ฐ๋ก ์๋นํ ๋ณต์กํด์ก๋ค์.
Controller์ ๋๋ถ๋ถ์ ์ฝ๋๊ฐ Http์ ๋ํ ์์
์ธ๋ฐ Session๋ ๊ฒฐ๊ตญ Http์ ์คํ์ธ๊ฑธ ๊ณ ๋ คํด์ Request, Response๋ฅผ ํตํด ๊ด๋ฆฌํ ์ ์์ง ์์๊น์? (์์ ๋ง์๋๋ฆฐ session id์ ์ถ๊ฐ ๋ํ ๋ง์ด์ฃ .)
๊ทธ๋ฌ๋ฉด Controller๋ Session์ ๊ฐ์ ธ์ค๊ณ , ์ถ๊ฐ ์์ฒญ๋ง ํ๋ ๋ฐฉ๋ฒ์ผ๋ก ์ฌ์ฉํ๊ธฐ๋ง ํ ์ ์์ ๊ฒ ๊ฐ์์. |
@@ -1,21 +1,27 @@
package webserver.domain;
+
+import java.util.Objects;
+
public class Cookie {
+ public static final String PATH = "Path";
private String name;
private String value;
- private String pathName;
- private String pathValue;
+ private String path;
public Cookie(String name... | Java | `cookieString` ํ์
์ ๋ณ์๋ช
์ ์จ์ค ํ์๋ ์์ต๋๋ค! |
@@ -0,0 +1,42 @@
+package webserver.domain;
+
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+import org.springframework.util.StringUtils;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+
+public class Cookies {
+ private static final Logger logger = LoggerFactory.getLogger... | Java | [Java8 Stream์ loop๊ฐ ์๋๋ค.](https://www.popit.kr/java8-stream%EC%9D%80-loop%EA%B0%80-%EC%95%84%EB%8B%88%EB%8B%A4/)
```java
for (String str : cookiesString.trim().split(";")) {
String[] keyValue = str.split("=");
cookies.put(keyValue[0].trim(), new Cookie(keyValue[0].trim(), keyValue... |
@@ -0,0 +1,29 @@
+package webserver.domain;
+
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class Session {
+ private Map<String, Object> attribute;
+
+ public Session() {
+ this.attribute = new HashMap<>();
+ }
+
+ public Object getAttribute(String name) {
+ return attribute.g... | Java | ๊ตฐ๋๋๊ธฐ ์์ด ์ ๊ตฌํํ๋ค์. ๐ |
@@ -0,0 +1,47 @@
+package nextstep.security.authentication;
+
+import java.util.List;
+import java.util.Map;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties(prefix = "spring.security.oauth2.client")
+public class OAuth2ClientProperties {
+
+ private Map<String... | Java | ๋จ์ํ ์ค์ ํ์ผ์ record๋ฅผ ํ์ฉํ๋ฉด ์ฝ๋๊ฐ ๊น๋ํด์ง ๊ฒ ๊ฐ์์~ |
@@ -0,0 +1,95 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | ์ง๊ธ์ ํด๋์ค ๋ด๋ถ์์ ๊ฐ์ฒด๋ฅผ ์ง์ ์์ฑํ๊ณ ์๋๋ฐ, ์คํ๋ง ์ฒ ํ์์๋ ๋ด๋ถ์์ ๊ฐ์ฒด๋ฅผ ์์ฑํ๊ธฐ ๋ณด๋จ ์์ฑ์ ์ฃผ์
์ ํตํด DI ๋ฐ๋ ๊ฒ์ ๊ถ์ฅํ๊ณ ์์ต๋๋ค.
์์ฑ์ ์ฃผ์
๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝํ ๊ฒฝ์ฐ ์ด๋ค ์ฅ์ ์ด ์์์ง ๊ณ ๋ฏผํด ๋ณด์์. |
@@ -0,0 +1,95 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | ์ง๊ธ์ OAuth ์ ๊ณต์๋ฅผ ์ถ๊ฐํ ๋๋ง๋ค ํด๋น ์ฝ๋๋ฅผ ์์ ํด์ผ ํ๋ ๋ฌธ์ ๊ฐ ์๋ค์! OAuth2ClientProperties์์ ๋์ ์ผ๋ก ์ฐพ์ ์ฒ๋ฆฌํ๋๋ก ๊ฐ์ ํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,33 @@
+spring:
+ security:
+ oauth2:
+ client:
+ registrations:
+ github:
+ provider: "github"
+ client-id: "Ov23lijfjg9lkGyYVDXN"
+ client-secret: "YOUR_GITHUB_CLIENT_SECRET"
+ scope:
+ - read:user
+ redirect-uri: "... | Unknown | ์์ํ์ง๋ง.. IntelliJ๋ฅผ ์ฌ์ฉํ์ค ๊ฒฝ์ฐ ์๋์ผ๋ก ๊ฐํ์ ์ถ๊ฐํ ์ ์์ต๋๋ค!
https://velog.io/@d-h-k/intellij-%ED%8C%8C%EC%9D%BC%EB%81%9D%EC%97%90-%EA%B0%9C%ED%96%89%EC%9D%84-%EC%9E%90%EB%8F%99%EC%9C%BC%EB%A1%9C-%EC%B6%94%EA%B0%80%ED%95%98%EB%8A%94-%EB%B0%A9%EB%B2%95 |
@@ -0,0 +1,71 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | OAuth2 ์คํ์์๋ scope๋ฅผ ๊ณต๋ฐฑ์ผ๋ก ๊ตฌ๋ถํ๋ ๊ฒ์ด ํ์ค์
๋๋ค.
์ง๊ธ์ ์ผํ๋ก ๊ตฌ๋ถํ๊ณ ์๋๋ฐ, ํ์ค์ ๋ง๊ฒ ์์ ํด๋ณด๋ฉด ์ด๋จ๊น์?
์ฐธ๊ณ : https://datatracker.ietf.org/doc/html/rfc6749#section-3.3
 |
@@ -0,0 +1,71 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | authorization_grant_type ๊ฐ์ ์ถ๊ฐํด์ฃผ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,71 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | provider.getAuthorizationUri()์ ๋ํ ๊ฐ๋ UriComponentsBuilder์์ ๊ฐ์ด ์์ฑํด๋ณด๋ฉด ์ข๊ฒ ์ต๋๋ค~ |
@@ -0,0 +1,27 @@
+package nextstep.security.authentication;
+
+import java.util.Map;
+import nextstep.security.authentication.OAuth2ClientProperties.Provider;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframewo... | Java | ์ง๊ธ์ Map์ ํํ๋ก ์๋ตํ๊ณ ์๋๋ฐ, ์ด๋ฌํ ์ฝ๋๋ ํ์
์์ ์ฑ์ด ๋ถ์กฑํ๊ณ ๊ฐ๋
์ฑ์ด ๋จ์ด์ง๊ฒ ๋ฉ๋๋ค.
OAuth ์ ๊ณต์๋ง๋ค ๋ค๋ฅธ ์๋ต ์ ๋ณด๊ฐ ์์ ์ ์๋ ์ํฉ์์ ์์ ์ฑ๊ณผ ์ ์ฐ์ฑ์ ์ด๋ป๊ฒ ๊ฐ์ด ๊ฐ์ ธ๊ฐ ์ ์์์ง ๊ณ ๋ฏผํด๋ณด๋ฉด ์ฌ๋ฏธ์๊ฒ ๋ค์ ใ
ใ
|
@@ -0,0 +1,47 @@
+package nextstep.security.authentication;
+
+import java.util.List;
+import java.util.Map;
+import org.springframework.boot.context.properties.ConfigurationProperties;
+
+@ConfigurationProperties(prefix = "spring.security.oauth2.client")
+public class OAuth2ClientProperties {
+
+ private Map<String... | Java | ํ์คํ ์์ฒญ ๊น๋ํด์ง๋ค์! |
@@ -0,0 +1,33 @@
+spring:
+ security:
+ oauth2:
+ client:
+ registrations:
+ github:
+ provider: "github"
+ client-id: "Ov23lijfjg9lkGyYVDXN"
+ client-secret: "YOUR_GITHUB_CLIENT_SECRET"
+ scope:
+ - read:user
+ redirect-uri: "... | Unknown | ํ ์ด๋ฐ ๊ท์น์ด ์๋์ง๋ ๋ชฐ๋๋ค์ ,, ์ข์ ์ธ์ฌ์ดํธ ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,95 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | ์ฅ์ ์ผ๋ก๋ ๊ฒฐ๊ตญ ๊ตฌํ์ฒด์ ์์กดํ์ง ์๋ ๊ตฌ์กฐ๋ก ๋ณ๊ฒฝ๋๊ธฐ ๋๋ฌธ์, ๊ฒฐํฉ๋๋ฅผ ๋ฎ์ถ๊ณ ์ ์ฐํ๊ฒ ํ์ฅํด ๋๊ฐ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค!
๋ํ TestDouble ๊ตฌํํ๊ธฐ๋ ํจ ์์ํ ๊ฒ ๊ฐ์์!
์ฌ์ฐ๋์ด ์๊ฐํ์๋ ์ด๊ฑฐ ์ธ์๋ ์ป์ ์ ์๋ ์ค์ ์ด์ ์ด ์์ผ์ค๊น์?
( ๋ฐ์์ [c887083](https://github.com/next-step/spring-security-oauth2/pull/7/commits/c8870831fea1cb685a7614a49c33229242b8e442) ๋ก ์งํํ์ต๋๋ค.) |
@@ -0,0 +1,71 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | ๋๋๊ฒ๋
์ฌ๊ธฐ grant_type ๋ง์ yml์ ๋ฑ๋กํ๊ณ ์
```yml
github:
provider: "github"
client-id: "Ov23lijfjg9lkGyYVDXN"
client-secret: "YOUR_GITHUB_CLIENT_SECRET"
scope:
- read:user
redirect-uri: "http://localhost:8080/login/oauth2/code/github"
authorization-grant-type: authorization_code
```
... |
@@ -0,0 +1,71 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | [8071959](https://github.com/next-step/spring-security-oauth2/pull/7/commits/807195919a73c89b2ec6c0d52063d15b7ee1d46f)
๋ก ๋ฐ์ํ์ต๋๋ค. |
@@ -0,0 +1,27 @@
+package nextstep.security.authentication;
+
+import java.util.Map;
+import nextstep.security.authentication.OAuth2ClientProperties.Provider;
+import org.springframework.http.HttpEntity;
+import org.springframework.http.HttpHeaders;
+import org.springframework.http.HttpMethod;
+import org.springframewo... | Java | [cde6bc2](https://github.com/next-step/spring-security-oauth2/pull/7/commits/cde6bc20d18375290b619a33c29a5f859e3a541e) ๋ก ์งํํด๋ณด์์ต๋๋ค!
ํ ๊ตฌ์กฐ์ ๊ฐ์ ๊ฐ์ ๋ฐํํ๊ณ ์๊ธฐ ๋๋ฌธ์ ๊ฐ๊ณผํ๊ณ ์๋ ๋ถ๋ถ์ธ๋ฐ์.
ํ๋ฉด ํ ์๋ก ํ์คํ ์ด๋ฐ ํ๋ ์์ํฌ์์๋ ํ์ฅ์ฑ ์๊ฒ ๊ตฌ์ฑํ๋๊ฒ ์ค์ํ๋ค๊ณ ๋๊ปด์ง๋ค์! |
@@ -0,0 +1,95 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | > ์ฅ์ ์ผ๋ก๋ ๊ฒฐ๊ตญ ๊ตฌํ์ฒด์ ์์กดํ์ง ์๋ ๊ตฌ์กฐ๋ก ๋ณ๊ฒฝ๋๊ธฐ ๋๋ฌธ์, ๊ฒฐํฉ๋๋ฅผ ๋ฎ์ถ๊ณ ์ ์ฐํ๊ฒ ํ์ฅํด ๋๊ฐ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค!
๋ํ TestDouble ๊ตฌํํ๊ธฐ๋ ํจ ์์ํ ๊ฒ ๊ฐ์์!
์ฌ์ฐ๋์ด ์๊ฐํ์๋ ์ด๊ฑฐ ์ธ์๋ ์ป์ ์ ์๋ ์ค์ ์ด์ ์ด ์์ผ์ค๊น์?
( ๋ฐ์์ [c887083](https://github.com/next-step/spring-security-oauth2/pull/7/commits/c8870831fea1cb685a7614a49c33229242b8e442) ๋ก ์งํํ์ต๋๋ค.)
๋ง์ต๋๋ค. ๊ฒฐํฉ๋๋ฅผ ๋ฎ์ถ ์ ์๋ค๋ ์ ์ด ๊ฐ์ฅ ํฐ ์ฅ์ ์ผ ๊ฒ... |
@@ -0,0 +1,95 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;... | Java | ์ ๊ณต์๊ฐ ์์ ๊ฒฝ์ฐ ๋ฌด์ํ๋ค. vs ์์ธ๋ฅผ ๋ฐ์ํ๋ค. ์ด๋ค ๋ฐฉํฅ์ฑ์ด ์ข์์ง ๊ณ ๋ฏผํด ๋ณด์์. |
@@ -0,0 +1,79 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+body{
+ background-color:#fafafa;
+}
+
+.login-wrap{
+ width:30%;
+ height:550px;
+ background-color:#fff;
+ border:3px solid rgba(221, 221, 221, 0.3);
+ margin:130px... | Unknown | CSS ์์ฑ ์์๋๋ก ๋ณ๊ฒฝํ๋ฉด ๋ ์ข์๊ฒ ๊ฐ์์
margin, padding ๋ค์ font-size ์์ด๋ค์ ;) |
@@ -0,0 +1,32 @@
+import React from "react";
+import "./Footer.scss";
+
+class Footer extends React.Component {
+ render() {
+ return (
+ <footer>
+ <ul>
+ {RIGHT_FOOTER.map((element, index) => {
+ return <li key={index}>{element}</li>;
+ })}
+ </ul>
+ <p class... | JavaScript | footer ๋ด์ฉ ์ ๋ง๋์
จ๋ค์ bb |
@@ -0,0 +1,79 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+body{
+ background-color:#fafafa;
+}
+
+.login-wrap{
+ width:30%;
+ height:550px;
+ background-color:#fff;
+ border:3px solid rgba(221, 221, 221, 0.3);
+ margin:130px... | Unknown | ๋ต ์์ ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | this.state ๋ ๊ตฌ์กฐ๋ถํดํ ๋น์ ์ฌ์ฉํด์ ์ ๋ฆฌํด์ฃผ์๋ฉด ๋ ๊น๋ํ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | ์ ๋ถ๋ถ ๋
ธ์
์์ ๋ดค๋๋ฐ handleId๋ handlePw๊ฐ์ด ๋๊ฐ์ ํ์์ event handler๋ผ์ ํฉ์น ์ ์๋๋ผ๊ตฌ์! ์ ๋ ์์ง์ํ์ง๋ง...^^ ๊ฐ์ด ํด๋ณด์์ ใ
ใ
ใ
|
@@ -0,0 +1,79 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+body{
+ background-color:#fafafa;
+}
+
+.login-wrap{
+ width:30%;
+ height:550px;
+ background-color:#fff;
+ border:3px solid rgba(221, 221, 221, 0.3);
+ margin:130px... | Unknown | ์์ฃผ์ฐ๋ border variable ์๋ค๊ฐ ์ ์ฅํด๋๊ณ ์ฐ๋๊น ํธํ๊ณ ์ข๋๋ผ๊ตฌ์! |
@@ -0,0 +1,21 @@
+import React from "react";
+import "./MainRight.scss";
+import RecommendHeader from "./MainRight/RecommendHeader";
+import RecommendTitle from "./MainRight/RecommendTitle";
+import RecommendFriends from "./MainRight/RecommendFriends";
+import Footer from "./MainRight/Footer";
+
+class MainRight extend... | JavaScript | ์ค ๋ฒ์จ ๋ค ๋๋์
จ๋ค๋ ๐ |
@@ -0,0 +1,21 @@
+import React from "react";
+import "./MainRight.scss";
+import RecommendHeader from "./MainRight/RecommendHeader";
+import RecommendTitle from "./MainRight/RecommendTitle";
+import RecommendFriends from "./MainRight/RecommendFriends";
+import Footer from "./MainRight/Footer";
+
+class MainRight extend... | JavaScript | ๊น๋....๐คญ |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | ์ค์ท ํ๋ฒ ์๋ํด๋ด์ผ๊ฒ ์ด์! |
@@ -0,0 +1,21 @@
+import React from "react";
+import "./MainRight.scss";
+import RecommendHeader from "./MainRight/RecommendHeader";
+import RecommendTitle from "./MainRight/RecommendTitle";
+import RecommendFriends from "./MainRight/RecommendFriends";
+import Footer from "./MainRight/Footer";
+
+class MainRight extend... | JavaScript | ๊ฐ์ฌํฉ๋๋ฏ๐คญ |
@@ -0,0 +1,79 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+body{
+ background-color:#fafafa;
+}
+
+.login-wrap{
+ width:30%;
+ height:550px;
+ background-color:#fff;
+ border:3px solid rgba(221, 221, 221, 0.3);
+ margin:130px... | Unknown | ๊ณตํต scss๋ฅผ ์ ํ์ฉํด๋ด์ผ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,18 @@
+.recommend-title {
+ width:100%;
+ height:40px;
+ margin-bottom:5px;
+
+ .recommend-title-left {
+ float:left;
+ font-size:14px;
+ color:#888;
+ font-weight:700;
+ }
+
+ .recommend-title-right {
+ float:right;
+ font-size:12px;
+ font-... | Unknown | ์ ๋ชฉ ๊น๋ํ๊ณ ์์๋ฃ๊ธฐ ์ฌ์์ ์ข์๊ฑฐ๊ฐ์์! |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | import { Link, withRouter } from "react-router-dom"; ํ์ค๋ก ๋ง๋ค์ด๋ ์ข์๊ฑฐ๊ฐ์์! |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | ๋ต! ๋ฆฌํฉํ ๋ง ํด๋ณด๊ฒ ์ต๋๋ค๐ |
@@ -0,0 +1,63 @@
+import React from "react";
+import Story from "./Mainleft/Story";
+import Feed from "./Mainleft/Feed";
+import "./MainLeft.scss";
+// import { FaRedditAlien } from "react-icons/fa";
+
+class MainLeft extends React.Component {
+ state = {
+ feedList: [],
+ };
+
+ componentDidMount() {
+ fetch(... | JavaScript | ํ๊ทธ๋ช
์ด ํ๋์ ๋ค์ด์์๐ |
@@ -0,0 +1,50 @@
+@import "../../common.scss";
+
+.recommend-header {
+ width:100%;
+ height:100px;
+ @extend %flexbetween;
+ margin-top:5px;
+
+ li {
+ position:relative;
+ &:first-child {
+ &:after {
+ width:64px;
+ height:64px;
+ bo... | Unknown | tirm ํจ์? ์ด์ฉํด์ ๋น์นธ enter๋ฐฉ์งํ๋ ๋ฐฉ๋ฒ์ด์๋๋ผ๊ตฌ์ ๊ฐ์ด ์ฌ์ฉํด๋ด์๐ |
@@ -0,0 +1,181 @@
+import React from "react";
+import Comments from "./Comments";
+import COMMENT from "./CommentData";
+import "./Feed.scss";
+import { FaEllipsisH } from "react-icons/fa";
+import { FaRegHeart } from "react-icons/fa";
+import { FaRegComment } from "react-icons/fa";
+import { FaRegShareSquare } from "r... | JavaScript | ๋์์ ์ด๋ฒคํธ๊ฐ ์คํ๋ ์์๊ฒ ์ ๋ ์ฐ์ฐ์๋ก ์ฌ์ฉํด๋ด์ผ๊ฒ ์ด์!! |
@@ -0,0 +1,88 @@
+@import "../../../../styles/common.scss";
+
+
+%flexbetween {
+ display: flex;
+ align-items: center;
+ justify-content: space-between;
+}
+
+nav {
+ width:100%;
+ height:55px;
+ background-color:#fff;
+ border-bottom :1px solid #ddd;
+ position:fixed;
+ top:0;
+ z-index:10;
+
+ ... | Unknown | placeholder ์คํ์ผ ๊ฐ์ฃผ๋ ๋ฒ ์ ๋ ์จ๋ด์ผ๊ฒ ์ด์! |
@@ -0,0 +1,46 @@
+footer {
+ width:100%;
+ height:70px;
+
+ ul {
+ width:90%;
+ margin-top:20px;
+
+ li {
+ font-size:12px;
+ color:#888;
+ margin-bottom:10px;
+ position:relative;
+ padding-left:5px;
+ padding-right:10px;
+... | Unknown | css์ ํ์์ ๊ฐ์์์์ ํ์๋ฅผ ์ ์ด์ฉํ์
จ๋ค์..! ์ ํํ ์ด์ฉ๋ฒ์ ๋ชฐ๋๋๋ฐ ๋ฐฐ์๊ฐ๋๋ค ๐ฅ๐๐ป |
@@ -0,0 +1,50 @@
+@import "../../common.scss";
+
+.recommend-header {
+ width:100%;
+ height:100px;
+ @extend %flexbetween;
+ margin-top:5px;
+
+ li {
+ position:relative;
+ &:first-child {
+ &:after {
+ width:64px;
+ height:64px;
+ bo... | Unknown | afterํ์ฉ ๐๐ป |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | ํ๋์ ํจ์๋ก ํฉ์ณ์ฃผ์ค์ ์๊ฒ ๋ค์-! ๐ |
@@ -0,0 +1,79 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+body{
+ background-color:#fafafa;
+}
+
+.login-wrap{
+ width:30%;
+ height:550px;
+ background-color:#fff;
+ border:3px solid rgba(221, 221, 221, 0.3);
+ margin:130px... | Unknown | ํ์ค margin ์์ฑ์ผ๋ก ์ค์ฌ๋ณผ ์ ์๊ฒ ๋ค์-! ๐ |
@@ -0,0 +1,98 @@
+import { Component } from "react";
+import { Link, withRouter } from "react-router-dom";
+import "./Login.scss";
+
+class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: "",
+ pw: "",
+ };
+ }
+
+ // localStorage.clear();
+ // localStorage.removeIte... | JavaScript | ๋ฐ๋ก ํจ์๋ฅผ ๋ง๋ค์ด์ฃผ์์ง ์์๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค-!
```js
const { id, pw } = this.state;
<button className={id.includes('@') && pw.length >= 5 ? 'on' : 'off'} onClick={this.goToMain}>
``` |
@@ -0,0 +1,79 @@
+@import url('https://fonts.googleapis.com/css2?family=Lobster&display=swap');
+
+* {
+ box-sizing: border-box;
+}
+body{
+ background-color:#fafafa;
+}
+
+.login-wrap{
+ width:30%;
+ height:550px;
+ background-color:#fff;
+ border:3px solid rgba(221, 221, 221, 0.3);
+ margin:130px... | Unknown | ์์ฃผ ์ฌ์ฉ๋๋ ์คํ์ผ ๊ฐ์๋ฐ, scss ๋ณ์๋ก ์ ์ธํด์ ์ฌ์ฉํด์ฃผ์๋ฉด ์ข์ ๋ฏ ํ๋ค์-! ๐ |
@@ -0,0 +1,63 @@
+import React from "react";
+import Story from "./Mainleft/Story";
+import Feed from "./Mainleft/Feed";
+import "./MainLeft.scss";
+// import { FaRedditAlien } from "react-icons/fa";
+
+class MainLeft extends React.Component {
+ state = {
+ feedList: [],
+ };
+
+ componentDidMount() {
+ fetch(... | JavaScript | import ์์ ์์ ํด์ฃผ์ธ์ ๐ ์ผ๋ฐ์ ์ธ convention์ ๋ฐ๋ฅด๋ ์ด์ ๋ ์์ง๋ง ์์๋ง ์ ์ง์ผ์ฃผ์
๋ ๊ฐ๋
์ฑ์ด ์ข์์ง๋๋ค. ์๋ ์์ ์ฐธ๊ณ ํด์ฃผ์ธ์.
- React โ Library(Package) โ Component โ ๋ณ์ / ์ด๋ฏธ์ง โ css ํ์ผ(scss ํ์ผ) |
@@ -0,0 +1,63 @@
+import React from "react";
+import Story from "./Mainleft/Story";
+import Feed from "./Mainleft/Feed";
+import "./MainLeft.scss";
+// import { FaRedditAlien } from "react-icons/fa";
+
+class MainLeft extends React.Component {
+ state = {
+ feedList: [],
+ };
+
+ componentDidMount() {
+ fetch(... | JavaScript | 1. ๋ก์ปฌ ํธ์คํธ์ ๊ฒฝ์ฐ ๋ฐ๋ก ์
๋ ฅ์ ํด์ฃผ์ง ์์ผ์
๋ ์๋์ผ๋ก ๋ค์ด๊ฐ๊ฒ ๋ฉ๋๋ค. ์ด๋ ๊ฒ ์๋ตํด์ ์์ฑ์ ํด์ฃผ์๋ ๊ฒ ๋ ์ข์ต๋๋ค. ์๋ํ๋ฉด, ํฌํธ ๋ฒํธ๊ฐ ๋ณ๊ฒฝ๋๋ ๋๊ฐ ์๊ฐ๋ณด๋ค ๋ง์๋ฐ, ์ด๋ ๊ฒ ์ง์ ์์ฑ์ ํด์ฃผ์ ๊ฒฝ์ฐ ํฌํธ ๋ฒํธ๋ฅผ ์ผ์ผ์ด ์์ ํด์ฃผ์์ผ ํฉ๋๋ค. ์๋ต์ ํด์ ์๋์ ๊ฐ์ด ์์ฑํ ๊ฒฝ์ฐ, ์๋์ผ๋ก ๋ณ๊ฒฝ๋ ํฌํธ๋ฒํธ๊ฐ ๋ค์ด๊ฐ๋๋ค ๐
```js
fetch(`/data/Story.json`)
.then(res => res.json())
.then( ... )
```
2. fetch ์ ๊ธฐ๋ณธ ๋ฉ์๋๋ GET ์
๋๋ค. ๋ฐ๋ผ์ { method: 'GET' }... |
@@ -0,0 +1,43 @@
+package nextstep.app;
+
+import nextstep.oauth2.authentication.provider.OAuth2LoginAuthenticationProvider;
+import nextstep.oauth2.registration.ClientRegistrationRepository;
+import nextstep.oauth2.registration.OAuth2ClientProperties;
+import nextstep.oauth2.userinfo.OAuth2UserService;
+import nextste... | Java | ์ปค์คํ
์ ํ๊ฒ ๋๊ฒ ์ง๋ง DefaultOAuth2UserService๋ฅผ ๋์ด์ ํ์ํ ๋ก์ง๋ง ์ถ๊ฐ๋ก ๊ตฌํํด๋ณด๋ ๊ตฌ์กฐ๋ก ํด๋ณด์๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,68 @@
+package nextstep.oauth2.authentication.token;
+
+import nextstep.oauth2.authentication.OAuth2AccessToken;
+import nextstep.oauth2.endpoint.dto.OAuth2AuthorizationExchange;
+import nextstep.oauth2.registration.ClientRegistration;
+import nextstep.security.authentication.Authentication;
+
+import java.u... | Java | authorizationCodeAuthentication๋ฅผ ์ดํด๋ณด๋ฉด Authentication์ getCredentials๋ getPrincipal๋ฅผ ๋ณ๋๋ก ์ฌ์ฉํ๊ณ ์์ง ์์๋ฐ ์ ๊ตณ์ด Authentication๋ฅผ ๊ตฌํํ๊ฒ ํ๋ ๊ฒ์ผ ์ง ์๊ฐํด๋ณด์
จ๋์? ์ ๋ต์ด ์๊ฑฐ๋ ๋ฌด์ธ๊ฐ๋ฅผ ์๋ํ๋ ์ง๋ฌธ์ ์๋๊ณ ์๊ฐํด๋ณด์๊ธธ ๋ฐ๋ผ๋ ๋ง์์์ ๋จ๊ธฐ๋ ์ฝ๋ฉํธ ์
๋๋ค! |
@@ -0,0 +1,43 @@
+package nextstep.app;
+
+import nextstep.oauth2.authentication.provider.OAuth2LoginAuthenticationProvider;
+import nextstep.oauth2.registration.ClientRegistrationRepository;
+import nextstep.oauth2.registration.OAuth2ClientProperties;
+import nextstep.oauth2.userinfo.OAuth2UserService;
+import nextste... | Java | ๋ฏธ์
์ ์งํํ ๋, oauth2 ํจํค์ง๋ง ํด๋ ๋ค๋ฃจ์ด์ผํ ๊ฒ ๋ฌด์ฒ ๋ง๋ค๋ณด๋, app ํจํค์ง์์์ ๋ณ๊ฒฝ์ฌํญ์ ์ต์ํํ๊ณ ,
๋ง์ฝ ์ถ๊ฐ ํด๋์ค๋ฅผ ๊ตฌํํ ๊ฒ ์๋ค๋ฉด ์ต๋ํ OAuth2Config ๋ด๋ถ์์ ํด๊ฒฐํ๋ ค๋ค๋ณด๋ ์ด๋ ๊ฒ Bean ๋ฑ๋ก์ ํ๊ฒ ๋ ๊ฒ ๊ฐ์ต๋๋ค.
DefaultOAuth2UserService ๋ฅผ ๋ณ๋ ํด๋์ค๋ก ๋ถ๋ฆฌ์ํค๋๋ก ํ๊ฒ ์ต๋๋ค. |
@@ -0,0 +1,43 @@
+package nextstep.app;
+
+import nextstep.oauth2.authentication.provider.OAuth2LoginAuthenticationProvider;
+import nextstep.oauth2.registration.ClientRegistrationRepository;
+import nextstep.oauth2.registration.OAuth2ClientProperties;
+import nextstep.oauth2.userinfo.OAuth2UserService;
+import nextste... | Java | [5d68d0d](https://github.com/next-step/spring-security-oauth2/pull/8/commits/5d68d0dc640af2e1fd53ebca1cc7b8a5ed58d3ec) ์ปค๋ฐ์์ ๋ฐ์ ์๋ฃํ์์ต๋๋ค. |
@@ -0,0 +1,68 @@
+package nextstep.oauth2.authentication.token;
+
+import nextstep.oauth2.authentication.OAuth2AccessToken;
+import nextstep.oauth2.endpoint.dto.OAuth2AuthorizationExchange;
+import nextstep.oauth2.registration.ClientRegistration;
+import nextstep.security.authentication.Authentication;
+
+import java.u... | Java | [spring-security ์ OAuth2AuthorizationCodeAuthenticationToken ์์ค์ฝ๋๋ฅผ ๋ณด๋ฉด](https://github.com/spring-projects/spring-security/blob/7fc5d50adfe5546ca725f3259e4d65ee6083f7cd/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/authentication/OAuth2AuthorizationCodeAuthenticationToken.java#L112)
pri... |
@@ -0,0 +1,68 @@
+package nextstep.oauth2.authentication.token;
+
+import nextstep.oauth2.authentication.OAuth2AccessToken;
+import nextstep.oauth2.endpoint.dto.OAuth2AuthorizationExchange;
+import nextstep.oauth2.registration.ClientRegistration;
+import nextstep.security.authentication.Authentication;
+
+import java.u... | Java | ์ ๋ ํด๋น ๋ถ๋ถ์ ๊ณ ๋ฏผํ๋ฉด์ ๋ค์๋ ์๊ฐ์ ์ธ์ฆ ๊ณผ์ ์์ ํ์ํ ๊ฐ์ฒด์์ ๋๋ฌ๋ด๊ธฐ์ํด Authentication์ ๊ตฌํํ ๊ฒ์ด๋ผ ์๊ฐํ์์ต๋๋ค. ์ ์๋์ ํ์คํ ๋ฆฌ ์ถ์ ์ ์ดํด๋ณด๋ ์ผ๋ฆฌ๊ฐ ์์ด ๋ณด์ด๋ค์ ๐ |
@@ -0,0 +1,58 @@
+package nextstep.app.service;
+
+import nextstep.app.domain.Member;
+import nextstep.app.domain.MemberRepository;
+import nextstep.oauth2.profile.OAuth2ProfileUser;
+import nextstep.oauth2.userinfo.OAuth2User;
+import nextstep.oauth2.userinfo.OAuth2UserRequest;
+import nextstep.oauth2.userinfo.OAuth2U... | Java | ๋ฐ์ ์ ํด์ฃผ์
จ์ต๋๋ค!
DefaultOAuth2UserService์์ ์ ๊ณตํด์ฃผ๋ ๊ฒ ์ธ์ ์ปค์คํ
์ด ํ์ํ ๋ถ๋ถ์ ์ด๋ค ๋ถ๋ถ์ธ์ง ํ์ธํด๋ณด๊ณ ๊ตฌํ์ ํด๋ณด๋ฉด
์ถํ ์คํ๋ง ์ํ๋ฆฌํฐ๋ฅผ ์ฌ์ฉํ ๋ ์กฐ๊ธ ๋ ์๋ค๋ฅด๊ฒ ๋ค๊ฐ์ฌ ๊ฒ ๊ฐ๋ค์ :)
์ด๋ค ๋ถ๋ถ์ด ์์ ์ง ๊ณ ๋ฏผ๋ง ํด๋ณด์
์~ |
@@ -0,0 +1,95 @@
+'use client';
+
+import { useState } from 'react';
+import { useGlobalModal } from './useGlobalModal';
+import { useParams } from 'next/navigation';
+import { createReview } from '@/api/reivews';
+
+export interface IReviewState {
+ valid: boolean;
+ comment: string;
+ score: number;
+}
+
+export func... | Unknown | P4: ๋์ค์ ์๋ฌ์ฒ๋ฆฌ๋ง ์ ๋ฃ์ด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์! ๊ณ ์ํ์
จ์ต๋๋ค~ |
@@ -13,15 +13,13 @@
import nextstep.security.context.SecurityContextHolderFilter;
import nextstep.security.matcher.AnyRequestMatcher;
import nextstep.security.matcher.MvcRequestMatcher;
-import nextstep.security.matcher.RequestMatcherEntry;
import nextstep.security.userdetails.UserDetails;
import nextstep.security... | Java | ์๊ตฌ์ฌํญ ์ค์ ๐ |
@@ -13,15 +13,13 @@
import nextstep.security.context.SecurityContextHolderFilter;
import nextstep.security.matcher.AnyRequestMatcher;
import nextstep.security.matcher.MvcRequestMatcher;
-import nextstep.security.matcher.RequestMatcherEntry;
import nextstep.security.userdetails.UserDetails;
import nextstep.security... | Java | ๊ถํ ๊ณ์ธต์ ์กฐํํ๋๋ก ํ์
จ๊ตฐ์!
์ค์ ์ด ์ ๋์๋์ง ํ์ธํ๊ธฐ ์ํด ์ข์ ์๋์
๋๋ค :)
๋จ, roleHierarchy()์ ๋งค๋ฒ ์ค์ ํ ๋ ๋ง๋ค ์ฃผ์
ํด์ฃผ๋ ํํ๋ก ๊ตฌํํด์ฃผ์
จ๋๋ฐ
ํ๋ฒ๋ง ์ค์ ํ๋ ๋ฐฉ๋ฒ์ ์์ ์ง ๊ณ ๋ฏผํด๋ณด์
๋ ์ข์ ๊ฒ ๊ฐ์์! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.