code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -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 ์์ธ๋ฅผ ๋ฐ์ํ๋ค. ์ด๋ค ๋ฐฉํฅ์ฑ์ด ์ข์์ง ๊ณ ๋ฏผํด ๋ณด์์. |
@@ -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์์ ํ์ธํ๊ณ ์คํ๋ ค ๋ฆฌํ์คํธ๋ฐ๋๋ฅผ ์ผ์ ๋ ์๋ผ์ ๋ฐ๊ฟจ์ต๋๋ค. ์ด์ ๋ ์ฐพ์๋ณด๊ฒ ์ต๋๋ค |
@@ -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()์ ๋งค๋ฒ ์ค์ ํ ๋ ๋ง๋ค ์ฃผ์
ํด์ฃผ๋ ํํ๋ก ๊ตฌํํด์ฃผ์
จ๋๋ฐ
ํ๋ฒ๋ง ์ค์ ํ๋ ๋ฐฉ๋ฒ์ ์์ ์ง ๊ณ ๋ฏผํด๋ณด์
๋ ์ข์ ๊ฒ ๊ฐ์์! |
@@ -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,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... |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | final ๋ก ์ ์ธํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค~ |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | check ๋ฉ์๋๋ค์ด public ์ธ ์ด์ ๊ฐ ์๋์~? |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | java 8 ์ stream map ์ ์จ๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | ์ ๊ทผ์ ์ด์๋ฅผ package-private ์ผ๋ก ํ์ ์ด์ ๊ฐ ์์๊น์? |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | Set<LottoNo> ๋ก ์ ์ธํ๋ ๊ฒ์ ์ด๋ป๊ฒ ์๊ฐํ์๋์~ |
@@ -0,0 +1,46 @@
+import java.util.Objects;
+
+public class LottoNo implements Comparable<LottoNo> {
+ private final static int INVALID_NUM = 0;
+ public final static LottoNo INVALID_LOTTO_NO = new LottoNo(INVALID_NUM);
+
+ private int lottoNumber;
+
+ public LottoNo(int lottoNumber) {
+ try {
+ ... | Java | LottoNo ๋ ๋ณ๊ฒฝ๋์ง ์๋ lottoNumber ํ๋๋ฅผ ๊ฐ์ง๊ณ ์์ด์ผํ๋ฏ๋ก
final ํค์๋๋ฅผ ๋ฃ์ด๋ ๋ ๊ฒ ๊ฐ๋ค์ ใ
ใ
|
@@ -0,0 +1,46 @@
+import java.util.Objects;
+
+public class LottoNo implements Comparable<LottoNo> {
+ private final static int INVALID_NUM = 0;
+ public final static LottoNo INVALID_LOTTO_NO = new LottoNo(INVALID_NUM);
+
+ private int lottoNumber;
+
+ public LottoNo(int lottoNumber) {
+ try {
+ ... | Java | ์.. RuntimeException ์ ๋ฐ์์ํค๊ณ catch ๋ฅผ ๊ตณ์ด ํ๋ ์ด์ ๊ฐ ์์๊น์?
checkedException ๊ณผ uncheckedException ์ ๋ํด์ ๊ณต๋ถํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค~ |
@@ -0,0 +1,46 @@
+import java.util.Objects;
+
+public class LottoNo implements Comparable<LottoNo> {
+ private final static int INVALID_NUM = 0;
+ public final static LottoNo INVALID_LOTTO_NO = new LottoNo(INVALID_NUM);
+
+ private int lottoNumber;
+
+ public LottoNo(int lottoNumber) {
+ try {
+ ... | Java | ๊ตณ์ด ๋ฉ์๋๋ก ๋นผ์ง ์์๋ ๋ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,40 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class LottoRankResult {
+ private List<Rank> ranks;
+
+ public LottoRankResult(WinningLotto winningLotto, LottoTicket lottoTicket) {
+ this.ranks = new ArrayList<>();
+
+ for (Lotto lotto : lottoTicket.getAllLottoGames()... | Java | ๋ญ๊ฐ ์ด๋ฆ์ด ๊ฒฐ๊ณผ๋ฅผ ๋ด๋ ๋ฐ์ดํฐ ๊ทธ๋ฆ ๊ฐ์ ๋๋์ด๋ผ
LottoCalculator
LottoResultCalculator
LottoRankCalculator
๊ฐ์ ๋ค์ด๋ฐ์ผ๋ก ๋ณ๊ฒฝํด๋ณด๋ฉด ์ด๋จ๊น์?
๊ทธ์ ๋ง์ถฐ์ ๋ฉ์๋ ๋ค์ด๋ฐ๋ ๋ณ๊ฒฝํ๋ฉด ๋จ์ํ set ๋ ๋ฐ์ดํฐ๋ฅผ get ํ๋ ๊ฒ๋ณด๋ค
์ํ์ ํ์๋ฅผ ๊ฐ๋ ๊ฐ์ฒด์งํฅ์ ์ธ ๋ค์ด๋ฐ์ด ๋ ๊ฒ ๊ฐ๋ค๋ ์๊ฐ์ด ๋ญ๋๋ค |
@@ -0,0 +1,22 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class Lottos {
+ private List<Lotto> lottos;
+
+ public Lottos() {
+ this.lottos = new ArrayList<>();
+ }
+
+ public List<Lotto> getLottos() {
+ return lottos;
+ }
+
+ public void addLotto(Lotto lotto) {
+ ... | Java | Lottos ๊ฐ ๊ฐ์ง๋ ํ์๊ฐ ํ๋๋ ์๋๋ฐ์,
๋ค๋ฅธ ๊ฐ์ฒด์์ ์์ํ ๋งํ๊ฒ ์์๊น์?
get์ด ์ฌ์ฉ๋๊ณ ์๋ค๋ ๊ฒ์ Lottos ์ tell dont ask ์์น์ด ์์ง์ผ์ง๊ณ ์๋ค๋ ๋ป์ด๊ณ ,
์ฌ๊ธฐ๋ก ์์ํ ๋งํ ์ฑ
์์ด ์ฐ์ฌํด ์๋ค๋ ๋ป์ด๊ธฐ๋ ํฉ๋๋ค. |
@@ -0,0 +1,29 @@
+import java.util.List;
+
+public class WinningLotto {
+ private Lotto winningLotto;
+ private LottoNo bonusNo;
+
+ public WinningLotto(List<LottoNo> winningLottoNumbers, LottoNo lottoNo) {
+ if (winningLottoNumbers == null) {
+ throw new IllegalArgumentException("'lotto' mus... | Java | Lotto๋ฅผ ์์ ๋ฐ์ ์๋ ์์๋๋ฐ ์ด๋ ๊ฒ ํฉ์ฑ์ ์ฌ์ฉํ์
จ๋ค์. ๐
ํน์๋ผ๋ ์ฐ์ฐํ ์ด๋ ๊ฒ ๊ตฌํํ์ ๊ฑฐ๋ผ๋ฉด,
์์๊ณผ ํฉ์ฑ์ ๊ตฌ๊ธ๋ง ํด๋ณด์๋ฉด ๊ด๋ จ ์๋ฃ๋ฅผ ์ฐพ์ผ์ค ์ ์์๊ฒ๋๋ค ~ |
@@ -0,0 +1,43 @@
+import java.util.Scanner;
+
+public class LottoApplication {
+ private static boolean APP_SUCCESS = false;
+
+ public static void main(String[] args) {
+ runUntilAppSuccess();
+ }
+
+ public static void runUntilAppSuccess() {
+ while (!APP_SUCCESS) {
+ run();
+ ... | Java | LottoGame ์ด๋ผ๋ ๋ค์ด๋ฐ์ ์ด๋จ๊น์ |
@@ -0,0 +1,43 @@
+import java.util.Scanner;
+
+public class LottoApplication {
+ private static boolean APP_SUCCESS = false;
+
+ public static void main(String[] args) {
+ runUntilAppSuccess();
+ }
+
+ public static void runUntilAppSuccess() {
+ while (!APP_SUCCESS) {
+ run();
+ ... | Java | lottoService ์ set ํ๊ณ get ํ๊ณ ์ ์ฐจ์งํฅ์ ์ธ ๋ฐฉ์์ผ๋ก ์ฝ๋๊ฐ ์ง์ฌ์ ธ ์์ต๋๋ค.
๋ชจ๋ ๋ก์ง์ด lottoService ๋ฅผ ํตํ๋ฉด์ ๊ฒฐ๊ตญ ์ด ํด๋์ค๋ ์ ์ ๋น๋ํด์งํ
๋ฐ์
์ข์ ๊ฐ์ ๋ฐฉ๋ฒ์ด ์์๊น์~? |
@@ -0,0 +1,48 @@
+import java.util.Arrays;
+
+public enum Rank {
+ FIRST(6, 2000000000),
+ SECOND(5, 30000000),
+ THIRD(5, 1500000),
+ FOURTH(4, 50000),
+ FIFTH(3, 5000),
+ MISS(0, 0);
+
+ private int countOfMatch;
+ private Money winningMoney;
+
+ Rank(int countOfMatch, int winningMoney) {
+... | Java | ์ค๊ดํธ๊ฐ ๋น ์ก์ต๋๋ค |
@@ -0,0 +1,21 @@
+public class RankResult {
+ private Rank rank;
+ private int countOfRank;
+
+ RankResult(Rank rank) {
+ this.rank = rank;
+ this.countOfRank = 0;
+ }
+
+ public Rank getRank() {
+ return rank;
+ }
+
+ public int getCountOfRank() {
+ return countOfRank;
... | Java | ๋ฐ์ดํฐ๋ค์ ํด๋์ค๋ก ๋ฌถ๋ ๊ฒ์ด ๊ฐ์ฒด์งํฅ์ ์๋๋๋ค~
RankResult ๋ ๊ฒฐ๊ตญ ๋ฐ์ดํฐ์ get ๋ง ๊ฐ์ง๊ณ ์๊ณ ,
์ ์๋ฏธํ ํ์๊ฐ ์์ต๋๋ค ใ
ใ
๋ถํ์ํ ๊ฐ์ฒด๊ฐ ์๋์ง, ์ ์๋ฏธํ ํ์๋ฅผ ๊ฐ์ง ๊ฐ์ฒด๋ก ๋ง๋ค๋ ค๋ฉด ์ด๋ค ํ์๋ฅผ ๋ถ์ฌํด์ผํ๋์ง
๊ณ ๋ฏผํด๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์~ |
@@ -0,0 +1,50 @@
+import java.util.List;
+
+public class LottoSeller {
+ private LottoPurchaseService lottoPurchaseService;
+ private Money change;
+
+ public LottoSeller() {
+ change = Money.ZERO;
+ lottoPurchaseService = new LottoPurchaseService();
+ }
+
+ public LottoTicket sellTicketTo(... | Java | Service ๋ผ๋ ๋ค์ด๋ฐ์ ์ฐ์๋๊ฑธ๋ก ๋ด์
์น ์ชฝ ์๋ฃ๋ฅผ ๋ณด์ ๊ฒ ๊ฐ์๋ฐ,
controller, service, repository
์ด๋ฐ layered architecture ๋ ์ง๊ธ ์ ํฌ๊ฐ ํ๊ณ ์๋ ๊ฐ์ฒด์งํฅ๊ณผ ๊ฑฐ๋ฆฌ๊ฐ ์ข ์์ต๋๋ค ~
service ๋ผ๋ ๋ค์ด๋ฐ์ ์ฌ์ฉํ๊ธฐ๋ณด๋ค๋ ์ข ๋ ๊ตฌ์ฒด์ ์ด๊ณ ๋๊ตฌ๋ ๊ธ ์ฝ๋ฏ์ด ๋ณผ ์ ์๋ ๋ค์ด๋ฐ์ ํ์๋ฉด
ํด๋น ๊ฐ์ฒด์ ๋ถ์ฌํ๋ ์ฑ
์๊ณผ ํ์๋ค๋ ๋ฌ๋ผ์ง๊ฒ ๋ฉ๋๋ค ~
๋ค์ด๋ฐ์ ๋จ์ํ ์๊ฐ์ ์ธ ํจ๊ณผ ๊ทธ ์ด์์ ๊ฐ์น๋ฅผ ๊ฐ์ง๊ณ ์์ต๋๋ค |
@@ -0,0 +1,50 @@
+import java.util.List;
+
+public class LottoSeller {
+ private LottoPurchaseService lottoPurchaseService;
+ private Money change;
+
+ public LottoSeller() {
+ change = Money.ZERO;
+ lottoPurchaseService = new LottoPurchaseService();
+ }
+
+ public LottoTicket sellTicketTo(... | Java | ์ ํ๋ ์ฐ์ ๋๋ ์ค๋ฐ๊ฟ์ ์ํ์๋๊ฒ ์ผ๋ฐ์ ์
๋๋ค.
๋ฉ์๋ ํ๋ผ๋ฏธํฐ๋ 3๊ฐ ์ด์๋ถํฐ ์ํฐ๋ฅผ ์น์๋๊ฒ ์ด๋จ๊น์? |
@@ -0,0 +1,42 @@
+import java.util.List;
+
+public class LottoService {
+ LottoUser lottoUser;
+ LottoSeller lottoSeller;
+ LottoTicket purchasedLottoTicket = null;
+ WinningLotto winningLotto = null;
+ PurchaseResultView purchaseResultView = null;
+ WinningResultView winningResultView = null;
+
+ ... | Java | set์ ์ฌ์ฉํ์ง ์๋๋ค๋ ๊ฐ์ฒด์งํฅ ์ํ์ฒด์กฐ ๊ท์น์ ์ ์ฉํด๋ณด์๋ฉด
์ฝ๋์ ์ค๊ณ๊ฐ ๋ฌ๋ผ์ง ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,43 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class LottoTicket {
+ private Money ticketPrice;
+ private Lottos autoLottos;
+ private Lottos manualLottos;
+
+ public LottoTicket(Money ticketPrice, Lottos autoLottos, Lottos manualLottos) {
+ this.ticketPrice = ticketP... | Java | ์ฌ๊ธฐ๋ ํ์๊ฐ ์๊ณ ๋ฐ์ดํฐ + getter ๋ฟ์ด๋ค์.
๊ทธ๋ฐ๋ฐ ์ด๋ ๊ฒ ํด๋์ค๋ฅผ ๋๋ ๋ณด๋ ค๊ณ ์ต๋ํ ์๋ํ์ ์ ๐ |
@@ -0,0 +1,35 @@
+import java.util.List;
+
+public class LottoUser {
+ private Money investMoney;
+ private int countOfManualLotto;
+ private List<List<LottoNo>> numbersOfManualLottos;
+
+ private LottoTicket lottoTicket;
+
+ public LottoUser(Money investMoney, int countOfManualLotto, List<List<LottoNo>>... | Java | ์ฌ๊ธฐ๋ setter getter ๋ฟ ์ด๋ค์ ใ
|
@@ -0,0 +1,65 @@
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public final class LottoPurchaseService {
+ public final static Money LOTTO_PRICE = Money.valueOf(1000);
+
+ public static Money validatePurchase(Money inputMoney, int countOfManualLotto) throws OutOfConditionE... | Java | ๋ฐ์ดํฐ์ ํ๋ก์ธ์ค๊ฐ ๋ฐ๋ก ์๋ ๊ฒ == ์ ์ฐจ์งํฅ ํ๋ก๊ทธ๋๋ฐ
ํ ์ํฉ :
๋ฐ์ดํฐ = LottoSeller, Ticket, User ๋ฑ (๋ฐ์ดํฐ + getter)
ํ๋ก์ธ์ค = Service (๋ฐ์ดํฐ get ํด์ ๋ก์ง ์ฒ๋ฆฌ)
๋ต : MVC์ layered architecture๋ฅผ ์๊ณ view ์ ๋น์ฆ๋์ค ๋ก์ง์ ๋ถ๋ฆฌํ๋ ๊ฒ๋ง ๊ธฐ์ตํ๊ณ ์ง๋ณด๊ธฐ |
@@ -0,0 +1,65 @@
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Scanner;
+import java.util.stream.Collectors;
+
+public final class InputView {
+
+ public static Money scanMoney(Scanner scanner) {
+ System.out.println("\n๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.");
+
+ return Mon... | Java | view ์์๋ ๋ฐ์ดํฐ๋ฅผ scan ํด์ค๋ ์ฑ
์๋ง ์์ต๋๋ค.
์ง๊ธ์ ๋ณํ ๋ก์ง๊น์ง ์ฌ๊ธฐ์ ์ฒ๋ฆฌํ๊ณ ์๋ค์~! |
@@ -0,0 +1,29 @@
+public final class PurchaseResultView {
+ public void notifyIfChangeLeft(LottoSeller seller) {
+ if (!seller.getChange().equals(Money.ZERO)) {
+ System.out.println("์๋ " + seller.getChange() + "์์ด ๋จ์์ต๋๋ค.");
+ System.out.println();
+ }
+ }
+
+ public void pr... | Java | finall class ๋ก ํ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค~ |
@@ -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์๊ฒ ๋งก๊ธฐ๋ ๊ฒ์ด ์ข์๋ณด์ด๋ค์ !! ๐ |
@@ -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,91 @@
+package christmas.Controller;
+
+import christmas.Domain.EventBenefitSettler;
+import christmas.Domain.EventPlanner;
+import christmas.Event.EventBadge;
+import christmas.View.InputView;
+import christmas.View.OutputView;
+import java.util.Map;
+
+public class EventController {
+ public EventPlanne... | Java | ```suggestion
public void takeVisitDate() {
try {
String visitDate = InputView.readVisitDate();
eventBenefitSettler = new EventBenefitSettler(visitDate);
} catch (IllegalArgumentException e) {
OutputView.printException(e);
takeVisitDate();
... |
@@ -0,0 +1,92 @@
+package christmas.Util;
+
+import static christmas.Event.EventOption.EVENT_END_DATE;
+import static christmas.Event.EventOption.EVENT_START_DATE;
+import static christmas.Event.EventOption.MAX_ORDER_QUANTITY;
+import static christmas.Message.OutputMessage.NOT_A_VALID_DATE;
+
+import christmas.Domain.M... | Java | ์ ๊ทํํ์์ ์ ๋ง ์ ํ์ฉํ์๋๊ตฐ์!๐๐
๊ทธ๋ฐ๋ฐ `(?:,|$)` ๋ ์ด๋ค ์ญํ ์ ํ๋์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -0,0 +1,92 @@
+package christmas.Util;
+
+import static christmas.Event.EventOption.EVENT_END_DATE;
+import static christmas.Event.EventOption.EVENT_START_DATE;
+import static christmas.Event.EventOption.MAX_ORDER_QUANTITY;
+import static christmas.Message.OutputMessage.NOT_A_VALID_DATE;
+
+import christmas.Domain.M... | Java | `isDrinkMenu` ๋ `MenuBoard` ์๊ฒ ๋๊ฒจ์ฃผ๋ฉด ์ด๋จ๊น์??
์๋ฃ๋ฅผ ํ์ธํ๋ ์ฑ
์์ `MenuBoard` ๊ฐ ๊ฐ์ง๊ณ ์๋๊ฒ ๋ ์ด์ธ๋ฆด ๊ฒ ๊ฐ์์! ๐ |
@@ -0,0 +1,92 @@
+package christmas.Util;
+
+import static christmas.Event.EventOption.EVENT_END_DATE;
+import static christmas.Event.EventOption.EVENT_START_DATE;
+import static christmas.Event.EventOption.MAX_ORDER_QUANTITY;
+import static christmas.Message.OutputMessage.NOT_A_VALID_DATE;
+
+import christmas.Domain.M... | Java | ํด๋น ์ ๊ทํํ์์ด ๋ฐ๋ณต๋๋ ๊ฒ ๊ฐ์์! ๊ทธ๋ ๋ค๋ฉด Pattern ๊ฐ์ฒด๋ฅผ ์บ์ฑํด์ฃผ๋ฉด ์ด๋จ๊น์??
๋์ค์ฝ๋ ํจ๊ป ๋๋๊ธฐ์ ํ์ง๋์ด[ ๊ณต์ ํ์ ๊ธ](https://velog.io/@dlguswl936/%EA%B3%B5%EB%B6%80%ED%95%9C-%EA%B2%83-String.matches%EB%8A%94-%EC%99%9C-%EC%84%B1%EB%8A%A5%EC%97%90-%EC%95%88-%EC%A2%8B%EC%9D%84%EA%B9%8C#%EA%B2%B0%EB%A1%A0-pattern-%EA%B0%9D%EC%B2%B4%EB%A5%BC-%EC%BA%90%EC%8B%B1... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.