code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -2,33 +2,43 @@
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;
import nextstep.security.authentication.... | Java | ๋ง์ฝ ์ธ์ฆ์ด ๋์ง์์ ๊ฒฝ์ฐ 401์๋ต์ด ํ์ํ ์ ์๋๋ฐ ํ์ฌ๋ ๋ชจ๋ ์๋ก ์ํฉ์์ 403์ด ์๋ต์ด ๋๋ ๊ฒ ๊ฐ๋ค์! |
@@ -0,0 +1,11 @@
+package nextstep.security.authorization;
+
+import java.util.Collection;
+
+public class NullRoleHierarchy implements RoleHierarchy {
+
+ @Override
+ public Collection<String> getReachableGrantedAuthorities(Collection<String> authorities) {
+ return authorities;
+ }
+} | Java | ๋ ๊ฐ์ฒด ํจํด ๐ |
@@ -0,0 +1,57 @@
+package nextstep.security.authorization;
+
+import java.util.*;
+
+public class RoleHierarchyImpl implements RoleHierarchy {
+ private final Map<String, Set<String>> hierarchyPath;
+
+ private RoleHierarchyImpl(Map<String, Set<String>> hierarchyPath) {
+ this.hierarchyPath = hierarchyPath... | Java | RoleHierarchy ๊ตฌํ ์ ํด์ฃผ์
จ์ต๋๋ค ๐ |
@@ -1,24 +0,0 @@
-package nextstep.security.authorization;
-
-import nextstep.security.authentication.Authentication;
-
-public class HasAuthorityAuthorizationManager implements AuthorizationManager {
- private final String allowRole;
-
- public HasAuthorityAuthorizationManager(String allowRole) {
- this.a... | Java | ์ํ๋ฆฌํฐ ์ฝ๋๋ฅผ ๋ณด๋ฉด AuthorityAuthorizationManager ์ AuthoritiesAuthorizationManager๊ฐ ์๋๋ฐ์
์ด ๊ตฌ์กฐ๋ฅผ ๋ถ์ํด๋ณด์๊ณ HasAuthorityAuthorizationManager ์ ๋์
ํด๋ณด์
๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -0,0 +1,38 @@
+package nextstep.security.authorization;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.params.ParameterizedTest;
+import org.junit.jupiter.params.provider.Arguments;
+import org.junit.jupiter.params.provider.MethodSource;
+
+import java.util.Collection;
+import java.util.List;... | Java | Role Hierarchy ํ
์คํธ ๐ |
@@ -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 | ๊ณ ๋ฏผ ๋์ ๋น๋ ํด๋์ค๋ฅผ ์ถ์ถํ์ฌ ๊ฐ์ ํด๋ณด์์ต๋๋ค!
[72fe548](https://github.com/next-step/spring-security-authorization/pull/23/commits/72fe5487d07f732b75950f6ce55af19c9dabd72b) ํด๋น ์ปค๋ฐ์ ๋ฐ์ํ์์ต๋๋ค. |
@@ -2,33 +2,43 @@
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;
import nextstep.security.authentication.... | Java | ์.. ๊ทธ๋ด์๋ ์๊ฒ ๋ค์!
์ธ๊ฐ์คํจ์ธ ๊ฒฝ์ฐ ์ ๋์ ์ผ๋ก ์ฒ๋ฆฌํ ์ ์๋๋ก ์ธ๊ฐ ์คํจ ํธ๋ค๋ฌ ์ธํฐํ์ด์ค๋ฅผ ์ ์ํ์ฌ ์ฒ๋ฆฌํด๋ณด์์ต๋๋ค!
[fc99a7a](https://github.com/next-step/spring-security-authorization/pull/23/commits/fc99a7a726f73bf39d3a30e7f02f4d2ecab0ec4e) ํด๋น ์ปค๋ฐ์ ๋ฐ์ํด๋์์ต๋๋ค |
@@ -1,24 +0,0 @@
-package nextstep.security.authorization;
-
-import nextstep.security.authentication.Authentication;
-
-public class HasAuthorityAuthorizationManager implements AuthorizationManager {
- private final String allowRole;
-
- public HasAuthorityAuthorizationManager(String allowRole) {
- this.a... | Java | ์ฝ๋ ๊ตฌ์กฐ๋ฅผ ๋ถ์ํด๋ณด๋ AuthoritiesAuthorizationManager๋ ์ฌ๋ฌ๊ฑด์ ์ธ๊ฐ๋ฅผ ์ฒดํฌํ ์ ์๋ ์ญํ ,
AuthorityAuthorizationManager ๋ ์ธ๊ฐ์ ๋ณด๋ฅผ ์ค์ ํ๋ ์ญํ ๋ก ๋ถ๋ฆฌํ๊ฒ ๊ฐ์์.
ํด๋น ๋ถ๋ถ์ ๊ด์ ์ผ๋ก ๋ฆฌํฉํ ๋ง ํด๋ณด์์ต๋๋ค
[8ab4798](https://github.com/next-step/spring-security-authorization/pull/23/commits/8ab47981b3de163a355d9c4c50ef54f1cacf497c)ํด๋น ์ปค๋ฐ์ ๋ฐ์ํด๋ณด์์ต๋๋ค |
@@ -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 | ๋น๋ ํจํด์ ์ ์ฉํ์
จ๊ตฐ์! ์ฌ๋ฏธ์๋ ์๋์
๋๋ค ๐ |
@@ -0,0 +1,44 @@
+package nextstep.security.authorization;
+
+import nextstep.security.authentication.Authentication;
+import org.springframework.util.CollectionUtils;
+
+import java.util.Collection;
+import java.util.Set;
+
+public class AuthoritiesAuthorizationManager implements AuthorizationManager<Collection<String... | Java | AuthoritiesAuthorizationManager ๋ถ๋ฆฌ๋ฅผ ํตํ ์ฑ
์๊ณผ ์ญํ ๋ถ๋ฆฌ ๐ |
@@ -2,33 +2,43 @@
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;
import nextstep.security.authentication.... | Java | ๊ตฌํํด์ฃผ์ ์ฝ๋๋ฅผ ๋ณด๋ ExceptionTranslationFilter์์ ์ฒ๋ฆฌํ๋ ๊ฒ ์ฒ๋ผ AuthorizationDeniedHandler๋ฅผ ํตํด ์๋ฌ๋ฅผ ์ฒ๋ฆฌํ๋๋ก ์์
ํด์ฃผ์
จ๊ตฐ์ ๐
์ฌ์ค ์ฝ๋ฉํธ ๋๋ฆฌ๋ ค ํ๋ ๋ถ๋ถ์ 401์ด ๋ฐ์ํ ์๋ ์์ด์ 403 ์ธ ๋ค๋ฅธ ์๋ต ์ฝ๋๊ฐ ์๋ต๋ ์ ์๋๋ก ์ฒ๋ฆฌํด๋ณด๋ ๊ฒ์ ์๊ฐํด๋ณด์๊ธธ ์๋ฏธํ๋ ์ฝ๋ฉํธ์ฟ์ต๋๋ค :)
์ด๋ ๊ฒ ํ ๊ฒฝ์ฐ AuthorizationDeniedHandler ์ธ ๋ค๋ฅธ handler๊ฐ ํ์ํ ์ ์๊ณ , ํนํ Authentication ๊ด๋ จ ์์ธ๋ฅผ ์ฒ๋ฆฌํ๋ handler๋ ๋ค๋ฅธ ์ธ์ฆ ํํฐ์์๋ ์ฌ์ฉ๋ ์ ์... |
@@ -0,0 +1,104 @@
+import React from "react";
+import { useState } from "react";
+
+const dummies = [
+ { reviewId: 1, isAwarded: true, applicationYear: 2023, semester: "1ํ๊ธฐ", content: "์ฅํ๊ธ ์ ์ฒญ ๊ณผ์ ์ด ๊ฐ๋จํ์ด์!" },
+ { reviewId: 2, isAwarded: false, applicationYear: 2024, semester: "2ํ๊ธฐ", content: "์ ๋ฐ ๊ธฐ์ค์ด ๋ช
ํํ์ง ์์์ ์์ฌ์ ์ด์... | Unknown | ์ฌ์ฉํ์ง ์๋ ๋ถํ์ํ import React๋ ์ ๊ฑฐํด์ฃผ์ธ์~ |
@@ -0,0 +1,104 @@
+import React from "react";
+import { useState } from "react";
+
+const dummies = [
+ { reviewId: 1, isAwarded: true, applicationYear: 2023, semester: "1ํ๊ธฐ", content: "์ฅํ๊ธ ์ ์ฒญ ๊ณผ์ ์ด ๊ฐ๋จํ์ด์!" },
+ { reviewId: 2, isAwarded: false, applicationYear: 2024, semester: "2ํ๊ธฐ", content: "์ ๋ฐ ๊ธฐ์ค์ด ๋ช
ํํ์ง ์์์ ์์ฌ์ ์ด์... | Unknown | ์คํธ~ dummies๋ก ๋ง๋ค์ด ์์ ๊ตฌํ ๊ตฟ๐๐๐ |
@@ -0,0 +1,104 @@
+import React from "react";
+import { useState } from "react";
+
+const dummies = [
+ { reviewId: 1, isAwarded: true, applicationYear: 2023, semester: "1ํ๊ธฐ", content: "์ฅํ๊ธ ์ ์ฒญ ๊ณผ์ ์ด ๊ฐ๋จํ์ด์!" },
+ { reviewId: 2, isAwarded: false, applicationYear: 2024, semester: "2ํ๊ธฐ", content: "์ ๋ฐ ๊ธฐ์ค์ด ๋ช
ํํ์ง ์์์ ์์ฌ์ ์ด์... | Unknown | ๋ณดํต ๋ณํ์ง ์๋ ์์๋ `REVIEWS_IN_ONE_PAGE`์ ๊ฐ์ด ๋๋ฌธ์๋ก ๋ค์ด๋ฐํ๋ ๊ฒ์ด ๋ณดํธ์ ์
๋๋ค~ ์ฐธ๊ณ ํด์ ์ ์ฉํด๋ณผ๊น์~?
- cf. https://ko.javascript.info/variables#ref-337
<img width="777" alt="image" src="https://github.com/user-attachments/assets/038d8339-e35a-4608-a4a3-5e847fe7ad1e" /> |
@@ -0,0 +1,104 @@
+import React from "react";
+import { useState } from "react";
+
+const dummies = [
+ { reviewId: 1, isAwarded: true, applicationYear: 2023, semester: "1ํ๊ธฐ", content: "์ฅํ๊ธ ์ ์ฒญ ๊ณผ์ ์ด ๊ฐ๋จํ์ด์!" },
+ { reviewId: 2, isAwarded: false, applicationYear: 2024, semester: "2ํ๊ธฐ", content: "์ ๋ฐ ๊ธฐ์ค์ด ๋ช
ํํ์ง ์์์ ์์ฌ์ ์ด์... | Unknown | ๋ฐ๋ณต๋ฌธ์ผ๋ก ์ฌ์ฉํ ๋ ๋์คํธ๋ญ์ณ๋ง์ ์ฌ์ฉํ๋ฉด ๋ ๊น๋ํ๊ฒ ํํ์ด ๊ฐ๋ฅํฉ๋๋ค~
์ง๊ธ๋ map ๋ด๋ถ์์ `review.reviewId`, `reveiw.isAwarded` ์ฒ๋ผ `review.`์ด ๊ณ์ ์ค๋ณตํด์ ์ฌ์ฉํ๊ณ ์์ฃ ~
๋์คํธ๋ญ์ณ๋ง์ผ๋ก ์ข ๋ ๊น๋ํ๊ฒ ํํํด ๋ณผ๊น์~?
- cf. https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Operators/Destructuring_assignment |
@@ -0,0 +1,104 @@
+import React from "react";
+import { useState } from "react";
+
+const dummies = [
+ { reviewId: 1, isAwarded: true, applicationYear: 2023, semester: "1ํ๊ธฐ", content: "์ฅํ๊ธ ์ ์ฒญ ๊ณผ์ ์ด ๊ฐ๋จํ์ด์!" },
+ { reviewId: 2, isAwarded: false, applicationYear: 2024, semester: "2ํ๊ธฐ", content: "์ ๋ฐ ๊ธฐ์ค์ด ๋ช
ํํ์ง ์์์ ์์ฌ์ ์ด์... | Unknown | ์คํธ~ ์ธ์ฌํ๊ฒ disabled๊น์ง ์ฑ๊ธฐ๋ค๋~๐ |
@@ -0,0 +1,65 @@
+import History from "@models/History";
+import {
+ getHistoryItemTemplate,
+ NO_HISTORY_TEMPLATE,
+} from "@templates/history";
+
+export default class HistoryController {
+ constructor(historyContainer) {
+ this.historyContainer = historyContainer;
+ this.numberOfHistory = 0;
+ this._init... | JavaScript | ๐ ๐ ๋ฆฌ๋ทฐ๋๋ฆฐ ๋ถ๋ถ ๋ฐ์ํด์ฃผ์
จ๋ค์~! ํ์คํ ํ
ํ๋ฆฟ์ ์์๋ก ๋ถ๋ฆฌํ๋๊น ๊ฐ๋
์ฑ์ด ์ข์์ก๋ค์ :) |
@@ -19,41 +19,56 @@ export default class Repo {
}) {
this.id = id;
this.name = name;
- this.full_name = full_name;
+ this.fullName = full_name;
this.owner = owner;
- this.html_url = html_url;
+ this.htmlUrl = html_url;
this.description = description;
- this.stargazers_count = starg... | JavaScript | `models/User.js` ์์ ์ฌ์ฉ๋๋ ์ด๋ฏธ์ง์๋ alt๊ฐ ํ๊ธ๋ก ๋์ด์๋๋ฐ ์ด๋ถ๋ถ์ ์์ด๋ก ๋์ด์๋ค์! ํต์ผ์์ผ์ฃผ๋ ๊ฒ๋ ์ข์ ๊ฒ ๊ฐ์์~ |
@@ -1,83 +1,112 @@
import GithubApiController from "@controllers/githubController";
import User from "@models/User";
+import {
+ NO_SEARCH_RESULT_TEMPLATE,
+ SEARCH_LOADING_TEMPLATE,
+ getReposTemplate,
+ NO_REPOS_TEMPLATE,
+} from "@templates/search";
+import { SPINNER_TEMPLATE } from "@templates/spinner";
+impo... | JavaScript | ๊ฐ์ธ์ ์ธ ์๊ฐ์ผ๋ก ํจ์๋ช
์ด `getXXXEl`๋ก ๋์ด์์ด์ ๊ธฐ์กด์ ์กด์ฌํ๋ ์๋ ๋จผํธ๋ฅผ ์ฟผ๋ฆฌ์
๋ ํธ๋ก ๊ฐ์ ธ์ค๋ ๊ฒ ๊ฐ์ ๋๋์ด ์๋๋ฐ์, ์๋ก์ด ์๋ ๋จผํธ๋ฅผ ๋ง๋ค์ด์ ๋ฐํํ๋ ์ญํ ์ ํด์ฃผ๊ณ ์์ผ๋ `get` ๋์ `create`๋ผ๋ ์ด๋ฆ์ผ๋ก ๋ค์ด๋ฐํด๋ ์ข์ ๊ฒ ๊ฐ๋ค์ :) |
@@ -1,83 +1,112 @@
import GithubApiController from "@controllers/githubController";
import User from "@models/User";
+import {
+ NO_SEARCH_RESULT_TEMPLATE,
+ SEARCH_LOADING_TEMPLATE,
+ getReposTemplate,
+ NO_REPOS_TEMPLATE,
+} from "@templates/search";
+import { SPINNER_TEMPLATE } from "@templates/spinner";
+impo... | JavaScript | ์ง๋๋ฒ์ `keyCode`๋ก ์ฒ๋ฆฌํ์ ๋ ๋ณด๋ค ์ด๋ค ํค๋ฅผ ๋๋ ์ ๋ ๋์ํ๋ ๋ก์ง์ธ์ง ํ์
ํ๊ธฐ๊ฐ ์ฌ์์ก๋ค์ ๐ |
@@ -0,0 +1,65 @@
+import History from "@models/History";
+import {
+ getHistoryItemTemplate,
+ NO_HISTORY_TEMPLATE,
+} from "@templates/history";
+
+export default class HistoryController {
+ constructor(historyContainer) {
+ this.historyContainer = historyContainer;
+ this.numberOfHistory = 0;
+ this._init... | JavaScript | ์ง์ด์ฃผ์ ๋ณ์๋ช
๋ ์ถฉ๋ถํ ์๋ฏธํ์
์ด ์๋๋๋ฐ์! ํน์ ์ข๋ ๊ฐ๊ฒฐํ ๋ณ์๋ช
์ ์ํ์ ๋ค๋ฉด `historyCount` ๋ก ๋ค์ด๋ฐํ๋ ๋ฐฉ๋ฒ๋ ์์ ๊ฒ ๊ฐ์ต๋๋ค ใ
ใ
|
@@ -1,11 +1,13 @@
import Repo from "@models/Repo";
+import { getDateDiff } from "@utils/dateUtils";
export default class User {
constructor({
id,
avatar_url,
created_at,
email,
+ bio,
followers,
following,
login,
@@ -22,57 +24,114 @@ export default class User {
this.id ... | JavaScript | `loginId` ๋ง ์นด๋ฉ์ผ์ด์ค๋ก ์ ์ ๋์ด์๋ค์! ๋ณ์๋ช
ํ๊ธฐ๋ฒ์ ํต์ผ์ํค๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -19,41 +19,56 @@ export default class Repo {
}) {
this.id = id;
this.name = name;
- this.full_name = full_name;
+ this.fullName = full_name;
this.owner = owner;
- this.html_url = html_url;
+ this.htmlUrl = html_url;
this.description = description;
- this.stargazers_count = starg... | JavaScript | ๊ทธ ๋ถ๋ถ์ ์ ๊ฒฝ์ฐ์ง ๋ชปํ๋ค์!
ํ๊ตญ ์๋น์ค์์๋ alt๋ ํ๊ธ๋ก ์ ์ด์ฃผ๋๊ฒ ๋ ๋์๊น์? |
@@ -1,83 +1,112 @@
import GithubApiController from "@controllers/githubController";
import User from "@models/User";
+import {
+ NO_SEARCH_RESULT_TEMPLATE,
+ SEARCH_LOADING_TEMPLATE,
+ getReposTemplate,
+ NO_REPOS_TEMPLATE,
+} from "@templates/search";
+import { SPINNER_TEMPLATE } from "@templates/spinner";
+impo... | JavaScript | ๊ธฐ์กด vs ์๋ก ์์ฑ์ ๋ค๋ฅธ ๊ฒฝ์ฐ๋๊น create๊ฐ ๋ ๋ช
ํํ๊ฒ ๋ค์ :) |
@@ -0,0 +1,65 @@
+import History from "@models/History";
+import {
+ getHistoryItemTemplate,
+ NO_HISTORY_TEMPLATE,
+} from "@templates/history";
+
+export default class HistoryController {
+ constructor(historyContainer) {
+ this.historyContainer = historyContainer;
+ this.numberOfHistory = 0;
+ this._init... | JavaScript | ๊ฐ๊ฒฐํ ๋ฒ์ ๋ ๊ด์ฐฎ๊ตฐ์ ใ
ใ
|
@@ -1,11 +1,13 @@
import Repo from "@models/Repo";
+import { getDateDiff } from "@utils/dateUtils";
export default class User {
constructor({
id,
avatar_url,
created_at,
email,
+ bio,
followers,
following,
login,
@@ -22,57 +24,114 @@ export default class User {
this.id ... | JavaScript | ๊ฐ์ฒด ํ๋กํผํฐ๋ฅผ ๋ณต์ฌํด์ค๋ ๊ณผ์ ์์ ๋ค๋ฅธ ๋ถ๋ถ์ ์ ๊ฒฝ์ ์ฐ์ง ๋ชปํ๋ค์...! ํต์ผ ์์ผ๋ณด๊ฒ ์ต๋๋ค |
@@ -19,41 +19,56 @@ export default class Repo {
}) {
this.id = id;
this.name = name;
- this.full_name = full_name;
+ this.fullName = full_name;
this.owner = owner;
- this.html_url = html_url;
+ this.htmlUrl = html_url;
this.description = description;
- this.stargazers_count = starg... | JavaScript | ๋ต~ ์ ๊ฐ ์ง๊ธ ์งํํ๊ณ ์๋ ํ๋ก์ ํธ์ ๊ฒฝ์ฐ ๋ค ํ๊ธ๋ก alt ์ ์ด์ฃผ๊ณ ์์ต๋๋ค! |
@@ -19,41 +19,56 @@ export default class Repo {
}) {
this.id = id;
this.name = name;
- this.full_name = full_name;
+ this.fullName = full_name;
this.owner = owner;
- this.html_url = html_url;
+ this.htmlUrl = html_url;
this.description = description;
- this.stargazers_count = starg... | JavaScript | ์ํ! ์ฐธ๊ณ ํด์ ์งํํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค~ |
@@ -0,0 +1,73 @@
+package com.eureka.spartaonetoone.review.application;
+
+import com.eureka.spartaonetoone.review.application.dtos.request.ReviewRequestDto;
+import com.eureka.spartaonetoone.review.application.dtos.response.ReviewResponseDto;
+import com.eureka.spartaonetoone.review.application.exception.ReviewExcepti... | Java | ์๋ ์ฝ๋๋ก ๋ณ๊ฒฝ ๋ถํ๋๋ฆด๊ฒ์ ~~ :)
return ReviewResponseDto.from(review); |
@@ -0,0 +1,73 @@
+package com.eureka.spartaonetoone.review.application;
+
+import com.eureka.spartaonetoone.review.application.dtos.request.ReviewRequestDto;
+import com.eureka.spartaonetoone.review.application.dtos.response.ReviewResponseDto;
+import com.eureka.spartaonetoone.review.application.exception.ReviewExcepti... | Java | ์ ๋ฉ์๋๋ ์ ๊ฑฐํด์ฃผ์
๋ ๋ ๊ฒ ๊ฐ์ต๋๋ค ๋ฏผ์๋ ~~! |
@@ -0,0 +1,152 @@
+package com.eureka.spartaonetoone.store.application;
+
+import com.eureka.spartaonetoone.common.client.OrderClient;
+import com.eureka.spartaonetoone.common.client.ReviewClient;
+import com.eureka.spartaonetoone.common.dtos.response.ReviewResponse;
+import com.eureka.spartaonetoone.common.dtos.respon... | Java | ๋ฏผ์๋ ์ฌ๊ธฐ .from ์ด ๋์ด์ผ ํ ๊ฒ ๊ฐ๋ค์ ~!! ์ฝ๋ ๋ณต๋ถํ๋๋ผ ์ ๊ฐ of๋ฅผ ๋ณต๋ถํ๋ค์ ใ
ใ
:) from์ผ๋ก ๋ถํ๋๋ฆด๊ฒ์ |
@@ -0,0 +1,152 @@
+package com.eureka.spartaonetoone.store.application;
+
+import com.eureka.spartaonetoone.common.client.OrderClient;
+import com.eureka.spartaonetoone.common.client.ReviewClient;
+import com.eureka.spartaonetoone.common.dtos.response.ReviewResponse;
+import com.eureka.spartaonetoone.common.dtos.respon... | Java | from์ผ๋ก ๋ถํ๋๋ฆด๊ฒ์ |
@@ -0,0 +1,152 @@
+package com.eureka.spartaonetoone.store.application;
+
+import com.eureka.spartaonetoone.common.client.OrderClient;
+import com.eureka.spartaonetoone.common.client.ReviewClient;
+import com.eureka.spartaonetoone.common.dtos.response.ReviewResponse;
+import com.eureka.spartaonetoone.common.dtos.respon... | Java | ๋ฏผ์๋ ์ฌ๊ธฐ๋ .from ์ด ๋์ด์ผ ํ ๊ฒ ๊ฐ๋ค์ ~!! |
@@ -0,0 +1,152 @@
+package com.eureka.spartaonetoone.store.application;
+
+import com.eureka.spartaonetoone.common.client.OrderClient;
+import com.eureka.spartaonetoone.common.client.ReviewClient;
+import com.eureka.spartaonetoone.common.dtos.response.ReviewResponse;
+import com.eureka.spartaonetoone.common.dtos.respon... | Java | ๋ฏผ์๋ ์ฌ๊ธฐ๋ .from ์ด ๋์ด์ผ ํ ๊ฒ ๊ฐ๋ค์ ~!! |
@@ -0,0 +1,152 @@
+package com.eureka.spartaonetoone.store.application;
+
+import com.eureka.spartaonetoone.common.client.OrderClient;
+import com.eureka.spartaonetoone.common.client.ReviewClient;
+import com.eureka.spartaonetoone.common.dtos.response.ReviewResponse;
+import com.eureka.spartaonetoone.common.dtos.respon... | Java | ๋ฏผ์๋ createStore ์๋ ์ฒ๋ผ ๋ฐ๊ฟ๋ณด์์ฃ ใ
ใ
```
public StoreResponseDto createStore(StoreRequestDto dto) {
StoreState stateEnum = parseStoreState(dto.getState());
Store store = Store.createStore(
dto.getUserId(),
dto.getName(),
stateEnum,
dto.getTellNumber(),
dto.getDescription(),
dto.getMinOrd... |
@@ -1,70 +1,10 @@
-# Getting Started with Create React App
+# React Westagram 3ํ
-This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
+instagram์ ๋ชจํฐ๋ธ๋ก ํ ํด๋ก ํ ํ๋ก์ ํธ
-## Available Scripts
+# ํ์
-In the project directory, you can run:
-
-### `npm start`
-
-Runs the app... | Unknown | ๐ README.md ํ์ผ ์์ ํด์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค ^^ |
@@ -0,0 +1,61 @@
+import React, { useState, useEffect } from "react";
+import { useNavigate } from "react-router-dom";
+import "./Login.scss";
+
+const Login = () => {
+ const navigate = useNavigate();
+ const [showErrorMessage, setShowErrorMessage] = useState(false);
+
+ const [userInfo, setUserInfo] = useState({
+... | Unknown | ๋ ์ด์ ์ฌ์ฉํ์ง ์๋ ๋ถํ์ํ ์ฝ๋์ ๋ํ ์ฃผ์์ ๊ผญ ์ญ์ ํด์ฃผ์ธ์ |
@@ -0,0 +1,61 @@
+import React, { useState, useEffect } from "react";
+import { useNavigate } from "react-router-dom";
+import "./Login.scss";
+
+const Login = () => {
+ const navigate = useNavigate();
+ const [showErrorMessage, setShowErrorMessage] = useState(false);
+
+ const [userInfo, setUserInfo] = useState({
+... | Unknown | ์ฝ์๋ ๋ง์ฐฌ๊ฐ์ง์
๋๋ค ํ
์คํธ๊ฐ ๋๋ ์ฝ๋๋ ํญ์ ์ง์์ฃผ์ธ์!
์๋์ ๋จ์์๋ ๋ชจ๋ ์ฝ์์ ์ญ์ ํด์ฃผ์ธ์ |
@@ -0,0 +1,61 @@
+import React, { useState, useEffect } from "react";
+import { useNavigate } from "react-router-dom";
+import "./Login.scss";
+
+const Login = () => {
+ const navigate = useNavigate();
+ const [showErrorMessage, setShowErrorMessage] = useState(false);
+
+ const [userInfo, setUserInfo] = useState({
+... | Unknown | ๐ useEffect ๊น์ง ํ์ฉํด๋ณด์
จ๊ตฐ์!
condition ๋ณ์๊ฐ userInfo๋ผ๋ state๋ฅผ ์ด๋ฏธ ์ฐธ์กฐํ ๊ฐ์ด๊ธฐ๋๋ฌธ์ isActive๋ผ๋ ๊ฐ์ ๋ฐ๋ก state๋ก ๊ด๋ฆฌํ์ง์์๋
condition ๋ณ์๊ฐ ์ฐธ์กฐํ๊ณ ์๋ ๊ฐ์ด ์ด๋ฏธ state๋ผ์ state๋ณํ์ ๋ฐ๋ผ ์ฆ๊ฐ์ ์ผ๋ก ๋ค๋ฅธ ๊ฐ์ ๊ฐ์ง ์ ์์ต๋๋ค.
isActive๋ฅผ state๊ฐ ์๋ ์ผ๋ฐ๋ณ์๋ก ๊ด๋ฆฌํด๋ณด์๋๊ฒ ์ด๋จ๊น์? |
@@ -0,0 +1,61 @@
+import React, { useState, useEffect } from "react";
+import { useNavigate } from "react-router-dom";
+import "./Login.scss";
+
+const Login = () => {
+ const navigate = useNavigate();
+ const [showErrorMessage, setShowErrorMessage] = useState(false);
+
+ const [userInfo, setUserInfo] = useState({
+... | Unknown | ๐ ์กฐ๊ฑด๋ถ๋๋๋ง ํ์ฉํด๋ณด์
จ๊ตฐ์!! ์คํ๋ ค showErrorMessage๋ฅผ ๊ด๋ฆฌํ๋ ํจ์๋ฅผ useEffectํจ์ ๋ด์์ ์ ์ธํ condition๊ฐ์ ๋ฐ๋ผ ๋ค๋ฅด๊ฒ ๊ด๋ฆฌํด๋ณผ ์ ์๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,144 @@
+.login {
+ width: 100%;
+ height: 100vh;
+ display: flex;
+ flex-direction: column;
+ justify-content: center;
+ align-items: center;
+
+ .box {
+ padding: 25px 40px;
+ display: flex;
+ flex-direction: column;
+ align-items: center;
+ width: 100%;
+ max-width: 350px;
+ box... | Unknown | ์นํฐํธ ๊ฐ์๊ฒฝ์ฐ๋ index.htmlํ์ผ์์ ์ถ๊ฐํ ์๋ ์๊ณ
common.scss์์ ๊ด๋ฆฌํ ์๋ ์์ต๋๋ค |
@@ -0,0 +1,160 @@
+import React from "react";
+import "./Main.scss";
+import { Link, useNavigate } from "react-router-dom";
+
+const Main = () => {
+ const navigate = useNavigate();
+
+ const goToMain = () => {
+ navigate("/jisun-main");
+ };
+
+ return (
+ <div className="main">
+ <nav>
+ <Link t... | Unknown | reset.scss ํ์ผ๋ ๋ง์ฐฌ๊ฐ์ง๋ก ์ ์ญ์์ ์ ์ฉ๋์ด์ผ ํ๋ ํ์ผ์์ผ๋ก index.js์์ importํด ์ค๋๊ฒ์ด ์ข์ต๋๋ค. |
@@ -0,0 +1,160 @@
+import React from "react";
+import "./Main.scss";
+import { Link, useNavigate } from "react-router-dom";
+
+const Main = () => {
+ const navigate = useNavigate();
+
+ const goToMain = () => {
+ navigate("/jisun-main");
+ };
+
+ return (
+ <div className="main">
+ <nav>
+ <Link t... | Unknown | ์์ด์ฝ๋ค์ ๋๋ ์๋ ํน์ ํ์ด์ง๋ก ์ด๋ํด์ผํ๋๊ฒ์ด ์๋๋ผ๋ฉด a ํ๊ทธ๋ Link ํ๊ทธ๊ฐ ์๋ ์ฌํ ๋ค๋ฅธํ๊ทธ๋ฅผ ํ์ฉํด์ ๊ธฐ๋ฅ์ ๊ตฌํํ ์ ์์ต๋๋ค! |
@@ -0,0 +1,160 @@
+import React from "react";
+import "./Main.scss";
+import { Link, useNavigate } from "react-router-dom";
+
+const Main = () => {
+ const navigate = useNavigate();
+
+ const goToMain = () => {
+ navigate("/jisun-main");
+ };
+
+ return (
+ <div className="main">
+ <nav>
+ <Link t... | Unknown | ํด๋น ์๋๊ฒฝ๋ก๊ฐ publicํด๋๋ฅผ ์ฐธ๊ณ ํ๋๊ฑฐ๋ผ๋ฉด
```suggestion
<img alt="๊ณ์ ํ๋กํ ์ฌ์ง" src="/images/jisun/img_profile.png" />
```
์ด๋ ๊ฒ ํํํ ์ ์์ต๋๋ค |
@@ -0,0 +1,160 @@
+import React from "react";
+import "./Main.scss";
+import { Link, useNavigate } from "react-router-dom";
+
+const Main = () => {
+ const navigate = useNavigate();
+
+ const goToMain = () => {
+ navigate("/jisun-main");
+ };
+
+ return (
+ <div className="main">
+ <nav>
+ <Link t... | Unknown | className์ด ๋๋ฌด ๋ชจํธํฉ๋๋ค!! ์ด๋ค ์์ด์ฝ์ธ์ง ์๋ ค์ฃผ์ธ์ |
@@ -1 +1,23 @@
# spring-security
+## ๐ 1-1๋จ๊ณ - OAuth 2.0 Login
+
+- [x] Github Application ๋ฑ๋ก
+- [x] ์ธ์ฆ URL ๋ฆฌ๋ค์ด๋ ํธ ํํฐ ๊ตฌํ
+- [x] Github Access Token ํ๋
+- [x] OAuth2 ์ฌ์ฉ์ ์ ๋ณด ์กฐํ
+- [x] ํ์ฒ๋ฆฌ
+ - [x] ์ดํ ํ๋กํ ์ ๋ณด๋ฅผ ๊ฐ์ง๊ณ ํ์ ๊ฐ์
& ๋ก๊ทธ์ธ์ ๊ตฌํํ๋ค.
+ - [x] ๊ธฐ์กด ๋ฉค๋ฒ ์ ๋ณด๊ฐ ์๋ ๊ฒฝ์ฐ ์ธ์
์ ๋ก๊ทธ์ธ ์ ๋ณด๋ฅผ ์ ์ฅํ ๋ค "/"์ผ๋ก ๋ฆฌ๋ค์ด๋ ํธ
+ - [x] ์๋ก์ด ๋ฉค๋ฒ์ธ ๊ฒฝ์ฐ ํ์ ๊ฐ์
ํ ์ธ์
์ ๋ก๊ทธ์ธ... | Unknown | ์๊ตฌ์ฌํญ ์ ๋ฆฌ ๐ |
@@ -0,0 +1,50 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AuthenticationException;
+import... | Java | OAuth2AuthorizationRequestResolver์์ OAuth2AuthorizationRequest๋ฅผ ์์ฑํ ๋, authorizationRequestUri์ ํ์์ ์ธ ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ(client_id, response_type, scope, redirect_uri ๋ฑ)๋ฅผ ๋ฏธ๋ฆฌ ํฌํจํ ์๋ ์์ ๊ฒ ๊ฐ์๋ฐ, ์ด๋ป๊ฒ ์๊ฐํ์๋์? ๐
```suggestion
response.sendRedirect(authorizationRequest.getAuthorizationRequestUri());
``` |
@@ -0,0 +1,115 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AbstractAuthenticationProcessingFilter;
+import nextstep.security.authent... | Java | Spring Security์์๋ OAuth2AuthorizationResponseUtils.toMultiMap(request.getParameterMap())์ ์ฌ์ฉํ์ฌ OAuth2 ์๋ต์ MultiValueMap์ผ๋ก ๋ณํํ ํ, OAuth2AuthorizationResponseUtils.isAuthorizationResponse()๋ฅผ ํตํด ์ ํจ์ฑ์ ๊ฒ์ฌํ๋ ๋ฐฉ์์ ์ฌ์ฉํฉ๋๋ค. ํ๋ฒ ํ์ธํด ๋ณด์
๋ ์ข์ ๊ฒ ๊ฐ์์ ๐ |
@@ -0,0 +1,115 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AbstractAuthenticationProcessingFilter;
+import nextstep.security.authent... | Java | ๋ถํ์ํ ์ค๋ฒ๋ผ์ด๋ฉ ์ด๋ผ๊ณ ์๊ฐ๋๋ค์. ์ ๊ฑฐํด๋ ๋๊ฒ ์ต๋๋ค ๐ |
@@ -0,0 +1,115 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AbstractAuthenticationProcessingFilter;
+import nextstep.security.authent... | Java | ํด๋น ์ฃผ์์ ์ ๊ฑฐํ ์์ ์ด์ค๊น์? ๐ค |
@@ -0,0 +1,115 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AbstractAuthenticationProcessingFilter;
+import nextstep.security.authent... | Java | ๋ต๋ต ใ
ใ
ใ
์ ๊ฑฐํ๋๋ก ํ๊ฒ ์ต๋๋ค. ๐ |
@@ -0,0 +1,115 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AbstractAuthenticationProcessingFilter;
+import nextstep.security.authent... | Java | ์ํ, OAuth2AuthorizationResponseUtils์์ Request Paramater๋ฅผ Map์ผ๋ก ๋ณํํ์ฌ ์ฌ์ฉํ๋ ๋ถ๋ถ์ ์ฐธ๊ณ ํ์ฌ ์์ ํด๋ณด์์ต๋๋ค ๐ |
@@ -0,0 +1,50 @@
+package nextstep.security.oauth2.authentication;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.AuthenticationException;
+import... | Java | ์ด๋ถ๋ถ์ Redirect Filter๊ฐ ๋ชจ๋ Redirect Url ์คํ์ ์๊ฒ ๋๋ ๊ฒ ๊ฐ์์, ์์ฑ ์ฑ
์์ Resolver์๊ฒ ๋งก๊ธฐ๋ ๊ฒ์ด ์ข์๋ณด์ด๋ค์ !! ๐ |
@@ -78,6 +78,7 @@ public List<ReviewPhoto> createReviewPhoto(Long reviewId, List<MultipartFile> re
List<ReviewPhoto> reviewPhotoList = new ArrayList<>();
List<String> photoUrls = new ArrayList<>();
+ if(reviewPhotos == null) return reviewPhotoList;
reviewPhotos.forEach(multipartFile ... | Java | ์ด ๋ถ๋ถ์ ์ด๋ค ์๋ฏธ์ธ๊ฐ์? |
@@ -78,6 +78,7 @@ public List<ReviewPhoto> createReviewPhoto(Long reviewId, List<MultipartFile> re
List<ReviewPhoto> reviewPhotoList = new ArrayList<>();
List<String> photoUrls = new ArrayList<>();
+ if(reviewPhotos == null) return reviewPhotoList;
reviewPhotos.forEach(multipartFile ... | Java | ์ด ๋ถ๋ถ์ ์ด๋ค ์๋ฏธ์ธ๊ฐ์? |
@@ -0,0 +1,34 @@
+package com.luckytree.shop.utils;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Type;... | Java | ์ด ํด๋์ค๋ฅผ ์ฌ์ฉํ๋ ๊ณณ์ด ์ด๋๊ฐ์? |
@@ -32,12 +32,11 @@ public class ReviewController {
private final ReviewUseCase reviewUseCase;
@Operation(summary = "๋ฆฌ๋ทฐ ๋ฑ๋ก")
- @PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+ @PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
public Res... | Java | ๋ฆฌํ์คํธ๋ฐ๋๊ฐ ์ฌ๋ผ์ก๋๋ฐ, ์ด ๊ฒฝ์ฐ์๋ ํด๋ผ์ด์ธํธ์์ JSON ํ์์ Body ํ๊ทธ ๋ฐ์ดํฐ๋ฅผ ๋ฐ์์ค๋ ๋ฐ์ ๋ฌธ์ ๊ฐ ์๋์? |
@@ -78,6 +78,7 @@ public List<ReviewPhoto> createReviewPhoto(Long reviewId, List<MultipartFile> re
List<ReviewPhoto> reviewPhotoList = new ArrayList<>();
List<String> photoUrls = new ArrayList<>();
+ if(reviewPhotos == null) return reviewPhotoList;
reviewPhotos.forEach(multipartFile ... | Java | ๋ฆฌ๋ทฐ ์์ฑ ์ ํฌํ ๋ฅผ ์ ํํ์ง ์์๋ ์ด ์๋น์ค๊ฐ ์คํ๋์ด์ ์ ํ๋์ง ์์์ ๋ ๋ฐ๋ก ๋น ์ ธ๋๊ฐ๊ฒ ํ๊ฒ๋๋ค |
@@ -0,0 +1,34 @@
+package com.luckytree.shop.utils;
+
+import com.fasterxml.jackson.databind.ObjectMapper;
+import org.springframework.http.MediaType;
+import org.springframework.http.converter.json.AbstractJackson2HttpMessageConverter;
+import org.springframework.stereotype.Component;
+
+import java.lang.reflect.Type;... | Java | swagger์์ ๋ฆฌ๋ทฐ ์์ฑ API์ multipartfile์ ์ฌ์ฉํด์ ๊ทธ๊ฑฐ ์ฌ์ฉํ๊ฒ ๋ง๋ค์ด์ฃผ๋ ํด๋์ค์
๋๋ค |
@@ -32,12 +32,11 @@ public class ReviewController {
private final ReviewUseCase reviewUseCase;
@Operation(summary = "๋ฆฌ๋ทฐ ๋ฑ๋ก")
- @PostMapping(consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
+ @PostMapping(consumes = {MediaType.APPLICATION_JSON_VALUE, MediaType.MULTIPART_FORM_DATA_VALUE})
public Res... | Java | swagger๋ postman์์ ํ์ธํ๊ณ ์คํ๋ ค ๋ฆฌํ์คํธ๋ฐ๋๋ฅผ ์ผ์ ๋ ์๋ผ์ ๋ฐ๊ฟจ์ต๋๋ค. ์ด์ ๋ ์ฐพ์๋ณด๊ฒ ์ต๋๋ค |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ์ด ์ฃผ์์ ๋ณด๊ธฐ ์ ์๋ isGroupLoggedIn์ด ๋ฌด์จ ๋ป์ธ์ง ์ถ์ธกํ๊ธฐ ์ด๋ ค์ ์ด์. ์๊ฐ ์ ์ ๋ง๊ณ ๋ค๋ฅธ ๊ทธ๋ฃน์ด ์๋? ์ถ์๋๋ฐ ๋งํฌ๋ฅผ ์ด๋ค ์ํ๋ก ๋ง๋ค์๋๋ฅผ ๋ํ๋ด๋ ๋ณ์์๊ตฐ์~
์ด ๋งํฌ๊ฐ ๋ก๊ทธ์ธํ ์ฌ์ฉ์๊ฐ ๋ง๋ ๊ฒ์ธ์ง๋ฅผ ๋ณ์๋ช
์์ ๋ณด๋ค ์ง๊ด์ ์ผ๋ก ๋ํ๋ฌ์ผ๋ฉด ์ข๊ฒ ์ด์!
๋ค๋ฅธ ๋ถ๋ค์ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -1,5 +1,7 @@
import { ReviewGroupData } from '@/types';
+import { MOCK_USER_PROFILE } from './userProfileData';
+
export const VALIDATED_PASSWORD = '1234';
export const MOCK_AUTH_TOKEN_NAME = 'mockAuthToken';
@@ -14,12 +16,18 @@ export const bothCookie = [MOCK_AUTH_TOKEN_NAME, MOCK_LOGIN_TOKEN_NAME];
*/
... | TypeScript | revieweeId๊ฐ ์์ ๋ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค! ์๋ฏธ ์๋ ๊ฐ์ด๋ผ๋ฉด ์์ํํด์ผ ํ ๊ฒ ๊ฐ์์์. |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | `reviewWrite`๊ฐ `ActionOnLogin`ํ์
์ ๊ฐ์ด๋ผ ์ฌ๊ธฐ์๋ ์๋์์ฑ์ด ๋๋ฉด ์ข์ ๊ฒ ๊ฐ์์.
ํ `ActionOnLogin` ํ์
์ ๊ฐ๋ค์ ์์ํํ๊ณ , `ActionOnLogin` ํ์
์ ์์์์ ํ์๋ ํ์
์ผ๋ก ๋ง๋ค๋ฉด ์ ์ง๋ณด์๊ฐ ํธํ ๊ฒ ๊ฐ์ต๋๋ค! (๋์ค์๋ผ๋) |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ผ์ ํ์ด์ง ์ด๋ํ๋ useEffect ๋ด๋ถ ์ฝ๋๋ฅผ ๋ฐ์ผ๋ก ๋ถ๋ฆฌํ์ผ๋ฉด ์ข๊ฒ ์ด์. |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ๋ฆฌ๋ทฐ ์ฐ๊ฒฐ ํ์ด์ง ๋ถ๊ธฐ ์ฒ๋ฆฌ๋ก ์ธํด, jsx ์ฝ๋๊ฐ ๋ง์์ง๋ค๋ณด๋, ํ๋ก์ ํธ ์ด๋ฆ์ ๋ฐ๋ฅธ ์กฐ์ฌ ์ฒ๋ฆฌ ์ฝ๋ ๊ฐ๋
์ฑ ๋ถ๋ถ์ ์ ๊ฒฝ์จ์ผ๊ฒ ์ด์.
jsx๊ฐ ์๋ ์์์์ ๋ณ์๋ก ์ฒ๋ฆฌํ๋ ๊ฒ์ ์ด๋จ๊น์? |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ํ์ ์ปดํฌ๋ํธ๋ก ๋๋๋ค๋ฉด, ๋ถ๋ฆฌ ์ฒ๋ฆฌ๋ก ๋ณต์กํ ๋ฆฌ๋ทฐ ์ฐ๊ฒฐ ํ์ด์ง์ ์ญํ ์ด ํ์ ์ปดํฌ๋ํธ๋ณ๋ก ํ ๋์ ์ ๋ณด์ผ ๊ฑฐ ๊ฐ์์. |
@@ -1,5 +1,7 @@
import { ReviewGroupData } from '@/types';
+import { MOCK_USER_PROFILE } from './userProfileData';
+
export const VALIDATED_PASSWORD = '1234';
export const MOCK_AUTH_TOKEN_NAME = 'mockAuthToken';
@@ -14,12 +16,18 @@ export const bothCookie = [MOCK_AUTH_TOKEN_NAME, MOCK_LOGIN_TOKEN_NAME];
*/
... | TypeScript | ์๋ฏธ ์๋ ๊ฐ์ ์๋๋๋ค๐
๋ฆฌ๋ทฐ ํ์ธ ์, ๋ณธ์ธ์ด ๋ง๋ ๋งํฌ์ธ์ง ์๋์ง ํ๋จํ๋ ๊ณผ์ ์์ ๊ฐ์ ๋ฐ๊พธ๋ฉด์ ๋น๊ตํ๋ค๊ฐ ๊ทธ๋ฅ ์ปค๋ฐ๋๋ค์.
๋ฐ๋ค๊ฐ ์์ํ ์์
ํด์ฃผ์์ต๋๋ค๐๐ป |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ๋ฐ์ํ์ต๋๋ค๐๐ป |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ์ ๋ ๊ทธ๋ฃน ๋ณด๋ค๋ ๋งํฌ๊ฐ ์กฐ๊ธ ๋ ์ง๊ด์ ์ผ๋ก ์๋ฟ์์, `isMemberLink`๋ก ์์ ํ์ต๋๋ค.
๋ค๋ง ๊ด๋ จ API ํจ์ ๋ฐ ํ์
๋ช
์ด ๋ชจ๋ ReviewGroup์ผ๋ก ํ๊ธฐ๋์ด ์์ด์, `ReviewGroup`์ด๋ผ๋ ํ๊ธฐ ์์ฒด๋ฅผ `ReviewLink`๋ก ํต์ผํ๋ ๊ฒ ์ข์ ๊ฒ ๊ฐ์์. ์ด๊ฑด ๋ชจ๋์ ์๊ฒฌ์ ๋ค์ด๋ณด๊ณ ์ถ์ด์ ์ฐ์ ๋ฐ์ํ์ง ์๊ฒ ์ต๋๋ค. |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | > ์ฟผ๋ฆฌ ํ๋ผ๋ฏธํฐ์ ๋ฐ๋ผ์ ํ์ด์ง ์ด๋ํ๋ useEffect ๋ด๋ถ ์ฝ๋๋ฅผ ๋ฐ์ผ๋ก ๋ถ๋ฆฌ
์ข ๋ ์์ธํ๊ฒ ์ค๋ช
ํด์ฃผ์๊ฒ ์ด์? ๋ณ๋์ ํจ์๋ก ๋ถ๋ฆฌํด์ useEffect ๋ด๋ถ ์ฝ๋๋ฅผ ์งง๊ฒ ์ ์งํ๋ ๊ฒ์ด ๋ชฉ์ ์ธ์ง ๊ถ๊ธํด์ |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ํฉ์ฑ ์ปดํฌ๋ํธ ํจํด์ผ๋ก ๊ตฌํํ ๋ฒํผ๋ค์ ๊ฐ๊ฐ์ ์ปดํฌ๋ํธ๋ก ๋ถ๋ฆฌํ๋ฉด ์ข๊ฒ ๋ค๋ ์๊ฒฌ์ผ๊น์?
๋ฒํผ๋ง๋ค ์คํ์ผ ์ฝ๋๊ฐ ๊ฐ๊ณ , ๋๋๋ค๋ฉด Write/Check ๋๋ก๋ง ๋๋์ง ๋ฑ ์๊ฐํ ๋ถ๋ถ๋ค์ด ์์ด์ ์ข ๋ ๊ณ ๋ฏผํด๋ณด๊ฒ ์ต๋๋ค
(์ด ๋ถ๋ถ ์ฝ๋๋ฅผ ๋ค๋ฌ์ด์ผ ํ๋ค๋ ๊ฒ์ ๋์ํด์) |
@@ -3,49 +3,96 @@ import { useNavigate } from 'react-router';
import { useRecoilState } from 'recoil';
import ReviewZoneIcon from '@/assets/reviewZone.svg';
-import { Button, ImgWithSkeleton } from '@/components';
+import { ImgWithSkeleton, LoginRequestModal } from '@/components';
import { ROUTE } from '@/constant... | Unknown | ์คํ์ผ ์ปดํฌ๋ํธ๋ช
์ผ๋ก ๋ ์ด์์ ๊ตฌ๋ถ์ ํ ์ ์์ง๋ง, ์ปดํฌ๋ํธ๋ค์ด ๋์ด๋ ๋๋์ด๋ผ ํฌ๊ฒ ๋ฆฌ๋ทฐ ๊ทธ๋ฃน ์ ๋ณด, ์ฐ๊ธฐ ๋ฒํผ, ํ์ธ ๋ฒํผ, ๋ชจ๋ฌ๋ก ๋๋์ด์ง ์ ์์ ๊ฒ ๊ฐ์์. ๋ชจ๋ฌ์ ํด๋น ๋ชจ๋ฌ์ ์ด๊ฒํ๋ ๋ฒํผ๊ณผ ์ฎ์ด์ ํ๋์ ์ปดํฌ๋ํธ๋ด์์ ๊ด๋ฆฌํ๋ฉด ํ๋ฆ ํ์
์ ๋ ์ข์ ๊ฒ ๊ฐ์์. |
@@ -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,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,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,77 @@
+import React, { useState } from "react";
+import styled from "styled-components";
+import { Star as StarIcon } from "lucide-react";
+
+interface StarRatingProps {
+ totalStars?: number;
+ initialRating?: number;
+ onRatingChange?: (rating: number) => void;
+}
+
+const BackgroundContainer = styled.d... | Unknown | filled ์์ชฝ์ String์ผ๋ก ๊ฐ์ธ์ฃผ์ธ์ |
@@ -0,0 +1,77 @@
+import React, { useState } from "react";
+import styled from "styled-components";
+import { Star as StarIcon } from "lucide-react";
+
+interface StarRatingProps {
+ totalStars?: number;
+ initialRating?: number;
+ onRatingChange?: (rating: number) => void;
+}
+
+const BackgroundContainer = styled.d... | Unknown | ์ ๊ฐ ํ๊ธฐ ํ์ด์ง ๋ง๋ค๋ฉด์ ์ด ๋ถ๋ถ ์์ ํด์ ํ๊บผ๋ฒ์ PR ์ฌ๋ฆฌ๊ฒ ์ต๋๋ค |
@@ -1,5 +1,7 @@
package com.chone.server.domains.review.domain;
+import static org.springframework.util.StringUtils.hasText;
+
import com.chone.server.commons.jpa.BaseEntity;
import com.chone.server.domains.order.domain.Order;
import com.chone.server.domains.store.domain.Store;
@@ -80,4 +82,12 @@ public static Re... | Java | ํด๋น update ๋ฉ์๋์ ๊ฒฝ์ฐ์ not null์ด๋ not blank ์ ํจ์ฑ ๊ฒ์ฆ์ ์ ํ๊ณ ์์ต๋๋ค.
๋ฐ๋ก ์ด์ ๊ฐ ์์๊น์?
๋ง์ผ ์ด๋ด ๊ฒฝ์ฐ request์์ null์ด ์๋ ๊ฐ์ด ์๋ค๋ฉด ์ํฐํฐ์ ํ๋ ๊ฐ์ด null๋ก ๋ณ๊ฒฝ๋๊ณ , ์ด๊ฒ์ด ๋ณ๊ฒฝ๊ฐ์ง๊ฐ ๋์ด์
๋ฐ์ดํฐ๋ฒ ์ด์ค์ ๋ฐ์ดํฐ๊ฐ null ๊ฐ์ผ๋ก ์
๋ฐ์ดํธ๋ ๊ฐ๋ฅ์ฑ์ด ์์ต๋๋ค!(์๋ฅผ ๋ค์ด, `update(null, null, null, null)`์ ํธ์ถํ๋ฉด ํด๋น ํ๋๊ฐ null๋ก ๋ฎ์ด์์์ง๋๋ค)
```java
import static org.springframework.util.StringUtils.has... |
@@ -8,9 +8,11 @@
import com.chone.server.domains.review.domain.Review;
import com.chone.server.domains.review.dto.request.CreateRequestDto;
import com.chone.server.domains.review.dto.request.ReviewListRequestDto;
+import com.chone.server.domains.review.dto.request.UpdateRequestDto;
import com.chone.server.domains.r... | Java | ์ ๋ ์ด๋ฒ์ ์ฃผ๋ฌธ ์ญ์ ๊ธฐ๋ฅ์ ๊ตฌํํ๋ฉด์ ๊ฐ์๊ธฐ ๊นจ๋ฌ์ ๊ฑด๋ฐ,
์ ํฌ๊ฐ soft delete๋ฅผ ํ๊ณ ์์ด์ findById๋ฅผ ํ ๋ ์กฐ๊ฑด์ผ๋ก deletedAt null ์กฐ๊ฑด์ ๊ฑธ์ด์ผ ์ญ์ ๋ ๊ฒ์ ์ ์ธํ ์ ์๊ฒ ๋ฉ๋๋ค.
๊ทธ๋์ ์กฐํ ์ ํด๋น ์กฐ๊ฑด์ ํฌํจํ์ฌ ์์ ํ๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์์! ์๋๋ฉด ๋ธ๋์น๋ฅผ ์๋ก ํ์ ํด๋น ๊ด๋ จ ์กฐํ๋ค์ ์์ ํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -1,5 +1,7 @@
package com.chone.server.domains.review.domain;
+import static org.springframework.util.StringUtils.hasText;
+
import com.chone.server.commons.jpa.BaseEntity;
import com.chone.server.domains.order.domain.Order;
import com.chone.server.domains.store.domain.Store;
@@ -80,4 +82,12 @@ public static Re... | Java | ์๋น์ค ๋ ์ด์ด์์ ์ ํจ์ฑ ๊ฒ์ฌ๋ฅผ ์ํํ๊ณ ์๊ธฐ ๋๋ฌธ์ ์ด๋ ๊ฒ ๋๋ฉด ํด๋น ํ๋์์ null ๋ก DB ๋ฐ์๋๋ค๋ ๊ฑธ ๋์ณค์ต๋๋ค! ์๋ ค์ฃผ์ ๋ฐฉ๋ฒ์ผ๋ก ์์ ํ๋๋ก ํ๊ฒ ์ต๋๋ค :) |
@@ -8,9 +8,11 @@
import com.chone.server.domains.review.domain.Review;
import com.chone.server.domains.review.dto.request.CreateRequestDto;
import com.chone.server.domains.review.dto.request.ReviewListRequestDto;
+import com.chone.server.domains.review.dto.request.UpdateRequestDto;
import com.chone.server.domains.r... | Java | ์กฐํ ์ ์ญ์ ๋ ๋ฆฌ๋ทฐ ์กฐํ๋์ง ์๋๋ก ์์ ํ๊ฒ ์ต๋๋ค~ |
@@ -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 ํด๋์ค๋ก ์ฌ์ฉํ๋ ๊ฒ์ ์ ํธํด์... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.