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` ๊ตณ์
๋๋ค!! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.