code
stringlengths
41
34.3k
lang
stringclasses
8 values
review
stringlengths
1
4.74k
@@ -0,0 +1,170 @@ +import styled from "@emotion/styled"; +import IconStarFilled from "components/rating/icons/IconStarFilled"; +import IconStarHalf from "components/rating/icons/IconStarHalf"; +import IconStarOutlined from "components/rating/icons/IconStarOutlined"; +import { HTMLAttributes, useEffect, useState, useRef...
Unknown
๋„ต ๋งž์Šต๋‹ˆ๋‹ค..!
@@ -0,0 +1,85 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Button from "components/button/Button"; + +interface Props { + imgSrcList: string[]; +} + +const RestaurantDetailImgSection: React.FC<Props> = ({ imgSrcList }) => { + const [currentImgIn...
Unknown
์•— ์ด๋ฏธ์ง€ ์Šฌ๋ผ์ด๋”๋ฅผ ๊ตฌํ˜„ํ•˜๋ ค๋‹ค๊ฐ€ ์ผ๋‹จ PR๋ถ€ํ„ฐ ์˜ฌ๋ ธ๋Š”๋ฐ, ํ•ด๋‹น ๋ฒ„ํŠผ์€ ๊ทธ ๊ณผ์ •์—์„œ ์ƒ๊ธด ๋ณ„ ์˜๋ฏธ ์—†๋Š” ๋ฒ„ํŠผ์ž…๋‹ˆ๋‹ค.. ์‚ญ์ œํ•˜๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,70 @@ +import styled from "@emotion/styled"; +import RestaurantDetailImgSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailImgSection"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +imp...
Unknown
ํ™•์ธ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,137 @@ +import styled from "@emotion/styled"; +import Rating from "components/rating/Rating"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +import Button from "components/button/Button"; +import TextInput from "components...
Unknown
๋ฐœ๊ฒฌ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค! ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,137 @@ +import styled from "@emotion/styled"; +import Rating from "components/rating/Rating"; +import RestaurantDetailHeaderSection from "feature/restaurants/restaurantsDetail/components/section/RestaurantDetailHeaderSection"; +import Button from "components/button/Button"; +import TextInput from "components...
Unknown
๋„ต ์ข‹์Šต๋‹ˆ๋‹ค! ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,85 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Button from "components/button/Button"; + +interface Props { + imgSrcList: string[]; +} + +const RestaurantDetailImgSection: React.FC<Props> = ({ imgSrcList }) => { + const [currentImgIn...
Unknown
์ด๋ฏธ์ง€ ์Šฌ๋ผ์ด๋”๋Š” ์•„์ง ๊ตฌํ˜„ํ•˜์ง€ ์•Š์•˜์ง€๋งŒ, ์ผ๋‹จ ์ด๋ฏธ์ง€ ์ „ํ™˜์ด ๊ฐ€๋Šฅํ•˜๋„๋ก ๋ฒ„ํŠผ์€ ๋งŒ๋“ค์–ด๋‘์—ˆ์Šต๋‹ˆ๋‹ค! ์ง€๊ธˆ์€ ๋ฒ„ํŠผ ๋ณด์ผ ๊ฒ๋‹ˆ๋‹ค.
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
์˜ค.. ๋„ต ๋‹ค๋ฅธ ํŽ˜์ด์ง€๋„ ๋ฉ”์ธ์ด ๋˜๋Š” ํ…์ŠคํŠธ(๋ง›์ง‘ ์ด๋ฆ„, ๋‹จ์ฒด ์ด๋ฆ„)์€ `<h1 />`์„ ์‚ฌ์šฉํ•˜๋„๋ก ์ˆ˜์ •ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค. ์ผ๋‹จ ๋ง›์ง‘ ์ƒ์„ธ ํŽ˜์ด์ง€์—์„œ๋Š” ๋ง›์ง‘ ์ด๋ฆ„์„ `<h1 />` ํƒœ๊ทธ๋กœ ์ˆ˜์ • ์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
className์„ ๋ชจ๋‘ kebab case๋กœ ์ˆ˜์ •์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,120 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Rating from "components/rating/Rating"; +import IconEditFilledWhite from "components/icons/IconEditFilledWhite"; +import Link from "next/link"; +import dayjs from "dayjs"; + +interface Pr...
Unknown
className์„ ๋ชจ๋‘ kebab case๋กœ ์ˆ˜์ •์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,120 @@ +import styled from "@emotion/styled"; +import Image from "next/image"; +import { useState } from "react"; +import Rating from "components/rating/Rating"; +import IconEditFilledWhite from "components/icons/IconEditFilledWhite"; +import Link from "next/link"; +import dayjs from "dayjs"; + +interface Pr...
Unknown
์˜ค ๋„ต ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ํ•ด๋‹น ๋ฐฉ์‹์œผ๋กœ ์ˆ˜์ • ์™„๋ฃŒํ•˜์˜€์Šต๋‹ˆ๋‹ค!
@@ -2,7 +2,7 @@ import React, { useState, useEffect } from "react"; import styled from "@emotion/styled"; import { css, Theme } from "@emotion/react"; import CheckIcon from "components/inputs/TextInput/CheckIcon"; -import { TConditionCheck } from "./types/TConditionCheck"; +import { TConditionCheck } from "component...
Unknown
๋„ต ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,105 @@ +import styled from "@emotion/styled"; +import RestaurantExternalLinkIcon from "feature/restaurants/restaurantsDetail/components/icons/RestaurantExternalLinkIcon"; +import Link from "next/link"; + +interface Props { + restaurantId: string; + userAuth?: number; + restaurantName: string; + restauran...
Unknown
restaurantId๋ฅผ ๋ฐ›์•„์˜ฌ ๋•Œ `const restaurantId = query.restaurantId ?? 0;` ์ด๋ ‡๊ฒŒ๋งŒ ํ–ˆ๋”๋‹ˆ props๋กœ ๋„˜๊ฒจ์ค„ ๋•Œ ํƒ€์ž… ์—๋Ÿฌ๊ฐ€ ๋– ์„œ ์ €๋ ‡๊ฒŒ ์„ค์ •ํ•œ๊ฑด๋ฐ, ํ˜„์žฌ๋Š” `const restaurantId = (query.restaurantId ?? 0) as string;` ์•„์˜ˆ ์ด๋Ÿฐ ์‹์œผ๋กœ ํƒ€์ž…์„ ๋ช…์‹œํ•ด์ฃผ์–ด์„œ props๋กœ ๋ฐ›์•„์˜ฌ ๋•Œ์—๋„ string์œผ๋กœ๋งŒ ๋ฐ›์•„์˜ค๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,18 @@ +import styled from "@emotion/styled"; +import RestaurantsReviewForm from "feature/restaurants/restaurantsReview/components/form/RestaurantsReviewForm"; + +interface Props { + restaurantId: string; +} + +const ViewRestaurantReviewCreate: React.FC<Props> = ({ restaurantId }) => { + return ( + <Emot...
Unknown
[์—ฌ๊ธฐ](https://github.com/SystemConsultantGroup/foodhub-frontend/pull/27#discussion_r1373127345)์—์„œ ์ด์œ ๋ฅผ ์„ค๋ช…ํ•˜์˜€๊ณ , ํ•ด๋‹น ๋ถ€๋ถ„ string์œผ๋กœ๋งŒ ๋ฐ›์•„์˜ค๋„๋ก ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,170 @@ +import styled from "@emotion/styled"; +import IconStarFilled from "components/rating/icons/IconStarFilled"; +import IconStarHalf from "components/rating/icons/IconStarHalf"; +import IconStarOutlined from "components/rating/icons/IconStarOutlined"; +import { HTMLAttributes, useEffect, useState, useRef...
Unknown
๋ณ„์ ์„ dragํ•˜์—ฌ ์ž…๋ ฅํ•  ์ˆ˜ ์žˆ๋„๋ก ์ถ”๊ฐ€์ ์œผ๋กœ ๊ตฌํ˜„ํ•˜์˜€๋Š”๋ฐ, ๋ฐ์Šคํฌํ†ฑ์—์„œ๋Š” ์ž˜ ๋˜๋Š”๋ฐ ๋ชจ๋ฐ”์ผ์—์„œ๋Š” touchMove ์ด๋ฒคํŠธ๊ฐ€ ์ค‘๊ฐ„์— ๋Š๊ธฐ๋Š” ํ˜„์ƒ์ด ๋ฐœ์ƒํ•˜์˜€์Šต๋‹ˆ๋‹ค. ์ •ํ™•ํžˆ๋Š” touchMove ๋„์ค‘์— state๋ฅผ ์„ธํŒ…ํ•˜๋ฉด, ํ„ฐ์น˜๋Š” ์ด์–ด์ง€๊ณ  ์žˆ๋Š” ์ƒํ™ฉ์ธ๋ฐ๋„ touchMove๊ฐ€ ์ธ์‹๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. selectedValue๊ฐ€ ๋ฐ”๋€Œ๋ฉด์„œ star๋“ค์ด ๋‹ค์‹œ ๋ Œ๋”๋ง๋˜๋Š” ๊ฒƒ ๋•Œ๋ฌธ์ธ ๊ฒƒ ๊ฐ™์ง€๋งŒ ์ •ํ™•ํžˆ ๋ญ ๋•Œ๋ฌธ์ธ์ง€๋Š” ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ํ˜„์žฌ ํ•ด๊ฒฐ ๋ฐฉ์•ˆ์„ ์ฐพ๋Š” ์ค‘์ด๊ธด ํ•œ๋ฐ, ํ•˜๋‹ค๊ฐ€ ์•ˆ๋˜๋ฉด ์ด์Šˆ๋กœ ์˜ฌ๋ฆฌ๋„๋ก ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.. @jaychang99 @hoon5083
@@ -0,0 +1,34 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.Secured; +import org.aopalliance.intercept.MethodInvocation; + +import java.lang.reflect.Me...
Java
์กฐ๊ธˆ ํ—ท๊ฐˆ๋ฆฌ์‹ค ์ˆ˜ ์žˆ์„ ๋ฒ•ํ•œ ๋ถ€๋ถ„์ด๋ผ๊ณ  ์ƒ๊ฐํ•ด์š”. ๋‘๊ฐ€์ง€๋ฅผ ๋ถ„๋ฆฌํ•ด๋†“๊ณ  ์ƒ๊ฐํ•ด๋ณด๋ฉด, `SecuredAuthorizationManager`๋Š” `@Secured` ์–ด๋…ธํ…Œ์ด์…˜์„ ๋ณด๊ณ  ์ธ๊ฐ€ ๊ณผ์ •์„ ์ฒดํฌํ•˜๋Š” ๊ฒƒ์ด๊ณ , `AuthorityAuthorizationManager `๋Š” ๋ช…ํ™•ํ•˜๊ฒŒ ์ธ๊ฐ€ ์ฒ˜๋ฆฌ๋ฅผ ์ง์ ‘ ์ฒ˜๋ฆฌํ•˜๋Š” ๊ฐ์ฒด์—์š”. ๊ทธ๋ž˜์„œ ์‚ฌ์‹ค ์–ด๋–ป๊ฒŒ๋ณด๋ฉด `SecuredAuthorizationManager`์™€ `AuthorityAuthorizationManager`๋Š” ๋ถ„๋ฆฌ๋˜์–ด์žˆ๋‹ค๊ธฐ๋ณด๋‹ค๋Š” ์‹ค์ œ๋กœ๋Š” `SecuredAuthorizationManager`๊ฐ€ `AuthorityAutho...
@@ -1 +1,39 @@ # spring-security-authorization + +## ์‹ค์Šต + +1. [x] GET /members/me ์—”๋“œํฌ์ธํŠธ ๊ตฌํ˜„ ๋ฐ ํ…Œ์ŠคํŠธ ์ž‘์„ฑ +2. [x] ๊ถŒํ•œ ๊ฒ€์ฆ ๋กœ์ง์„ AuthorizationFilter๋กœ ๋ฆฌํŒฉํ„ฐ๋ง + +## ๐Ÿš€ 1๋‹จ๊ณ„ - AuthorizationManager๋ฅผ ํ™œ์šฉ + +์š”๊ตฌ์‚ฌํ•ญ + +- [x] AuthorizationManager ๋ฅผ ํ™œ์šฉํ•˜์—ฌ ์ธ๊ฐ€ ๊ณผ์ • ์ถ”์ƒํ™” +- [x] ์ธ๊ฐ€๋ฅผ ์ฒ˜๋ฆฌํ•ด์ค„ AuthorizationManager ์ƒ์„ฑ +- [x] RequestMatcherDelegatingAuthoriza...
Unknown
ํ•„์š” ์š”๊ตฌ์‚ฌํ•ญ ์ž˜ ์ •๋ฆฌํ•ด์ฃผ์…จ๋„ค์š” ๐Ÿ‘
@@ -1,24 +1,30 @@ package nextstep.app; +import jakarta.servlet.http.HttpServletRequest; import nextstep.app.domain.Member; import nextstep.app.domain.MemberRepository; import nextstep.security.authentication.AuthenticationException; import nextstep.security.authentication.BasicAuthenticationFilter; import next...
Java
์ ์ ˆํ•˜๊ฒŒ ์ž˜ ์ถ”๊ฐ€ํ•ด์ฃผ์…จ๋„ค์š” :)
@@ -0,0 +1,25 @@ +package nextstep.security.authorization; + +public class AuthorizationDecision { + + private static final AuthorizationDecision GRANTED = new AuthorizationDecision(true); + private static final AuthorizationDecision DENIED = new AuthorizationDecision(false); + + private final boolean isGrante...
Java
๋ฉ”์†Œ๋“œ๋กœ ์ •์˜ํ•  ์ˆ˜๋„ ์žˆ์ง€๋งŒ ๊ฒฐ๊ตญ ๋™์ผํ•œ ๊ฐ์ฒด๋ฅผ ์—ฌ๋Ÿฌ๋ฒˆ ์ƒ์„ฑํ•˜๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— ๋ถˆ๋ณ€ํ•œ ๊ฐ์ฒด๋ฅผ ๋งŒ๋“ค ์ˆ˜ ์žˆ๋Š” ํ˜„์žฌ ์ƒํ™ฉ์ด๋ผ๋ฉด ๋‹จ์ˆœํžˆ ์ƒ์ˆ˜๋กœ ๋งŒ๋“ค๊ณ  ์žฌ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ๋„ ๋ฐฉ๋ฒ•์ด ๋˜๊ฒ ๋„ค์š” :)
@@ -1,38 +1,28 @@ package nextstep.security.authorization; -import nextstep.security.authentication.Authentication; -import nextstep.security.context.SecurityContextHolder; -import org.springframework.web.filter.OncePerRequestFilter; - import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; i...
Java
์ธ๊ฐ€๊ถŒํ•œ์ด ๊ฑฐ์ ˆ๋˜์—ˆ๋Š”๋ฐ `AuthenticationException`์ธ ์ธ์ฆ ์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ•˜๋Š” ๊ฒƒ์ด ๋งž์„๊นŒ์š”?
@@ -0,0 +1,31 @@ +package nextstep.security.matcher; + +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.http.HttpMethod; + +public class MvcRequestMatcher implements RequestMatcher { + + private final HttpMethod httpMethod; + private final String[] requestURIs; + + public MvcRequest...
Java
์‹ค์ œ spring security์—์„œ๋Š” ์„ฑ๋Šฅ์˜ ๋ฌธ์ œ๋กœ ์ธํ•ด stream ์‚ฌ์šฉ์„ ์ œํ•œํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. https://github.com/spring-projects/spring-security/issues/7154
@@ -0,0 +1,34 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.Secured; +import org.aopalliance.intercept.MethodInvocation; + +import java.lang.reflect.Me...
Java
์งˆ๋ฌธ์ฃผ์‹  ๋‚ด์šฉ์— ๋‹ต๋ณ€ ๋‹ฌ์•„๋‘์—ˆ๋˜ ๊ฒƒ์ฒ˜๋Ÿผ `AuthoritiesAuthorizationManager`๋กœ ๊ตฌํ˜„ํ•˜๋Š” ๊ฒƒ๊นŒ์ง€๋Š” ์•„๋‹ˆ์–ด๋„ ์ธ๊ฐ€๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ `AuthorityAuthorizationManager`๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์œผ๋กœ ๋ณ€๊ฒฝํ•ด๋ณด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”.
@@ -0,0 +1,65 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.ForbiddenException; + +import java.util.Collection; +import java.util.Set; + +public class ...
Java
```suggestion public class AuthorityAuthorizationManager implements AuthorizationManager<T> { ``` ์œ„์—์„œ ๋‚˜์—ดํ•œ ์ด์œ ์—์„œ ์‚ฌ์‹ค `HttpServletRequest`๋ณด๋‹ค๋Š” ์ œ๋„ค๋ฆญ ํƒ€์ž…์„ ํ™œ์šฉํ•˜์—ฌ ๋‹ค๋ฅธ ๊ณณ์—์„œ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๊ฒŒ๋” ํ•˜๋Š” ๊ฒƒ์ด ์ข‹๊ฒ ์ฃ .
@@ -0,0 +1,18 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AccessDeniedException; +import nextstep.security.authorization.AuthorizationDecision; + +@FunctionalInterface +public interface AuthorizationManager<T> { ...
Java
์„ ํƒ์‚ฌํ•ญ์— ๋‚˜์™€์žˆ๋Š” verify๋Š” ๊ตฌํ˜„ํ•˜์ง€ ์•Š์œผ์…”๋„ ๋˜๊ธด ํ•˜์ง€๋งŒ, check์™€ verify๋Š” ๊ฐ๊ฐ ์–ด๋–ค ์ƒํ™ฉ์—์„œ ์‚ฌ์šฉํ•  ํ•ด์•ผ ์ข‹์€์ง€ ์„ธ์ค€๋‹˜์˜ ์˜๊ฒฌ์€ ์–ด๋– ์‹ ๊ฐ€์š”?
@@ -0,0 +1,18 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AccessDeniedException; +import nextstep.security.authorization.AuthorizationDecision; + +@FunctionalInterface +public interface AuthorizationManager<T> { ...
Java
์ตœ๊ทผ spring security ๋ฒ„์ „์—์„œ๋Š” `check`๋Š” deprecated๋˜์—ˆ์Šต๋‹ˆ๋‹ค. `AuthorizationDecision`์ด ์ง€๊ธˆ ๋งŒ๋“ค์–ด์ฃผ์‹  ๊ฒƒ๊ณผ ๊ฐ™์ด ๊ตฌํ˜„์ฒด๋กœ ๋˜์–ด์žˆ๊ณ , ์ผ๋ฐ˜์ ์œผ๋กœ ์˜คํ”ˆ์†Œ์Šค๋“ค์ด ์ปค์งˆ์ˆ˜๋ก ๋‹จ์ˆœํ•˜๊ฒŒ ๊ตฌํ˜„ํ•ด๋‘์—ˆ๋˜ ๊ตฌํ˜„์ฒด๋“ค์„ ์ถ”์ƒํ™”ํ•˜๋Š” ํ˜•ํƒœ๋กœ ๊ฐœ์„ ํ•ด๋‚˜๊ฐ€๋Š”๋ฐ์š”. ๊ทธ๋ž˜์„œ ์ตœ๊ทผ ๋ฒ„์ „์—์„œ๋Š” ๊ตฌํ˜„์ฒด๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” `check`๋ฅผ ๊ทธ๋Œ€๋กœ ์‚ฌ์šฉํ•˜๊ธฐ๋ณด๋‹ค๋Š” deprecatedํ•ด๋‘” ๋’ค ์ด๋ฅผ ์ถ”์ƒํ™”ํ•œ `AuthorizationResult`๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ๋ฉ”์†Œ๋“œ๋ฅผ ์ถ”๊ฐ€ํ•˜์—ฌ ํ•ด๋‹น ๋ฉ”์†Œ๋“œ ์‚ฌ์šฉ์„ ๊ถŒ์žฅํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. https://github.com/frantictic...
@@ -0,0 +1,34 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.Secured; +import org.aopalliance.intercept.MethodInvocation; + +import java.lang.reflect.Me...
Java
SecuredAuthorizationManager ์—์„œ ์ •ํ™•ํ•œ ์ธ๊ฐ€ ์ฒ˜๋ฆฌ๋ฅผ AuthorityAuthorizationManager ๋ฅผ ์œ„์ž„ํ•˜๋„๋ก ํ•  ์ˆ˜ ์žˆ๊ฒ ๋„ค์š”. AuthorityAuthorizationManager์—์„œ๋„ ์ œ๋„ค๋ฆญ์„ ํ†ตํ•ด ์ „๋‹ฌ๋ฐ›์€ ํŒŒ๋ผ๋ฏธํ„ฐ์— ๋”ฐ๋ผ์„œ ๋‹ค๋ฅธ ์ฒ˜๋ฆฌ๋ฅผ ํ•  ์ˆ˜ ๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”. ์ œ๊ฐ€ ์ดํ•ดํ•œ ๋‚ด์šฉ์„ ์ •๋ฆฌํ•˜๋ฉด SecuredAuthorizationManager ๋Š” ์ธ๊ฐ€์— ํ•„์š”ํ•œ ๊ฐ’์„ ์–ด๋…ธํ…Œ์ด์…˜ ๊ธฐ๋ฐ˜์œผ๋กœ ๋™์ ์œผ๋กœ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ SecuredAuthorizationManager ๋Š” ์ •ํ™•ํžˆ ์–ด๋–ค ์ธ๊ฐ€ ์ž‘์—…์„ ํ• ์ง€๋Š” ๊ด€์‹ฌ์ด ์—†์Šต๋‹ˆ๋‹ค. ๊ทธ๋ž˜...
@@ -0,0 +1,25 @@ +package nextstep.security.authorization; + +public class AuthorizationDecision { + + private static final AuthorizationDecision GRANTED = new AuthorizationDecision(true); + private static final AuthorizationDecision DENIED = new AuthorizationDecision(false); + + private final boolean isGrante...
Java
AuthorizationDecision ์—์„œ ์„ฑ๊ณต ์‹คํŒจ๋งŒ ๊ฐ€์ง€๊ณ  ์žˆ๊ธฐ ๋•Œ๋ฌธ์— ์ข‹์€ ๋ฐฉ๋ฒ•์ด๋„ค์š”.
@@ -1,38 +1,28 @@ package nextstep.security.authorization; -import nextstep.security.authentication.Authentication; -import nextstep.security.context.SecurityContextHolder; -import org.springframework.web.filter.OncePerRequestFilter; - import jakarta.servlet.FilterChain; import jakarta.servlet.ServletException; i...
Java
Forbidden ์œผ๋กœ ์ฒ˜๋ฆฌํ•˜๋„๋ก ๋ณ€๊ฒฝํ•ด์•ผ๊ฒ ๋„ค์š”. ์ด ๋ถ€๋ถ„์—์„œ๋„ ์ด์ชฝ์—์„œ๋„ ์™œ check๋ณด๋‹ค verify๋ฅผ ๊ถŒ์žฅํ•˜๋Š” ์ง€ ๋ณด์—ฌ์ฃผ๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”. AuthorizationDecision ์ธ๊ฐ€ ๊ฒฐ๊ณผ์— ๋Œ€ํ•œ ์ฒ˜๋ฆฌ์— ์ผ๊ด€์„ฑ์„ ๋ณด์žฅํ•ด์ฃผ๋Š” ๊ฒƒ์ด ํ•„์š”ํ•ด ๋ณด์ด๋„ค์š”!
@@ -0,0 +1,31 @@ +package nextstep.security.matcher; + +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.http.HttpMethod; + +public class MvcRequestMatcher implements RequestMatcher { + + private final HttpMethod httpMethod; + private final String[] requestURIs; + + public MvcRequest...
Java
์„ฑ๋Šฅ ๋ฌธ์ œ์™€ ๊ฐ€๋…์„ฑ์€ ์–ธ์ œ๋‚˜ ๊ณ ๋ฏผ์ด ๋˜๋Š” ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค. ์š”์ฆ˜์€ ๊ฐœ๋ฐœํ•˜๋ฉด Stream ์„ ๊ฐ€๋…์„ฑ์ด ์กฐ๊ธˆ ๋” ์ข‹๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ์„ ํƒํ•˜๋Š” ๊ฒƒ ๊ฐ™๋„ค์š”. ๋ง์”€ํ•ด์ฃผ์‹  ๋Œ€๋กœ ForEach ๋กœ ์ˆ˜์ •ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,34 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.Secured; +import org.aopalliance.intercept.MethodInvocation; + +import java.lang.reflect.Me...
Java
์ธ๊ฐ€ ๋ถ€๋ถ„์„ ์œ„์ž„ํ•˜๋„๋ก ๋ณ€๊ฒฝํ•ด๋ณด์•˜์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,65 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.ForbiddenException; + +import java.util.Collection; +import java.util.Set; + +public class ...
Java
ํ•„ํ„ฐ์™€ ์ธํ„ฐ์…‰ํ„ฐ ํ˜น์€ ์ธํ„ฐ์…‰ํ„ฐ์—์„œ๋„ ์—ฌ๋Ÿฌ ์ข…๋ฅ˜ ๊ฐ’์„ ์‚ฌ์šฉํ•˜๊ธฐ ์œ„ํ•ด์„œ ์ข‹์€ ์„ ํƒ ๊ฐ™์Šต๋‹ˆ๋‹ค, ๊ทธ๋ ‡๋‹ค๋ฉด AuthorityAuthorizationManager ๋Š” ์—ฌ๋Ÿฌ ์ข…๋ฅ˜์˜ ๊ตฌํ˜„์ฒด๋ฅผ ๋งŒ๋“ค์–ด์„œ ๊ด€๋ฆฌํ•  ์ˆ˜ ๋„ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด RequestMatcherDelegatingAuthorizationManager ์ฒ˜๋Ÿผ ์—ฌ๋Ÿฌ ๊ตฌํ˜„์ฒด์— support ๋ฉ”์„œ๋“œ๋‚˜ Matcher๋ฅผ ๋งŒ๋“ญ๋‹ˆ๋‹ค. ์ด๋ฅผ ํ†ตํ•ด ์ฒ˜๋ฆฌํ•  ์ˆ˜ ์žˆ๋Š” ์ธ๊ฐ€ ์ž‘์—…์ธ์ง€ ํ™•์ธํ•˜๊ณ  ๊ทธ์— ๋งž๋Š” AuthorityAuthorizationManager ๊ตฌํ˜„์ฒด๊ฐ€ ์ž‘๋™ํ•˜๋Š” ๋ฐฉ์‹์œผ๋กœ ์‰ฝ๊ฒŒ ๊ด€๋ฆฌ ๋  ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,18 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AccessDeniedException; +import nextstep.security.authorization.AuthorizationDecision; + +@FunctionalInterface +public interface AuthorizationManager<T> { ...
Java
์ œ๊ฐ€ ์ด ๋ฏธ์…˜์„ ์ง„ํ–‰ํ•˜๋ฉด์„œ ๋А๋‚Œ ์ ์€ ์„ธ ๊ฐ€์ง€์ž…๋‹ˆ๋‹ค. 1. AuthorizationDecision ์˜ ๋„์˜ ์œ„ํ—˜์„ฑ 2. AuthorizationDecision ๊ฐ€ ์‹คํŒจ๋ฌ์„ ๋•Œ์˜ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ์ผ๊ด€์„ฑ 3. ์‚ฌ์šฉ๋„ ์•ˆํ•˜๋Š” ๊ฒฐ๊ณผ๋ฅผ ๋ฆฌํ„ด ์ด๋Ÿฐ ์ƒํ™ฉ๋•Œ๋ฌธ์— verify๋ฅผ ๊ถŒ์žฅํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ AuthorizationDecision ์˜ ๊ฒฐ๊ณผ๋ฅผ ์ปค์Šคํ…€ ์˜ˆ์™ธ๋‚˜ ์กฐ๊ฑด๋ถ€ ๋กœ์ง์ด ํ•„์š”ํ•œ ๊ฒฝ์šฐ๋งŒ check์„ ์‚ฌ์šฉํ•ด ๊ฒฐ๊ณผ๋ฅผ ํ•ธ๋“ค๋ง ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,18 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AccessDeniedException; +import nextstep.security.authorization.AuthorizationDecision; + +@FunctionalInterface +public interface AuthorizationManager<T> { ...
Java
๋ฏธ์…˜์„ ํ•˜๋‹ค๋ณด๋‹ˆ ๋ง์”€ํ•ด์ฃผ์‹  ๋Œ€๋กœ AuthorizationDecision ๊ฐ€ deprecated๋œ ์ด์œ ๊ฐ€ ๊ฐ„์ ‘์ ์œผ๋กœ ๋А๊ปด์ง€๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. RequestMatcherDelegatingAuthorizationManager ์—์„œ๋„ checkInFilter ๋ณด๋‹ค๋Š” verifyInFilter๋ฅผ ์‚ฌ์šฉํ•œ๋‹ค๋ฉด AuthorizationFilter ์—์„œ์˜ ์ธ๊ฐ€ ์š”์ฒญ, ์˜ˆ์™ธ์ฒ˜๋ฆฌ ๋‘๊ฐ€์ง€ ์—ญํ• ์—์„œ ์ธ๊ฐ€ ์š”์ฒญ๋งŒ ๋‚จ๊ฒŒ๋˜์–ด์„œ ํ›จ์”ฌ ๊น”๋”ํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,34 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AuthorizationDecision; +import nextstep.security.authorization.Secured; +import org.aopalliance.intercept.MethodInvocation; + +import java.lang.reflect.Me...
Java
๋„ค ์ดํ•ดํ•ด์ฃผ์‹  ๋‚ด์šฉ์ด ๋งž์Šต๋‹ˆ๋‹ค :)
@@ -0,0 +1,18 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AccessDeniedException; +import nextstep.security.authorization.AuthorizationDecision; + +@FunctionalInterface +public interface AuthorizationManager<T> { ...
Java
์‚ฌ์‹ค spring security์—์„œ๋Š” `verify`๋ฅผ ๊ถŒ์žฅํ•˜๋Š” ๊ฒƒ์€ ์•„๋‹ˆ์—์š”. (์˜คํ•ด์˜ ์†Œ์ง€๊ฐ€ ์žˆ์„ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„ ๋ฏธ๋ฆฌ ๋ง์”€๋“œ๋ฆฌ๋ฉด ์ •๋‹ต์„ ์š”๊ตฌํ•˜๊ธฐ ์œ„ํ•ด ๋‚จ๊ฒจ๋“œ๋ฆฐ ์งˆ๋ฌธ์€ ์•„๋‹™๋‹ˆ๋‹ค.) ๋ง์”€ํ•ด์ฃผ์‹  ์ด์œ  ์ค‘ ๋จผ์ € 1์— ๋Œ€ํ•ด์„œ ์ด์•ผ๊ธฐํ•˜๋ฉด null ์œ„ํ—˜์„ฑ์„ ๋ฐœ์ƒ์‹œํ‚ค๋Š” ๊ฒƒ์€ ๋งž์ง€๋งŒ `AuthorizationDecision`์˜ ๋ฐ˜ํ™˜์€ ์ธ๊ฐ€๋จ(true), ์ธ๊ฐ€์•ˆ๋จ(false)๋งŒ ์žˆ๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ ์ธ๊ฐ€ ์ƒํ™ฉ์ด ์—†์Œ์„ ๋‚˜ํƒ€๋‚ด๊ธฐ๋„ ํ•ฉ๋‹ˆ๋‹ค. ๊ฐ€๋ น `@Secured`๊ฐ€ ๊ฑธ๋ฆฐ ๊ณณ์ด ์—†์–ด ๊ฒ€์ฆํ•  `authorities`๊ฐ€ ์—†๋Š” ๊ฒฝ์šฐ๊ฐ€ ์žˆ๊ฒ ๋„ค์š”. ```java public Aut...
@@ -0,0 +1,31 @@ +package nextstep.security.matcher; + +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.http.HttpMethod; + +public class MvcRequestMatcher implements RequestMatcher { + + private final HttpMethod httpMethod; + private final String[] requestURIs; + + public MvcRequest...
Java
์‹ค์ œ๋กœ๋Š” `httpMethod`, `requestUri`๊ฐ๊ฐ ํ•˜๋‚˜๋งŒ์„ ๊ฐ€์ง€๋ฏ€๋กœ `String[]`์œผ๋กœ ํ‘œํ˜„๋˜์ง„ ์•Š์Šต๋‹ˆ๋‹ค. ๋”ฑ ํ•˜๋‚˜๋กœ ์ง€์ •๋œ method, uri๋งŒ์„ ๊ฒ€์ฆํ•˜๋ฉด ๋˜๋Š”๊ฑฐ์ฃ . ์—ฌ๋Ÿฌ๊ฐœ์˜ uri๊ฐ€ ํ•„์š”ํ•œ ๊ฒฝ์šฐ๋ผ๋ฉด ํ•„์š”ํ•œ ๊ฐ์ฒด๊ฐ€ `RequestMatcher`๋ฅผ ์—ฌ๋Ÿฌ๊ฐœ๋กœ ๋“ค๊ณ  ์žˆ๋Š” ํ˜•ํƒœ๊ฐ€ ๋” ์ž์—ฐ์Šค๋Ÿฝ์Šต๋‹ˆ๋‹ค :)
@@ -0,0 +1,25 @@ +package nextstep.security.authorization; + +public class AuthorizationDecision { + + private static final AuthorizationDecision GRANTED = new AuthorizationDecision(true); + private static final AuthorizationDecision DENIED = new AuthorizationDecision(false); + + private final boolean isGrante...
Java
๋ฏธ์…˜์—์„œ๋Š” spring security์˜ ๊ธฐ๋Šฅ์ด ์ถ•์†Œ๋˜์–ด true, false๊ฐ€ ์ž˜ ์•ˆ์™€๋‹ฟ์œผ์‹ค ์ˆ˜ ์žˆ์œผ๋‚˜ ์‹ค์ œ๋กœ๋Š” ๊ทธ๋ณด๋‹ค ๋” ๋‹ค์–‘ํ•œ ๊ตฌํ˜„์ฒด๋“ค์ด ์ƒ๊ธธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. https://github.com/spring-projects/spring-security/blob/main/core/src/main/java/org/springframework/security/authorization/AuthorityAuthorizationDecision.java
@@ -0,0 +1,18 @@ +package nextstep.security.authorization.manager; + +import nextstep.security.authentication.Authentication; +import nextstep.security.authorization.AccessDeniedException; +import nextstep.security.authorization.AuthorizationDecision; + +@FunctionalInterface +public interface AuthorizationManager<T> { ...
Java
์ž์„ธํ•œ ์„ค๋ช… ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค. ๋‹จ์ˆœ ์ธ๊ฐ€ ์„ฑ๊ณต, ์‹คํŒจ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์—ฌ๋Ÿฌ ์ผ€์ด์Šค์— ๋Œ€ํ•ด์„œ๋Š” ๊นŠ์ด ์ƒ๊ฐ ๋ชปํ–ˆ์—ˆ๋Š”๋ฐ, ๊ณ ๋ฏผํ•ด๋ณผ ํฌ์ธํŠธ๋„ค์š”! AuthorizationManager์—์„œ๋Š” ์ธ๊ฐ€ ํ™•์ธ, AuthorizationFilter ์ „์ฒด์ ์ธ ๋งฅ๋ฝ์„ ํŒŒ์•…ํ•˜์—ฌ ํ•„ํ„ฐ๋ง ํ•ด์ฃผ๋Š” ๊ฒƒ์ด๊ตฐ์š”!
@@ -0,0 +1,31 @@ +package nextstep.security.matcher; + +import jakarta.servlet.http.HttpServletRequest; +import org.springframework.http.HttpMethod; + +public class MvcRequestMatcher implements RequestMatcher { + + private final HttpMethod httpMethod; + private final String[] requestURIs; + + public MvcRequest...
Java
ํ•˜๋‚˜์˜ Matcher์— ํ•˜๋‚˜์˜ URI ๊ฒ€์ฆํ•˜๋Š” ๊ฒƒ์ด ๋” ์ดํ•ดํ•˜๊ธฐ ์ข‹๊ฒ ๋„ค์š”!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
๋ฆฌ์•กํŠธ ๊ด€๋ จ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ import๊ฐ€ ๋” ์šฐ์„ ์ˆœ์œ„์— ์œ„์น˜ํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
import './Login.scss'; ์œ„๋กœ ๊ฐ€์•ผ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!! ๐Ÿ˜Ž
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
์ˆ˜์ •์™„๋ฃŒ ๐Ÿ˜Š
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- variable.scss ๋Š” scss ํŒŒ์ผ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด๊ธฐ ๋•Œ๋ฌธ์— js ์—์„œ import ๋ฅผ ํ•˜๋Š” ๊ฒƒ์ด ์˜๋ฏธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. - scss ํŒŒ์ผ์—์„œ ๋ณ€์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ์— import ํ•ด์ฃผ์„ธ์š”!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- ๋‘ ํ•จ์ˆ˜๋Š” ํ•˜๋Š” ์—ญํ• ์ด ๋น„์Šทํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์ถฉ๋ถ„ํžˆ ํ•˜๋‚˜์˜ ํ•จ์ˆ˜๋กœ ํ•ฉ์ณ๋ณผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. - Refactoring CheckList ์ฐธ๊ณ ํ•ด์„œ ์ˆ˜์ •ํ•ด ๋ณด์„ธ์š”!
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- isActive ๋Š” id ์™€ pw ๋กœ ๊ณ„์‚ฐํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’์ด์ด๊ธฐ ๋•Œ๋ฌธ์— state ๋กœ ๊ด€๋ฆฌํ•  ํ•„์š”๊ฐ€ ์—†์–ด ๋ณด์ž…๋‹ˆ๋‹ค! - ์•„๋ž˜ ๊ณต์‹ ๋ฌธ์„œ ์ฐธ๊ณ ํ•˜์…”์„œ ์–ด๋–ค ๊ฐ’๋“ค์ด state ๋กœ ์ ์ ˆํ•˜์ง€ ์•Š์€์ง€ ํŒŒ์•…ํ•ด๋ณด์‹œ๊ธฐ ๋ฐ”๋ž๋‹ˆ๋‹ค! https://www.notion.so/wecode/Westagram-React-Refactoring-Checklist-aea297cf88ed4601b769e4b2c2cfd4e1#089493d6bfca438aa328226e327cff92
@@ -1,8 +1,100 @@ import React from 'react'; +import { withRouter } from 'react-router-dom'; +import './Login.scss'; + +class Login extends React.Component { + constructor() { + super(); + this.state = { + id: '', + pw: '', + }; + } + + handleInput = e => { + const { value, name } = e.target; ...
JavaScript
- isActive ๋ฅผ state ๋กœ ๊ด€๋ฆฌํ•  ํ•„์š” ์—†์ด, ์—ฌ๊ธฐ์„œ ๋ฐ”๋กœ true / false ๋ฅผ ๊ณ„์‚ฐํ•˜๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -1,3 +1,106 @@ -*{ - margin: 0; -} \ No newline at end of file +@import '../../../styles/variable.scss'; + +.Login { + @include flexCenter; + flex-direction: column; + align-items: center; + height: 100vh; + + .loginBox { + display: flex; + flex-direction: column; + justify-content: space-between; +...
Unknown
- css ์ž‘์—…์„ ํ•˜์‹ค๋•Œ ๋ฐ”๊นฅ ์š”์†Œ์— ํŠน์ •ํ•œ width / height ๊ฐ’์„ ๋ถ€์—ฌํ•˜์‹œ๋Š” ๊ฒƒ ๋ณด๋‹ค, ๋ฐ”๊นฅ ์š”์†Œ์˜ ํฌ๊ธฐ๋Š” ๋‚ด์šฉ๋ฌผ์˜ ํฌ๊ธฐ + margin / padding ๋“ค์˜ ํ•ฉ์œผ๋กœ ์ž์—ฐ์Šค๋Ÿฝ๊ฒŒ ํฌ๊ธฐ๊ฐ€ ๊ฒฐ์ •๋˜๋„๋ก ํ•˜์‹œ๋Š” ๊ฒŒ ๋” ์ข‹์Šต๋‹ˆ๋‹ค. - ํ•ญ์ƒ bottom up ๋ฐฉ์‹์œผ๋กœ ์Šคํƒ€์ผ๋ง ํ•˜๋Š” ์Šต๊ด€์„ ๋“ค์—ฌ์ฃผ์„ธ์š”!
@@ -0,0 +1,26 @@ +import React from 'react'; +import './Aside.scss'; + +import ProfileWrap from './ProfileWrap/ProfileWrap'; +import StoryBox from './StoryBox/StoryBox'; +import RecommendBox from './RecommendBox/RecommendBox'; +import WestaInfoBox from './WestaInfoBox/WestaInfoBox'; + +class Aside extends React.Compone...
JavaScript
- Import ์ˆœ์„œ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”! ์ผ๋ฐ˜์ ์ธ convention์„ ๋”ฐ๋ฅด๋Š” ์ด์œ ๋„ ์žˆ์ง€๋งŒ ์ˆœ์„œ๋งŒ ์ž˜ ์ง€์ผœ์ฃผ์…”๋„ ๊ฐ€๋…์„ฑ์ด ์ข‹์•„์ง‘๋‹ˆ๋‹ค. ์•„๋ž˜ ์ˆœ์„œ ์ฐธ๊ณ ํ•ด์ฃผ์„ธ์š”. - React โ†’ Library(Package) โ†’ Component โ†’ ๋ณ€์ˆ˜ / ์ด๋ฏธ์ง€ โ†’ css ํŒŒ์ผ(scss ํŒŒ์ผ) ```suggestion import React from 'react'; import ProfileWrap from './ProfileWrap/ProfileWrap'; import StoryBox from './StoryBox/StoryBox'; import RecommendBox f...
@@ -0,0 +1,56 @@ +import React from 'react'; +import './Content.scss'; + +import Feed from './Feed/Feed'; +import Aside from './Aside/Aside'; + +class Content extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() { + fetch('http://local...
JavaScript
- `http://localhost:3000` ์€ ์ƒ๋žต ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ํฌํŠธ ๋ฒˆํ˜ธ๊ฐ€ ๋‹ฌ๋ผ์ง€๋ฉด(ex. `localhost:3001`) fetch ํ•จ์ˆ˜๋ฅผ ์ผ์ผ์ด ์ˆ˜์ •ํ•ด์ฃผ์–ด์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ์— ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ์–ด๋ ค์›Œ์ง‘๋‹ˆ๋‹ค. ์•„๋ž˜ ์ฝ”๋“œ ์ฐธ๊ณ ํ•ด์„œ ์ˆ˜์ •ํ•ด์ฃผ์„ธ์š”! ```jsx const foo = () => { // fetch("http://localhost:3000/images/1") fetch("/images/1") } ``` - fetchํ•จ์ˆ˜์˜ `get method`๋Š” method์˜ default ๊ฐ’์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ ์ƒ๋žต์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ```jsx const foo =...
@@ -0,0 +1,56 @@ +import React from 'react'; +import './Content.scss'; + +import Feed from './Feed/Feed'; +import Aside from './Aside/Aside'; + +class Content extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() { + fetch('http://local...
JavaScript
- mock up ๋ฐ์ดํ„ฐ์˜ ํ‚ค ๊ฐ’์€ ์Šค๋„ค์ดํฌ ์ผ€์ด์Šค๋กœ ์‚ฌ์šฉํ•ด์ฃผ์…”๋„ ๋˜์ง€๋งŒ (๋ฐฑ์—”๋“œ์—์„œ๋Š” ๋ณดํ†ต ์Šค๋„ค์ดํฌ ์ผ€์ด์Šค๋ฅผ ์“ฐ๊ธฐ ๋•Œ๋ฌธ์—) props ์˜ ์ด๋ฆ„์€ ์นด๋ฉœ ์ผ€์ด์Šค๋กœ ํ†ต์ผํ•ด ์ฃผ์„ธ์š”!
@@ -0,0 +1,31 @@ +package com.antique.dto.review; + +import io.swagger.v3.oas.annotations.media.Schema; +import jakarta.validation.constraints.NotNull; +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; + +@Data +@AllArgsConstructor +@NoArgsConstructor +public class ReviewRequestD...
Java
schema ์–ด๋…ธํ…Œ์ด์…˜์„ ์‚ฌ์šฉํ•ด์„œ ํ‘œํ˜„ํ•˜๋ฉด ๋” ์ข‹์„ ๊ฒƒ ๊ฐ™์•„..!!
@@ -0,0 +1,53 @@ +'use client'; + +import Button from '@/app/components/common/button/Button'; +import Modal from '@/app/components/common/modal/Modal'; +import IconAlert from '@/app/components/icons/IconAlert'; + +interface ConfirmModalInterface { + title: string; + cancelLabel?: string; + confirmLabel?: string; + ...
Unknown
๊ณตํ†ต ์ปดํฌ๋„ŒํŠธ ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!!!!
@@ -10,6 +10,7 @@ import useModal from '@/app/hooks/useModal'; import DetailMemberModal from '@/app/components/team/DetailMemberModal'; import deleteMember from '@/app/lib/group/deleteMemeber'; import { useMutation, useQueryClient } from '@tanstack/react-query'; +import ConfirmModal from '@/app/components/common/mod...
Unknown
`๋ฅผ ์ถ”๋ฐฉํ•˜์‹œ๊ฒ ์–ด์š”?` ๋ผ๊ณ  ๋ช…์‹œํ•˜๋ฉด ์ด๋ฆ„ ๋งˆ์ง€๋ง‰ ๊ธ€์ž์— ๋ฐ›์นจ์ด ์žˆ๋Š” ์‚ฌ๋žŒ์€ ๋ฌธ๊ตฌ๊ฐ€ ์–ด์ƒ‰ํ•˜๊ฒŒ ๋ณด์ผ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์˜ˆ): ํ™์ง€์œค๋ฅผ ์ถ”๋ฐฉํ•˜์‹œ๊ฒ ์–ด์š”? ๊ทธ๋ž˜์„œ `${member.userName}๋‹˜์„ ์ถ”๋ฐฉํ•˜์‹œ๊ฒ ์–ด์š”?` ๊ฐ€ ๋” ๊ดœ์ฐฎ์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -10,6 +10,7 @@ import useModal from '@/app/hooks/useModal'; import DetailMemberModal from '@/app/components/team/DetailMemberModal'; import deleteMember from '@/app/lib/group/deleteMemeber'; import { useMutation, useQueryClient } from '@tanstack/react-query'; +import ConfirmModal from '@/app/components/common/mod...
Unknown
๋ฌธ๊ตฌ ๋””ํ…Œ์ผ์„ ๋†“์ณค๋„ค์š”. ๋ฐ˜์˜ํ•ด์„œ ์˜ฌ๋ฆฌ๊ฒ ์Šต๋‹ˆ๋‹ค. ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค๐Ÿ˜Š
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
๊ตฌ์กฐ๋ถ„ํ•ดํ• ๋‹น์„ ์ž˜ ์“ฐ์‹ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
comment๊ด€๋ จ ํ•จ์ˆ˜๋ฅผ ๊น”๋”ํ•˜๊ฒŒ ์ž˜ ์ •๋ฆฌํ•˜์‹ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
์ปค๋ฉ˜ํŠธ ์ปดํฌ๋„ŒํŠธ์— ํ”„๋กญ์Šค ์ „๋‹ฌ์„ ๊น”๋”ํ•˜๊ฒŒ ์ž˜ ํ•˜์‹ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
์‚ผํ•ญ์—ฐ์‚ฐ์ž ์‚ฌ์šฉ์„ ์ž˜ ํ•˜์‹ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
Lifecycle Method๋ฅผ ์ž˜ ์‚ฌ์šฉํ•˜์‹ ๊ฑฐ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
์ €๋„ ์ ์šฉํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค!๐Ÿ‘
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
๋ฒ„ํŠผ์ด ํ™œ์„ฑํ™”๋  ๋•Œ ์ƒ‰์ƒ ๋ณ€๊ฒฝ๊ณผ ๋น„ํ™œ์„ฑํ™” ๊ธฐ๋Šฅ๊นŒ์ง€ ๊ตฌํ˜„ํ•˜์‹  ์  ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค:)
@@ -0,0 +1,74 @@ +[ + { + "id": 1, + "userName": "bbangho", + "alt": "wecode", + "img": "/images/youngho/hanRiver.jpeg", + "comment": [ + { + "id": 1, + "userName": "bbangho", + "content": "ํ•œ๊ฐ• ๋‹ค๋…€๊ฐ~ โœŒ๏ธ", + "isLiked": true + }, + { + "id": 2, + "use...
Unknown
๋ชฉ๋ฐ์ดํ„ฐ ์‚ฌ์šฉ ๋„ˆ๋ฌด ์ข‹์Šต๋‹ˆ๋‹ค! :)
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
```suggestion <button onClick={this.handleLogin} className={condition ? 'buttonActivate' : 'buttonDisabled'} id="loginButton" disabled={ condition ? false : true} > ๋กœ๊ทธ์ธ </button> ``` ํ•ด๋‹น ์กฐ๊ฑด...
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
์ฐธ๊ณ ๋กœ ์œ„์˜ ๋ณ€์ˆ˜๋Š” render ํ•จ์ˆ˜ ๋‚ด์—์„œ ์„ ์–ธํ•ด์ฃผ์‹œ๋ฉด ๋ฉ๋‹ˆ๋‹ค!!
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
```suggestion body { background-color: #fafafa; } .container { text-align: center; border: 1px solid #e6e6e6; background-color: white; width: 600px; height: 600px; margin: 50px auto 0 auto; } .header { font-family: 'Lobster', cursive; font-size: 70px; font-weight: 1px; padding:...
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
์˜ํ˜ธ๋‹˜! ์ „์ฒด์ ์œผ๋กœ CSS ์†์„ฑ ์ˆœ์„œ ํ™•์ธํ•ด์„œ ์ ์šฉํ•ด์ฃผ์„ธ์š”~ - ํ•˜๋‚˜์˜ ์š”์†Œ์— ์—ฌ๋Ÿฌ๊ฐ€์ง€ ์†์„ฑ์„ ๋ถ€์—ฌํ•˜๋Š” ๊ฒฝ์šฐ ์ค‘์š”๋„, ๊ด€๋ จ๋„์— ๋”ฐ๋ผ์„œ ๋‚˜๋ฆ„์˜ convention์„ ์ง€์ผœ์„œ ์ž‘์„ฑํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. - ์ผ๋ฐ˜์ ์ธ convention ์€ ์•„๋ž˜์™€ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆœ์„œ ์ ์šฉํ•ด์ฃผ์„ธ์š”. [CSS property ์ˆœ์„œ] - Layout Properties (position, float, clear, display) - Box Model Properties (width, height, margin, padding) - Visual ...
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
import ์ˆœ์„œ๋Š” ์ž˜ ๋งž์ถฐ์ฃผ์…จ๊ณ , ํ•ด๋‹น ๋ถ€๋ถ„์—์„œ๋Š” ์ค„๋ฐ”๊ฟˆ ์—†์ด ์ง„ํ–‰ํ•ด์ฃผ์„ธ์š”~
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
fetchํ•จ์ˆ˜์˜ `get method๋Š” method์˜ default` ๊ฐ’์ž…๋‹ˆ๋‹ค. ๋”ฐ๋ผ์„œ `์ƒ๋žต์ด ๊ฐ€๋Šฅ`ํ•ฉ๋‹ˆ๋‹ค. ๊ณ ๋กœ get method ์š”์ฒญ์‹œ์—๋Š” ์•„๋ž˜์™€ ๊ฐ™์ด ๋‘๋ฒˆ์งธ ์ธ์ž๊ฐ€ ์ƒ๋žต ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ```jsx const foo = () => { fetch(`${cartAPI}/quantity`) .then((res) => res.json()) ```
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
story ๋ถ€๋ถ„์ด ์—ฌ๋Ÿฌ๋ฒˆ ๋ฐ˜๋ณต๋˜๊ณ  ์žˆ๋„ค์š”! ์ƒ์ˆ˜ ๋ฐ์ดํ„ฐ์™€ map์„ ์‚ฌ์šฉํ•ด์„œ ์ค‘๋ณต๋œ ๋ถ€๋ถ„์„ ์ค„์—ฌ์ฃผ์„ธ์š”! ``` const STORIES = [ {img: "//", name: "wecorder1"}, {img: "//", name: "wecorder2"}, {img: "//", name: "wecorder3"} ]; STORIES.map(); ```
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
๋ฐ˜์‘ํ˜• ์•„์ฃผ ์ข‹๋„ค์š”!! ๋ธŒ๋ ˆ์ดํฌ ํฌ์ธํŠธ๋Š” ๊ธฐํš๋งˆ๋‹ค ๋‹ฌ๋ผ์ง€์ง€๋งŒ ๋ณดํ†ต ํƒœ๋ธ”๋ฆฟ๊ณผ ๋ฐ์Šคํฌํƒ‘์˜ ๊ตฌ๋ถ„์ ์€ 1078px์ด๋ผ๋Š” ์  ์•Œ์•„๋‘์„ธ์š”! ๋ชจ๋ฐ”์ผ๊ณผ ํƒœ๋ธ”๋ฆฟ์€ 768px์ž…๋‹ˆ๋‹ค!
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
๊ฐ™์€ ์Šคํƒ€์ผ์˜ ๊ฒฝ์šฐ์—๋Š” ์ค‘๋ณตํ•˜์—ฌ ์ฃผ์‹œ์ง€ ๋ง๊ณ  ๊ฐ™์€ ํด๋ž˜์Šค๋ช…์„ ์‚ฌ์šฉํ•˜์…”๋„ ๋ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
import ๊ตฌ๋ถ„์€ ๋„ˆ๋ฌด ์ข‹์ง€๋งŒ ์ค„๋ฐ”๊ฟˆ์€ ์•ˆํ•˜์…”๋„ ๋ฉ๋‹ˆ๋‹ค!!!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
์ด๋ ‡๊ฒŒ ๊ตฌ์กฐ๋ถ„ํ•ดํ• ๋‹น ๋„ˆ๋ฌด ์ข‹๋„ค์š”!!
@@ -0,0 +1,74 @@ +[ + { + "id": 1, + "userName": "bbangho", + "alt": "wecode", + "img": "/images/youngho/hanRiver.jpeg", + "comment": [ + { + "id": 1, + "userName": "bbangho", + "content": "ํ•œ๊ฐ• ๋‹ค๋…€๊ฐ~ โœŒ๏ธ", + "isLiked": true + }, + { + "id": 2, + "use...
Unknown
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -1,10 +1,94 @@ import React from 'react'; +import { Link } from 'react-router-dom'; + +import './Login.scss'; class Login extends React.Component { + constructor() { + super(); + this.state = { + loginId: '', + loginPassword: '', + }; + } + + handleLoginInput = e => { + const { value, na...
JavaScript
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,78 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +body { + background-color: #fafafa; +} + +.container { + text-align: center; + width: 600px; + height: 600px; + margin: 50px auto 0 auto; + border: 1px solid #e6e6e6; + background-color: white; +} + +.header { + padding:...
Unknown
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -1,10 +1,178 @@ import React from 'react'; +import Nav from '../../../components/Nav/Nav'; +import Feed from '../../../components/Feed/Feed'; +import './Main.scss'; + class Main extends React.Component { + constructor() { + super(); + this.state = { + feeds: [], + }; + } + + componentDidMount() ...
JavaScript
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,285 @@ +@import 'https://fonts.googleapis.com/css2?family=Lobster&display=swap'; +@media screen and (max-width: 1200px) { + .mainRight { + display: none; + } + + .article { + width: 100%; + } +} + +body { + margin: 0; + padding: 0; + border-collapse: collapse; +} + +article { + width: 800px; + ...
Unknown
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
๋ฐ˜์˜ ์™„๋ฃŒํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,125 @@ +import React from 'react'; +import Comment from '../Comment/Comment'; +import './Feed.scss'; + +class Feed extends React.Component { + constructor(props) { + super(props); + const { comment } = this.props.data; + this.state = { + comment: comment, + commentInputValue: '', + }; ...
JavaScript
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค ๐ŸŒ
@@ -0,0 +1,17 @@ +from django.db import models + +class User(models.Model): + email = models.EmailField(max_length=50, unique=True) + password = models.CharField(max_length=100) + relation = models.ManyToManyField('self', through='Follow', symmetrical=False) + + class Meta: + db_table = "users" + ...
Python
๋‹ค๋ฏผ๋‹˜! ์ž˜ ์ž‘์„ฑํ•ด์ฃผ์…จ๋Š”๋ฐ `email` ์€ ๊ฒน์น  ์ˆ˜ ์—†๋Š” ์ •๋ณด์ด๊ธฐ ๋•Œ๋ฌธ์— ํ•ด๋‹นํ•˜๋Š” ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•ด์ฃผ์‹œ๋Š”๊ฒŒ ์ข‹์Šต๋‹ˆ๋‹ค! ์•Œ์•„๋ณด์‹œ๊ณ  ์•Œ๋งž์€ ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”~
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error๊ฐ€ ์•„๋‹ˆ๋ผ django์˜ ๊ถŒ์žฅ์‚ฌํ•ญ. ํ•˜์ง€๋งŒ ํŒจํ„ด ์ปจ๋ฒค์…˜์—๋Š” ์œ„ ์‚ฌํ•ญ์ด ๋งž๋‹ค.'''
Python
import ํ•˜์‹ค ๋•Œ `*` ์‚ฌ์šฉํ•˜์ง€ ๋งˆ์‹œ๊ณ  ๋ช…ํ™•ํ•˜๊ฒŒ ๊ฐ€์ ธ์˜ค๊ณ  ์‹ถ์€ class ๋ฅผ ์ ์–ด์ฃผ์„ธ์š”!
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error๊ฐ€ ์•„๋‹ˆ๋ผ django์˜ ๊ถŒ์žฅ์‚ฌํ•ญ. ํ•˜์ง€๋งŒ ํŒจํ„ด ์ปจ๋ฒค์…˜์—๋Š” ์œ„ ์‚ฌํ•ญ์ด ๋งž๋‹ค.'''
Python
์ด ๋ถ€๋ถ„ ์„ธ์…˜ ์ค‘ ํ•œ๋ฒˆ ์„ค๋ช… ๋“œ๋ ธ๋Š”๋ฐ, ์™œ `/` ๊ด€๋ จ warning ์ด ๋œฌ๋‹ค๊ณ  ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”!?
@@ -0,0 +1,21 @@ +"""westagram URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.hom...
Python
์ด ๋ถ€๋ถ„์€ ์œ„์ฝ”๋“œ url ํŒจํ„ด ์ปจ๋ฒค์…˜์— ๋งž์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ์œ„์— ๋ฆฌ๋ทฐ๋“œ๋ฆฐ ๋‚ด์šฉ ์ค‘ `/` ๊ด€๋ จ ์งˆ๋ฌธ ๋‚จ๊ฒจ๋“œ๋ ธ์œผ๋‹ˆ ํ™•์ธํ•ด์ฃผ์„ธ์š”.
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
๊น”๋”ํ•˜๋„ค์š”~! ๐Ÿ’ฏ
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
`json.loads()` ๋„ ํ•ธ๋“คํ•ด์ฃผ์…”์•ผํ•˜๋Š” exception ์ด ๋ฐœ์ƒํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ํ™•์ธํ•ด๋ณด์‹œ๊ณ  ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
๋‹ค๋ฏผ๋‹˜์ด ์ž‘์„ฑํ•˜์‹  ์ฝ”๋“œ ๋กœ์ง์„ ์ˆœ์„œ๋Œ€๋กœ ์ •๋ฆฌํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค. 1. `client` ์—์„œ ๋“ค์–ด์˜จ `email`, `password` ๊ฐ’์„ ์ด์šฉํ•˜์—ฌ ์ผ์น˜ํ•˜๋Š” user ๋ฅผ filter ํ•˜๋Š” ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ ค user ๋ณ€์ˆ˜์— ์ €์žฅํ•ด์ค€๋‹ค. 2. `email` ๋กœ filter ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ ค ์กด์žฌํ•˜๋Š” user ์ธ์ง€ ํ™•์ธํ•œ๋‹ค. 3. `password` ๋กœ filter ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ ค ์กด์žฌํ•˜๋Š” user ์ธ์ง€ ํ™•์ธํ•œ๋‹ค. 4. client ์—์„œ ๋“ค์–ด์˜จ `email`, `password` ๊ฐ€ ์œ ํšจํ•œ ํฌ๋งท์ธ์ง€ ๊ฒ€์‚ฌํ•˜์—ฌ ์œ ํšจํ•˜๋‹ค๋ฉด CREATE ๋ฅผ ์ง„ํ–‰ํ•œ๋‹ค. ์ด๋ ‡๊ฒŒ ๋ง๋กœ ์ •๋ฆฌํ•ด๋ณด๋‹ˆ ํ๋ฆ„์ด ์ข€ ์–ด...
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
์—ฌ๊ธฐ์„œ ์ž ๊น ์งˆ๋ฌธ! `KeyError` ์–ด๋–ค ์—๋Ÿฌ์ด๋ฉฐ, ์–ธ์ œ ๋ฐœ์ƒํ• ๊นŒ์š”?
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
SignupView ์™€ ๋น„์Šทํ•œ ๋กœ์ง ํ๋ฆ„์ด๋„ค์š”. ์œ„์ชฝ ๋‚จ๊ฒจ๋“œ๋ฆฐ ์งˆ๋ฌธ ๋จผ์ € ํ™•์ธํ•ด์ฃผ์„ธ์š”!
@@ -0,0 +1,17 @@ +from django.db import models + +class User(models.Model): + email = models.EmailField(max_length=50, unique=True) + password = models.CharField(max_length=100) + relation = models.ManyToManyField('self', through='Follow', symmetrical=False) + + class Meta: + db_table = "users" + ...
Python
`from django.db import models class User(models.Model): email = models.EmailField(max_length=50, unique=True)` ๋กœ ํ•ด๊ฒฐํ–ˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error๊ฐ€ ์•„๋‹ˆ๋ผ django์˜ ๊ถŒ์žฅ์‚ฌํ•ญ. ํ•˜์ง€๋งŒ ํŒจํ„ด ์ปจ๋ฒค์…˜์—๋Š” ์œ„ ์‚ฌํ•ญ์ด ๋งž๋‹ค.'''
Python
`from django.urls import path from .views import SignupView, LoginView` ๋กœ ํ•„์š”ํ•œ ๋ทฐ ํด๋ž˜์Šค ๊ฐ€์ ธ์˜ค๋Š” ๊ฒƒ์œผ๋กœ ์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,10 @@ +from django.urls import path +from .views import SignupView, LoginView, FollowView + +urlpatterns = [ + path('/user', SignupView.as_view()), + path('/login', LoginView.as_view()), + path('/follow', FollowView.as_view()), + +] +'''Error๊ฐ€ ์•„๋‹ˆ๋ผ django์˜ ๊ถŒ์žฅ์‚ฌํ•ญ. ํ•˜์ง€๋งŒ ํŒจํ„ด ์ปจ๋ฒค์…˜์—๋Š” ์œ„ ์‚ฌํ•ญ์ด ๋งž๋‹ค.'''
Python
Error๊ฐ€ ์•„๋‹ˆ๋ผ django์˜ ๊ถŒ์žฅ์‚ฌํ•ญ์ด์–ด์„œ ๊ทธ๋ ‡์Šต๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ ํŒจํ„ด ์ปจ๋ฒค์…˜์—๋Š” ๊ณ ์ณ์„œ ์“ฐ๋Š” ๊ฒƒ์ด ๋งž๊ธฐ ๋•Œ๋ฌธ์— ๊ณ ์ณค์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,21 @@ +"""westagram URL Configuration + +The `urlpatterns` list routes URLs to views. For more information please see: + https://docs.djangoproject.com/en/3.1/topics/http/urls/ +Examples: +Function views + 1. Add an import: from my_app import views + 2. Add a URL to urlpatterns: path('', views.hom...
Python
์ˆ˜์ •ํ•˜์˜€์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
`class SignupView(View): def post(self, request): try: data = json.loads(request.body) user = User.objects.filter(email=data['email'],password=data['password'])` ์•„๋ž˜ ๋กœ๊ทธ์ธ๋ทฐ๋„ ๋˜‘๊ฐ™์€ ํ˜•ํƒœ๋กœ ๋ฐ”๊ฟจ์Šต๋‹ˆ๋‹ค. ์ด์œ  : ์‚ฌ์šฉ์ž์—๊ฒŒ ํ˜•์‹์„ ๋ฐ›์„ ๋•Œ ๊ผญ ๋‚ด๊ฐ€ ์›ํ•˜๋Š” ํ˜•ํƒœ๋กœ json์ด ์˜ค์ง€ ์•Š์„ ์ˆ˜ ์žˆ๊ธฐ์— Key-error ์ƒํ™ฉ์„ ์ค˜์•ผ ํ•˜๊ธฐ ๋•Œ๋ฌธ.
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
์ด๊ฑฐ ํƒํ–ฅ๋‹˜ํ•˜๊ณ  ์ด์•ผ๊ธฐํ•˜๋‹ค๊ฐ€ ์•ˆ ๊ฒƒ์ธ๋ฐ, ํ‚ค ์—๋Ÿฌ๋ž€ ๋”•์…”๋„ˆ๋ฆฌ ํ˜•ํƒœ์—์„œ ์ž์ฃผ ๋ฐœ์ƒํ•˜๋ฉฐ ๋”•์…”๋„ˆ๋ฆฌ ๋‚ด๋ถ€์— ์กด์žฌํ•˜์ง€ ์•Š๋Š” ํ‚ค๋ฅผ ์‚ฌ์šฉํ•ด์„œ ๊ฐ’์„ ๋‚ด๋ ค๊ณ  ํ•  ๋•Œ ๋‚˜๋Š” ์—๋Ÿฌ์ž…๋‹ˆ๋‹ค. ์ด๋ฒˆ ์˜ˆ์‹œ๋กœ๋Š” ๋งŒ์ผ ๋ฐ์ดํ„ฐ๊ฐ€ email=~~~ password=~~~ ๋กœ ์˜ค๋Š” ๊ฒƒ์ด ์•„๋‹ˆ๋ผ emailadkfj=~~~ apsdkfjsa=~~~์ฒ˜๋Ÿผ ํ‚ค ๋‚ด์šฉ์ด ์ž˜๋ชป ์™€๋ฒ„๋ฆฌ๋Š” ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๋กœ ํ‚ค ์—๋Ÿฌ๋ฅผ ๋‚ด๊ธฐ ์œ„ํ•ด ํ•˜๋Š” ๊ฒƒ์œผ๋กœ ์˜๋„ํ•˜๊ณ  ํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค
@@ -0,0 +1,103 @@ +import json +import bcrypt +import jwt + +from django.views import View +from django.http import JsonResponse + +from .models import User, Follow +from my_settings import SECRET_KEY + +class SignupView(View): + def post(self, request): + try: + data = json.loads(request.body...
Python
๋จผ์ € ๋‘ ํด๋ž˜์Šค ๋ชจ๋‘ ๊ณตํ†ต์ ์œผ๋กœ user๋ผ๋Š” ๋ณ€์ˆ˜๊ฐ€ ๋ถˆํ•„์š”ํ•ด์„œ ์ง€์› ์Šต๋‹ˆ๋‹ค. - ์ด์œ  : ์ด๋ฏธ User.~๋ฅผ ํ†ตํ•ด ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ ค ๋ฐ์ดํ„ฐ์—์„œ ํ•„์š”ํ•œ ์ž๋ฃŒ๋ฅผ ๊ฐ€์ ธ์˜ฌ ์ˆ˜ ์žˆ๋‹ค. ๋ถˆํ•„์š”ํ•œ ๋ณ€์ˆ˜์˜€๋‹ค. - comment : 1. client์—์„œ ๋“ค์–ด์˜จ ๊ฐ’ ์ค‘ ์ด๋ฉ”์ผ ํ•„ํ„ฐ ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ ค ์กด์žฌํ•˜๋Š” ์ด๋ฉ”์ผ์ผ ๊ฒฝ์šฐ์ธ์ง€ ํ™•์ธ. 2. (๋งˆ์ฐฌ๊ฐ€์ง€๋กœ) ๋น„๋ฐ€๋ฒˆํ˜ธ ํ•„ํ„ฐ ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ ค ์กด์žฌํ•˜๋Š” ๋น„๋ฐ€๋ฒˆํ˜ธ์ธ์ง€ ํ™•์ธ. 3. ์ด๋ฉ”์ผ๊ณผ ๋น„๋ฐ€๋ฒˆํ˜ธ๊ฐ€ ์œ ํšจํ•œ ํฌ๋งท์ธ์ง€ ๊ฒ€์‚ฌํ•˜์—ฌ ์œ ํšจํ•˜๋ฉด ๊ฐ’ ๋งŒ๋“ค๊ธฐ ์ง„ํ–‰. - ์•„์ง ์ฟผ๋ฆฌ๋ฅผ ๋‚ ๋ฆฐ๋‹ค๋Š” ๊ฐœ๋…์ด ํ™•์‹คํžˆ ์„œ์ง€ ์•Š์•„ ํ‘œํ˜„์ด ๋งž๋Š”๊ฑด์ง€๋Š” ๋ชจ๋ฅด๊ฒ ์Šต๋‹ˆ๋‹ค. ๋ฌธ๋ฒ•์ ์ธ ์ ์€ ๊ฒ€ํ† ํ•ด...
@@ -0,0 +1,17 @@ +from django.db import models + +class User(models.Model): + email = models.EmailField(max_length=50, unique=True) + password = models.CharField(max_length=100) + relation = models.ManyToManyField('self', through='Follow', symmetrical=False) + + class Meta: + db_table = "users" + ...
Python
`unique=True` ๊ตณ์ž…๋‹ˆ๋‹ค!!