code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | final 로 선언하신 이유가 궁금합니다~ |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | check 메서드들이 public 인 이유가 있나요~? |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | java 8 의 stream map 을 써보면 어떨까요? |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | 접근제어자를 package-private 으로 하신 이유가 있을까요? |
@@ -0,0 +1,57 @@
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+public class Lotto {
+ private final static int LOTTO_NUM_SIZE = 6;
+ private final List<LottoNo> lottoNums;
+
+ public Lotto(List<LottoNo> lottoNums) {
+ checkSizeValid(lottoNums);... | Java | Set<LottoNo> 로 선언하는 것은 어떻게 생각하시나요~ |
@@ -0,0 +1,46 @@
+import java.util.Objects;
+
+public class LottoNo implements Comparable<LottoNo> {
+ private final static int INVALID_NUM = 0;
+ public final static LottoNo INVALID_LOTTO_NO = new LottoNo(INVALID_NUM);
+
+ private int lottoNumber;
+
+ public LottoNo(int lottoNumber) {
+ try {
+ ... | Java | LottoNo 는 변경되지 않는 lottoNumber 하나를 가지고 있어야하므로
final 키워드를 넣어도 될 것 같네요 ㅎㅎ |
@@ -0,0 +1,46 @@
+import java.util.Objects;
+
+public class LottoNo implements Comparable<LottoNo> {
+ private final static int INVALID_NUM = 0;
+ public final static LottoNo INVALID_LOTTO_NO = new LottoNo(INVALID_NUM);
+
+ private int lottoNumber;
+
+ public LottoNo(int lottoNumber) {
+ try {
+ ... | Java | 음.. RuntimeException 을 발생시키고 catch 를 굳이 하는 이유가 있을까요?
checkedException 과 uncheckedException 에 대해서 공부해보시면 좋을 것 같습니다~ |
@@ -0,0 +1,46 @@
+import java.util.Objects;
+
+public class LottoNo implements Comparable<LottoNo> {
+ private final static int INVALID_NUM = 0;
+ public final static LottoNo INVALID_LOTTO_NO = new LottoNo(INVALID_NUM);
+
+ private int lottoNumber;
+
+ public LottoNo(int lottoNumber) {
+ try {
+ ... | Java | 굳이 메서드로 빼지 않아도 될 것 같아요 |
@@ -0,0 +1,40 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class LottoRankResult {
+ private List<Rank> ranks;
+
+ public LottoRankResult(WinningLotto winningLotto, LottoTicket lottoTicket) {
+ this.ranks = new ArrayList<>();
+
+ for (Lotto lotto : lottoTicket.getAllLottoGames()... | Java | 뭔가 이름이 결과를 담는 데이터 그릇 같은 느낌이라
LottoCalculator
LottoResultCalculator
LottoRankCalculator
같은 네이밍으로 변경해보면 어떨까요?
그에 맞춰서 메서드 네이밍도 변경하면 단순히 set 된 데이터를 get 하는 것보다
상태와 행위를 갖는 객체지향적인 네이밍이 될 것 같다는 생각이 듭니다 |
@@ -0,0 +1,22 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class Lottos {
+ private List<Lotto> lottos;
+
+ public Lottos() {
+ this.lottos = new ArrayList<>();
+ }
+
+ public List<Lotto> getLottos() {
+ return lottos;
+ }
+
+ public void addLotto(Lotto lotto) {
+ ... | Java | Lottos 가 가지는 행위가 하나도 없는데요,
다른 객체에서 위임할만한게 없을까요?
get이 사용되고 있다는 것은 Lottos 의 tell dont ask 원칙이 안지켜지고 있다는 뜻이고,
여기로 위임할만한 책임이 산재해 있다는 뜻이기도 합니다. |
@@ -0,0 +1,29 @@
+import java.util.List;
+
+public class WinningLotto {
+ private Lotto winningLotto;
+ private LottoNo bonusNo;
+
+ public WinningLotto(List<LottoNo> winningLottoNumbers, LottoNo lottoNo) {
+ if (winningLottoNumbers == null) {
+ throw new IllegalArgumentException("'lotto' mus... | Java | Lotto를 상속 받을 수도 있었는데 이렇게 합성을 사용하셨네요. 👍
혹시라도 우연히 이렇게 구현하신거라면,
상속과 합성을 구글링 해보시면 관련 자료를 찾으실 수 있을겁니다 ~ |
@@ -0,0 +1,43 @@
+import java.util.Scanner;
+
+public class LottoApplication {
+ private static boolean APP_SUCCESS = false;
+
+ public static void main(String[] args) {
+ runUntilAppSuccess();
+ }
+
+ public static void runUntilAppSuccess() {
+ while (!APP_SUCCESS) {
+ run();
+ ... | Java | LottoGame 이라는 네이밍은 어떨까요 |
@@ -0,0 +1,43 @@
+import java.util.Scanner;
+
+public class LottoApplication {
+ private static boolean APP_SUCCESS = false;
+
+ public static void main(String[] args) {
+ runUntilAppSuccess();
+ }
+
+ public static void runUntilAppSuccess() {
+ while (!APP_SUCCESS) {
+ run();
+ ... | Java | lottoService 에 set 하고 get 하고 절차지향적인 방식으로 코드가 짜여져 있습니다.
모든 로직이 lottoService 를 통하면서 결국 이 클래스는 점점 비대해질텐데요
좋은 개선 방법이 없을까요~? |
@@ -0,0 +1,48 @@
+import java.util.Arrays;
+
+public enum Rank {
+ FIRST(6, 2000000000),
+ SECOND(5, 30000000),
+ THIRD(5, 1500000),
+ FOURTH(4, 50000),
+ FIFTH(3, 5000),
+ MISS(0, 0);
+
+ private int countOfMatch;
+ private Money winningMoney;
+
+ Rank(int countOfMatch, int winningMoney) {
+... | Java | 중괄호가 빠졌습니다 |
@@ -0,0 +1,21 @@
+public class RankResult {
+ private Rank rank;
+ private int countOfRank;
+
+ RankResult(Rank rank) {
+ this.rank = rank;
+ this.countOfRank = 0;
+ }
+
+ public Rank getRank() {
+ return rank;
+ }
+
+ public int getCountOfRank() {
+ return countOfRank;
... | Java | 데이터들을 클래스로 묶는 것이 객체지향은 아닙니다~
RankResult 도 결국 데이터와 get 만 가지고 있고,
유의미한 행위가 없습니다 ㅠㅠ
불필요한 객체가 아닌지, 유의미한 행위를 가진 객체로 만들려면 어떤 행위를 부여해야하는지
고민해보시면 좋을 것 같아요~ |
@@ -0,0 +1,50 @@
+import java.util.List;
+
+public class LottoSeller {
+ private LottoPurchaseService lottoPurchaseService;
+ private Money change;
+
+ public LottoSeller() {
+ change = Money.ZERO;
+ lottoPurchaseService = new LottoPurchaseService();
+ }
+
+ public LottoTicket sellTicketTo(... | Java | Service 라는 네이밍을 쓰시는걸로 봐서
웹 쪽 자료를 보신 것 같은데,
controller, service, repository
이런 layered architecture 는 지금 저희가 하고 있는 객체지향과 거리가 좀 있습니다 ~
service 라는 네이밍을 사용하기보다는 좀 더 구체적이고 누구나 글 읽듯이 볼 수 있는 네이밍을 하시면
해당 객체에 부여하는 책임과 행위들도 달라지게 됩니다 ~
네이밍은 단순히 시각적인 효과 그 이상의 가치를 가지고 있습니다 |
@@ -0,0 +1,50 @@
+import java.util.List;
+
+public class LottoSeller {
+ private LottoPurchaseService lottoPurchaseService;
+ private Money change;
+
+ public LottoSeller() {
+ change = Money.ZERO;
+ lottoPurchaseService = new LottoPurchaseService();
+ }
+
+ public LottoTicket sellTicketTo(... | Java | 점 하나 찍을 때는 줄바꿈을 안하시는게 일반적입니다.
메소드 파라미터도 3개 이상부터 엔터를 치시는게 어떨까요? |
@@ -0,0 +1,42 @@
+import java.util.List;
+
+public class LottoService {
+ LottoUser lottoUser;
+ LottoSeller lottoSeller;
+ LottoTicket purchasedLottoTicket = null;
+ WinningLotto winningLotto = null;
+ PurchaseResultView purchaseResultView = null;
+ WinningResultView winningResultView = null;
+
+ ... | Java | set을 사용하지 않는다는 객체지향 생활체조 규칙을 적용해보시면
코드의 설계가 달라질 것 같습니다 |
@@ -0,0 +1,43 @@
+import java.util.ArrayList;
+import java.util.List;
+
+public class LottoTicket {
+ private Money ticketPrice;
+ private Lottos autoLottos;
+ private Lottos manualLottos;
+
+ public LottoTicket(Money ticketPrice, Lottos autoLottos, Lottos manualLottos) {
+ this.ticketPrice = ticketP... | Java | 여기도 행위가 없고 데이터 + getter 뿐이네요.
그런데 이렇게 클래스를 나눠보려고 최대한 시도하신 점 👍 |
@@ -0,0 +1,35 @@
+import java.util.List;
+
+public class LottoUser {
+ private Money investMoney;
+ private int countOfManualLotto;
+ private List<List<LottoNo>> numbersOfManualLottos;
+
+ private LottoTicket lottoTicket;
+
+ public LottoUser(Money investMoney, int countOfManualLotto, List<List<LottoNo>>... | Java | 여기도 setter getter 뿐 이네요 ㅠ |
@@ -0,0 +1,65 @@
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+public final class LottoPurchaseService {
+ public final static Money LOTTO_PRICE = Money.valueOf(1000);
+
+ public static Money validatePurchase(Money inputMoney, int countOfManualLotto) throws OutOfConditionE... | Java | 데이터와 프로세스가 따로 있는 것 == 절차지향 프로그래밍
현 상황 :
데이터 = LottoSeller, Ticket, User 등 (데이터 + getter)
프로세스 = Service (데이터 get 해서 로직 처리)
답 : MVC와 layered architecture를 잊고 view 와 비즈니스 로직을 분리하는 것만 기억하고 짜보기 |
@@ -0,0 +1,65 @@
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+import java.util.Scanner;
+import java.util.stream.Collectors;
+
+public final class InputView {
+
+ public static Money scanMoney(Scanner scanner) {
+ System.out.println("\n구입금액을 입력해 주세요.");
+
+ return Mon... | Java | view 에서는 데이터를 scan 해오는 책임만 있습니다.
지금은 변환 로직까지 여기서 처리하고 있네요~! |
@@ -0,0 +1,29 @@
+public final class PurchaseResultView {
+ public void notifyIfChangeLeft(LottoSeller seller) {
+ if (!seller.getChange().equals(Money.ZERO)) {
+ System.out.println("잔돈 " + seller.getChange() + "원이 남았습니다.");
+ System.out.println();
+ }
+ }
+
+ public void pr... | Java | finall class 로 하신 이유가 궁금합니다~ |
@@ -0,0 +1,79 @@
+"use client";
+
+import { useRef, useState } from "react";
+import CameraIcon from "@/assets/images/icons/camera.svg";
+import FilledDeleteIcon from "@/assets/images/icons/filled_delete.svg";
+import { useSimpleImageUpload } from "@/hooks/useSimpleImageUpload";
+
+export default function ReviewImageIn... | Unknown | useUploadImage를 활용해도 되지 않나요?.? |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | `createReviewMutation.isPending` 사용해서 중복 호출 방지하면 좋을것 같습니다! |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 작성된 내용들을 새로고침 했을 때도 사라지지 않게, localStorage에 저장하면 더 좋을 것 같습니다. |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 해당 라인은 불필요하다고 생각합니다. 토큰이 없으면 어짜피 서버에서 검증 후 에러를 던져줍니다.
UX적으로 API 요청 전 검사 후 리다이렉트가 필요하면 `mutatonFn`을 wrapping하는 방식을 사용하시거나
중앙집중식으로 관리하는 방식으로 구현하시길 바랍니다. |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 여기서 throw 된 에러는 어디서 어떻게 핸들링 될까요? |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | `Blob` 인스턴스로 만드는 이유가 궁금합니다. |
@@ -0,0 +1,79 @@
+"use client";
+
+import { useRef, useState } from "react";
+import CameraIcon from "@/assets/images/icons/camera.svg";
+import FilledDeleteIcon from "@/assets/images/icons/filled_delete.svg";
+import { useSimpleImageUpload } from "@/hooks/useSimpleImageUpload";
+
+export default function ReviewImageIn... | Unknown | `useSimpleImageUpload`는 이전에 IndexedDB 이슈가 있었을 때 급하게 대체 구현이 필요해서 만들어둔 훅입니다.
이후 IndexedDB 이슈가 해결되었지만 유저페이지를 비롯한 기타 작업에 아직 실제 적용은 해보지 않은 상태라 일단 `useSimpleImageUpload`로 구현했습니다!
추후 리팩토링 단계에서 IndexedDB를 적용하면서 이 부분도 `useUploadImage`로 교체하도록 하겠습니당 |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 넵 리팩토링 때 반영해보겠습니다 |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 그게 더 좋은 방식 같네요! 그렇게 수정해보겠습니다! |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 넵 피드백 감사합니다!
말씀하신 대로 api 레벨의 토큰 체크는 제거하고, 컴포넌트 진입 시점에 처리하도록 수정했습니다! |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | `multipart/form-data`로 파일과 JSON 객체를 함께 전송할 때 발생하는 파싱 이슈를 해결하기 위해 사용했습니다.
일전의 프로필수정 작업 때 같은 이슈가 있었는데, 이 방식이 잘 작동하여 동일한 패턴을 적용했습니다. |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 앗, throw된 에러가 제대로 핸들링되지 않고 있었습니다🥹
`useReviewMutation`의 `onError`에서 모달 알림창을 띄우도록 수정했습니다. |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | JSON 객체를 함께 전송시 어떤 파싱이슈가 발생하나요? |
@@ -0,0 +1,104 @@
+"use client";
+
+import { FormProvider, useForm } from "react-hook-form";
+import SolidButton from "@/components/common/buttons/SolidButton";
+import CommonTextArea from "@/components/common/inputs/TextArea";
+import RatingInput from "@/components/create-reaview/RatingInput";
+import ReviewImageInput... | Unknown | 처음에 FormData에 request 객체를 JSON.stringify로 append했을 때는 요청이 실패했는데, 찾아보니 이미지 파일과 함께 보내는 멀티파트 폼데이터에서는 모든 데이터가 바이너리 형태여야 서버에서 제대로 파싱할 수 있다고 해서 Blob 객체로 변환하여 전송했더니 성공했습니다. |
@@ -8,7 +8,7 @@ export default class PlanMapper {
toDomain(): IPlan {
if (!this.plan) return null;
- return new Plan({
+ const returnPlan = new Plan({
id: this.plan.id,
createdAt: this.plan.createdAt,
updatedAt: this.plan.updatedAt,
@@ -19,11 +19,19 @@ export default class PlanMappe... | TypeScript | 이거 이전에 체크 안 한 것 같은데, status는 데이터베이스에서 default 값이 PENDING으로 주어지니까 mapper에는 필요없을 것 같아요. 이제 mapper는 repo에서만 쓰는 걸로 수정하셨다면 지워도 될 것 같습니다~! |
@@ -8,7 +8,7 @@ export default class PlanMapper {
toDomain(): IPlan {
if (!this.plan) return null;
- return new Plan({
+ const returnPlan = new Plan({
id: this.plan.id,
createdAt: this.plan.createdAt,
updatedAt: this.plan.updatedAt,
@@ -19,11 +19,19 @@ export default class PlanMappe... | TypeScript | PlanMapperProperties를 보니 makerProfile 안에 image가 들어가는 것 같은데, image 필드는 별개인가요? makerProfile을 undefined로 추가하는 이유도 궁금합니다.
```
maker?: {
id: string;
nickName: string;
makerProfile: { image: ProfileImage };
};
``` |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | isHasReview라는 이름이 너무 어색합니다 ㅋㅋㅋㅋㅋㅋㅋㅋㅋ 혹시 바꿔주실 수 있나요..? |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | hasReview를 reviewed로 전체 바꿔도 괜찮을 것 같아요. 어차피 리뷰는 한 번밖에 못 쓰니까 |
@@ -9,17 +9,15 @@ import ErrorMessage from 'src/common/constants/errorMessage.enum';
import { CreateOptionalQuoteData, QuoteQueryOptions } from 'src/common/types/quote/quote.type';
import { QuoteToClientProperties } from 'src/common/types/quote/quoteProperties';
import { CreatePlanData } from 'src/common/types/plan/... | TypeScript | hasReview가 boolean 값인데, isHasReview로 다시 한 번 boolean 으로 치환하는 이유가 있나요? |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | 이건 나중에 사용할 예정이신가요? |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | review: { is: null } | { isNot: null } 이건 어디에 어떻게 사용되는지 코드만 봐서 잘 모르겠어요. 설명해 주실 수 있나요? |
@@ -9,17 +9,15 @@ import ErrorMessage from 'src/common/constants/errorMessage.enum';
import { CreateOptionalQuoteData, QuoteQueryOptions } from 'src/common/types/quote/quote.type';
import { QuoteToClientProperties } from 'src/common/types/quote/quoteProperties';
import { CreatePlanData } from 'src/common/types/plan/... | TypeScript | false는 if문에서 필터가 되지 않아서 조건문으로 true거나 false거나 필터를 하게 했어요 |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | 필요할까 싶어서 만든건데 안썻나보네요 지우겠습니다 |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | 프리즈마에서 1:1 관계성 필드일 때 id로 체크하는게 가장 좋지만 plan과 review는 리뷰만 플랜 id를 가지고 있죠
그렇기에 리뷰가 있는지 없는지를 체크하기 위한 문법입니다. 혹시 다른 문법을 아시는게 있으신가요? |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | 좋습니다 변경할게요 ㅋㅋㅋ |
@@ -8,7 +8,7 @@ export default class PlanMapper {
toDomain(): IPlan {
if (!this.plan) return null;
- return new Plan({
+ const returnPlan = new Plan({
id: this.plan.id,
createdAt: this.plan.createdAt,
updatedAt: this.plan.updatedAt,
@@ -19,11 +19,19 @@ export default class PlanMappe... | TypeScript | 받아올 때는 makerProfile에 담겨오지만 맵퍼에서 makerProfile 안에 있는 image를 밖으로 끄집어오고 makerProfile이란 필드를 없애주기 위해 undefined를 넣었습니다 |
@@ -8,7 +8,7 @@ export default class PlanMapper {
toDomain(): IPlan {
if (!this.plan) return null;
- return new Plan({
+ const returnPlan = new Plan({
id: this.plan.id,
createdAt: this.plan.createdAt,
updatedAt: this.plan.updatedAt,
@@ -19,11 +19,19 @@ export default class PlanMappe... | TypeScript | 네 수정하겠습니다 |
@@ -9,17 +9,15 @@ import ErrorMessage from 'src/common/constants/errorMessage.enum';
import { CreateOptionalQuoteData, QuoteQueryOptions } from 'src/common/types/quote/quote.type';
import { QuoteToClientProperties } from 'src/common/types/quote/quoteProperties';
import { CreatePlanData } from 'src/common/types/plan/... | TypeScript | service에서는 if 조건문에 hasReview=true인 경우만 필터링하는 것 같은데 false도 필요한 건가요? |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | plan에서 리뷰 유무를 확인하는 prisma 문법이군요! 이전에 유무 체크할 땐 어떻게 했는지 기억이 안나네요 ㅋㅋㅋ 알려주셔서 감사합니다~! |
@@ -2,6 +2,7 @@ import { Injectable } from '@nestjs/common';
import PlanOrder from 'src/common/constants/planOrder.enum';
import { RoleEnum } from 'src/common/constants/role.type';
import SortOrder from 'src/common/constants/sortOrder.enum';
+import { StatusEnum } from 'src/common/constants/status.type';
import { T... | TypeScript | reviewed와 isReqviewQuery로 변경했습니다 |
@@ -9,17 +9,15 @@ import ErrorMessage from 'src/common/constants/errorMessage.enum';
import { CreateOptionalQuoteData, QuoteQueryOptions } from 'src/common/types/quote/quote.type';
import { QuoteToClientProperties } from 'src/common/types/quote/quoteProperties';
import { CreatePlanData } from 'src/common/types/plan/... | TypeScript | hasReview=false인 경우만 필요하지만 하는김에 true도 같이 만들어 뒀습니다 |
@@ -8,7 +8,7 @@ export default class PlanMapper {
toDomain(): IPlan {
if (!this.plan) return null;
- return new Plan({
+ const returnPlan = new Plan({
id: this.plan.id,
createdAt: this.plan.createdAt,
updatedAt: this.plan.updatedAt,
@@ -19,11 +19,19 @@ export default class PlanMappe... | TypeScript | undefined 대신 맵핑방식으로 변경 |
@@ -0,0 +1,25 @@
+package nextstep.security.authentication;
+
+import nextstep.app.util.Base64Convertor;
+import nextstep.security.authentication.exception.AuthenticationException;
+import nextstep.security.user.UsernamePasswordAuthenticationToken;
+import org.springframework.util.StringUtils;
+
+public class Authentic... | Java | Convert의 책임을 분리해주셨군요 👍 |
@@ -0,0 +1,28 @@
+package nextstep.security.authentication;
+
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.exception.AuthenticationException;
+import nextstep.security.authentication.exception.MemberAccessDeniedException;
+
+import java.io.IOException;
+
+public class Authe... | Java | error handle의 책임도 분리해주셨군요 👍 |
@@ -0,0 +1,75 @@
+package nextstep.security.filter;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authe... | Java | OncePerRequestFilter 상속을 잘 해주셨습니다!
OncePerRequestFilter를 활용하신 이유는 무엇인가요? |
@@ -0,0 +1,25 @@
+package nextstep.security.filter;
+
+import jakarta.servlet.http.HttpServletRequest;
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authentication.AuthenticationManager;
+import nextstep.security.context.SecurityContextRepository;
+import nextstep.security.user.User... | Java | 미션을 빠르게 잘 수행해주셔서 추가적으로 고민해볼 수 있는 부분을 드립니다!
실제 시큐리티 코드에서 UsernamePasswordAuthenticationFilter의 경우 AbstractAuthenticationProcessingFilter를 상속받고 있습니다. **시큐리티의 인증 관련 필터를 잘 파악해보기 위한 목적**으로 UserNamePasswordAuthFilter와 AbstractAuthenticationProcessingFilter를 구분해보고 리팩터링 해보면 어떨까요?
함께 고민해보면 좋을 내용으로 실제 시큐리티 코드에서는 BasicAuthe... |
@@ -0,0 +1,75 @@
+package nextstep.security.filter;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authe... | Java | OncePerRequestFilter를 사용하는 이유는 요청 당 한번만 실행하기 위해서입니다.
이 필터에서는 ServeltRequset에 attribute를 설정하는데 hasAlreadyFilteredAttribute 메서드를 통해 요청내 에서 한번 실행했다면 이 필터를 무시합니다.
만약 요청에 속성이 없다면, 실행을 성공적으로 마친 후 요청에 필터이름.FILTERED 속성에 TRUE 값을 설정해줘서 같은 요청내에 다시 실행되지 않게 막아줍니다.
비동기 요청이나 에러처리 부분도 있지만, OncePerRequestFilter를 상속받는 가장 큰 이유는 한번... |
@@ -0,0 +1,25 @@
+package nextstep.security.filter;
+
+import jakarta.servlet.http.HttpServletRequest;
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authentication.AuthenticationManager;
+import nextstep.security.context.SecurityContextRepository;
+import nextstep.security.user.User... | Java | 필터마다 제가 시큐리티 코드를 비교해보면서 이해한 것을 정리하였습니다.
시큐리티의 BasicAuthenticationFilter는 모든 요청당 한번 작동합니다.
모든 요청마다 Request에 authRequest 가 있다면 인증을 진행하고 세션에 결과를 저장시켜주는 역할을 하는 것 같습니다.
만약 요청에 authRequest 가 없거나 작업이 잘 끝난다면 다음 필터로 chain.doFilter(request, response); 체이닝을 해줍니다.
__직접 구현한 필터와 다른 점:__
제가 직접 구현한 필터(BasicAuthenticationFilt... |
@@ -0,0 +1,25 @@
+package nextstep.security.filter;
+
+import jakarta.servlet.http.HttpServletRequest;
+import nextstep.security.authentication.Authentication;
+import nextstep.security.authentication.AuthenticationManager;
+import nextstep.security.context.SecurityContextRepository;
+import nextstep.security.user.User... | Java | 마지막으로 AbstractAuthenticationProcessingFilter의 코드도 조금 살펴보았는데요.
이 객체의 의의는 많은 기능의 추상화가 아닐까 합니다.
제가 만든 UserNamePasswordAuthFilter를 보면 필터링 해야할지 판단해야하는 역할부터 인증 부분 그리고 세션에 저장하거나 에러를 처리하는 등 다양한 기능을 제공하고 어떤 것은 반복되는 코드들 같아요.
시큐리티에서 AbstractAuthenticationProcessingFilter와 UserNamePasswordAuthFilter로 나눈 것은
UserNamePasswo... |
@@ -0,0 +1,77 @@
+package nextstep.security.filter;
+
+import jakarta.servlet.FilterChain;
+import jakarta.servlet.ServletException;
+import jakarta.servlet.ServletRequest;
+import jakarta.servlet.ServletResponse;
+import jakarta.servlet.http.HttpServletRequest;
+import jakarta.servlet.http.HttpServletResponse;
+import... | Java | 인증 공통 로직 추상화 👍 |
@@ -0,0 +1,91 @@
+package christmas.Controller;
+
+import christmas.Domain.EventBenefitSettler;
+import christmas.Domain.EventPlanner;
+import christmas.Event.EventBadge;
+import christmas.View.InputView;
+import christmas.View.OutputView;
+import java.util.Map;
+
+public class EventController {
+ public EventPlanne... | Java | ```suggestion
public void takeVisitDate() {
try {
String visitDate = InputView.readVisitDate();
eventBenefitSettler = new EventBenefitSettler(visitDate);
} catch (IllegalArgumentException e) {
OutputView.printException(e);
takeVisitDate();
... |
@@ -0,0 +1,92 @@
+package christmas.Util;
+
+import static christmas.Event.EventOption.EVENT_END_DATE;
+import static christmas.Event.EventOption.EVENT_START_DATE;
+import static christmas.Event.EventOption.MAX_ORDER_QUANTITY;
+import static christmas.Message.OutputMessage.NOT_A_VALID_DATE;
+
+import christmas.Domain.M... | Java | 정규표현식을 정말 잘 활용하시는군요!👍👍
그런데 `(?:,|$)` 는 어떤 역할을 하는지 궁금합니다! |
@@ -0,0 +1,92 @@
+package christmas.Util;
+
+import static christmas.Event.EventOption.EVENT_END_DATE;
+import static christmas.Event.EventOption.EVENT_START_DATE;
+import static christmas.Event.EventOption.MAX_ORDER_QUANTITY;
+import static christmas.Message.OutputMessage.NOT_A_VALID_DATE;
+
+import christmas.Domain.M... | Java | `isDrinkMenu` 는 `MenuBoard` 에게 넘겨주면 어떨까요??
음료를 확인하는 책임은 `MenuBoard` 가 가지고 있는게 더 어울릴 것 같아요! 😁 |
@@ -0,0 +1,92 @@
+package christmas.Util;
+
+import static christmas.Event.EventOption.EVENT_END_DATE;
+import static christmas.Event.EventOption.EVENT_START_DATE;
+import static christmas.Event.EventOption.MAX_ORDER_QUANTITY;
+import static christmas.Message.OutputMessage.NOT_A_VALID_DATE;
+
+import christmas.Domain.M... | Java | 해당 정규표현식이 반복되는 것 같아요! 그렇다면 Pattern 객체를 캐싱해주면 어떨까요??
디스코드 함께 나누기에 현지님이[ 공유하신 글](https://velog.io/@dlguswl936/%EA%B3%B5%EB%B6%80%ED%95%9C-%EA%B2%83-String.matches%EB%8A%94-%EC%99%9C-%EC%84%B1%EB%8A%A5%EC%97%90-%EC%95%88-%EC%A2%8B%EC%9D%84%EA%B9%8C#%EA%B2%B0%EB%A1%A0-pattern-%EA%B0%9D%EC%B2%B4%EB%A5%BC-%EC%BA%90%EC%8B%B1... |
@@ -0,0 +1,30 @@
+package christmas.Util;
+
+public class CommaFormatter {
+ public static String formatWithComma(int number) {
+ String numberStr = Integer.toString(number);
+ int length = numberStr.length();
+
+ if (length <= 3) {
+ return numberStr;
+ }
+ String resul... | Java | 콤마를 위해 전용 객체를 만들어주셨군요! 직접 만들어주는 것도 좋네요!
그런데 돈 단위를 위한 콤마를 넣어주는 기능을 자바에서 제공하고 있답니다! ㅎㅎ
DecimalFormat 에 대해서 알아보시면 좋을 것 같아요! 제가 [참고했던 글](https://jamesdreaming.tistory.com/203)을 공유합니다! |
@@ -0,0 +1,67 @@
+package christmas.Domain;
+
+import christmas.Util.OrderMenuValidator;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class EventPlanner {
+ private final List<Menu> o... | Java | ```suggestion
public Map<String, Integer> calculateCategoryCount() {
Map<String, Integer> categoryCount = new HashMap<>();
int count = 0;
for (Menu menu : orderMenu) {
String menuCategory = menu.getMenuCategory();
categoryCount.put(menuCategory, categoryCount.ge... |
@@ -0,0 +1,102 @@
+package christmas.Domain;
+
+import christmas.Event.EventBenefit;
+import christmas.Event.EventOption;
+import christmas.Event.SpecialDiscountDay;
+import christmas.Util.OrderMenuValidator;
+import java.time.DayOfWeek;
+import java.time.LocalDate;
+import java.util.HashMap;
+import java.util.Map;
+
+... | Java | `LocalDate` 를 활용하면 요일을 파악할 수 있군요! 배워갑니다! 😁 |
@@ -1,23 +1,20 @@
<template>
- <button
- @click="
- () => {
- if (!props.disabled) props.onClick();
- }
- "
- :class="getNextButtonStyle()"
- >
- <slot></slot>
+ <button @click="handleNextButtonClick" :class="getNextButtonStyle()">
+ <slot />
</button>
</template>
<script setu... | Unknown | 단순 궁금증으로 질문드립니다.
undefined를 타입으로 지정하신 이유가 있을까요?
NextButton.vue의 부모 컴포넌트에서 isPrimary 값을 부여하지 않을 때가 있어 undefined를 포함한 것으로 보이는데,
이 경우는 ? 만으로도 충분히 표현이 된 것 같습니다.
특히 boolean이기때문에 undefined일 때 falsy하게 인식이 될 것 같은데
추가하신 이유가 궁금합니다~ |
@@ -3,8 +3,8 @@
<p class="text-medium font-semi_bold">{{ title }}</p>
<div class="flex gap-x-3">
<button
- v-for="size in sizes"
- :key="size.id"
+ v-for="(size, index) in sizes"
+ :key="getButtonKey(size, index)"
class="flex flex-col items-center justify-between ga... | Unknown | storeToRefs 를 사용해서 반응성을 살리셨네요 👍 |
@@ -3,16 +3,12 @@
<section
class="mx-auto flex h-full flex-col items-center justify-between bg-gray_00-light text-gray_05-light dark:bg-gray_00-dark dark:text-gray_05-dark sm:w-screen md:w-96"
>
- <ProgressNavBar prevPage="/size" pageName="ingredient" />
- <div v-if="isLoading">로딩중입니다.</div>
... | Unknown | 서버 상태관리와 클라이언트 상태관리를 분리하여 관리하셨군요 👍 |
@@ -1,23 +1,20 @@
<template>
- <button
- @click="
- () => {
- if (!props.disabled) props.onClick();
- }
- "
- :class="getNextButtonStyle()"
- >
- <slot></slot>
+ <button @click="handleNextButtonClick" :class="getNextButtonStyle()">
+ <slot />
</button>
</template>
<script setu... | Unknown | 사실 저도 추가하지 않았다가, 좀더 가시적으로 표현하려고 작성을 했어요! 음, 메이브님 말씀듣고 다시 생각해보니 가시성만으로 추가하는 건 좀 의미가 없는 것 같긴하네요!! |
@@ -3,20 +3,18 @@
class="text-gray_05-light dark:text-gray_05-dark w-6 h-6"
@click="goBack"
>
- <slot></slot>
+ <slot />
</button>
</template>
<script setup lang="ts">
-import { useRouter } from 'vue-router';
+import { pushPage } from '@router/route.helper';
const props = defineProps<{
p... | Unknown | 화살표 함수로 해주세요~ |
@@ -2,6 +2,8 @@
import React, { useState } from "react";
+// 테스트
+
export interface ButtonProps {
label: string;
onClick: () => void; | Unknown | 코드를 살펴보았습니다. 여기 몇 가지 코멘트를 드리겠습니다.
1. **주석 사용**: 추가한 `// 테스트` 주석은 의미가 불분명합니다. 주석은 코드의 의도를 명확히 하는 데 도움이 되어야 하므로, 왜 테스트 주석이 필요한지 구체적으로 설명하는 것이 좋습니다. 예를 들어, `// 버튼 테스트를 위해 추가된 주석`과 같이 작성하면 좋습니다.
2. **타입 정의**: `ButtonProps` 인터페이스는 잘 정의되어 있습니다. 하지만 사용되는 컴포넌트가 실제로 있는 경우 이를 추가적으로 보여주면 코드가 더욱 완전해질 수 있습니다. 예를 들어, `Button` 컴포넌트... |
@@ -1,8 +1,79 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import './Login.scss';
class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: '',
+ pw: '',
+ };
+ }
+
+ handleInput = event => {
+ const { name, value } = ev... | JavaScript | 오 구조분해 할당~ |
@@ -1,8 +1,79 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import './Login.scss';
class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: '',
+ pw: '',
+ };
+ }
+
+ handleInput = event => {
+ const { name, value } = ev... | JavaScript | this.state.id.includes('@') &&
this.state.id.length >= 5 &&
this.state.pw.length >= 8 이걸 true/false Boolean?? 이값을 사용해서 삼항연산자로 해도 되지 않을까요 수정님은 잘하시니 아마가능하실듯! |
@@ -0,0 +1,61 @@
+.Login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+
+ main {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
+ width: 350px;
+ height: 380px;
+ padding: 40px;
+ border: 1px solid #ccc;
+
+ header {
+ ... | Unknown | 이건 왜 주석으로 되있나요??? |
@@ -0,0 +1,134 @@
+[
+ {
+ "id": 1,
+ "userName": "eessoo__",
+ "src": "../images/soojeongLee/user2.jpg",
+ "feedText": "💟",
+ "commentData": [
+ {
+ "id": 1,
+ "userName": "wecode",
+ "content": "Welcome to world best coding bootcamp!",
+ "commnetLike": false
+ },... | Unknown | 제이슨 파일도 있었군요! |
@@ -0,0 +1,175 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import Comment from './Comment/Comment';
+
+import '../Feed/Feed.scss';
+
+export class Feed extends Component {
+ constructor() {
+ super();
+ this.state = {
+ comment: '',
+ // commentList: [],
+... | JavaScript | 오 이렇게 다시 볼 수 있는 방법도 나쁘지 않은 듯 ?
나중에 가서는 지워야 될 수도 있지만...? |
@@ -0,0 +1,175 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import Comment from './Comment/Comment';
+
+import '../Feed/Feed.scss';
+
+export class Feed extends Component {
+ constructor() {
+ super();
+ this.state = {
+ comment: '',
+ // commentList: [],
+... | JavaScript | 버튼으로 한 이유가 있나요? 궁금 |
@@ -0,0 +1,175 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import Comment from './Comment/Comment';
+
+import '../Feed/Feed.scss';
+
+export class Feed extends Component {
+ constructor() {
+ super();
+ this.state = {
+ comment: '',
+ // commentList: [],
+... | JavaScript | autoComplete 이거는 뭔가요? 궁금~ |
@@ -0,0 +1,128 @@
+@import '../../../../styles/variables.scss';
+
+article {
+ margin-bottom: 20px;
+ background-color: #fff;
+ border-radius: 3px;
+ border: 1px solid $border-color;
+
+ header {
+ @include flex-center;
+ justify-content: space-between;
+ align-content: center;
+ padding: 10px;
+
+ ... | Unknown | 이런 scss 기능 저는 헷갈려서 잘 못하겠던데 잘하시네요.. |
@@ -0,0 +1,23 @@
+//라이브러리
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+//컴포넌트
+import { FOOTLIST } from '../FootLists/footData';
+
+// css
+import './FootLists.scss';
+
+export class FootLists extends Component {
+ render() {
+ return FOOTLIST.map(footlists => {
+ ret... | JavaScript | 댓글 프랍스! |
@@ -0,0 +1,46 @@
+export const FOOTLIST = [
+ {
+ id: 1,
+ footlist: '소개',
+ },
+ {
+ id: 2,
+ footlist: '도움말',
+ },
+ {
+ id: 3,
+ footlist: '홍보 센터',
+ },
+ {
+ id: 4,
+ footlist: 'API',
+ },
+ {
+ id: 5,
+ footlist: '채용 정보',
+ },
+ {
+ id: 6,
+ footlist: '개인정보처리방침',
+ }... | JavaScript | 화이팅 푸터 만들어서 강의 부탁드려요 |
@@ -1,14 +1,148 @@
-// 필수
import React from 'react';
+import { Link } from 'react-router-dom';
-// 컴포넌트
import Nav from '../../../components/Nav/Nav';
+import Feed from '../Main/Feed/Feed';
+import OtherUserPro from './OtherUserPro/OtherUserPro';
+import FootLists from '../Main/Feed/FootLists/FootLists';
+
+import ... | JavaScript | 데이터 확인 다 하셨나요~~? |
@@ -1,14 +1,148 @@
-// 필수
import React from 'react';
+import { Link } from 'react-router-dom';
-// 컴포넌트
import Nav from '../../../components/Nav/Nav';
+import Feed from '../Main/Feed/Feed';
+import OtherUserPro from './OtherUserPro/OtherUserPro';
+import FootLists from '../Main/Feed/FootLists/FootLists';
+
+import ... | JavaScript | 피어 리뷰 중 Return의 비밀을? 감사합니다. |
@@ -1,8 +1,79 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import './Login.scss';
class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: '',
+ pw: '',
+ };
+ }
+
+ handleInput = event => {
+ const { name, value } = ev... | JavaScript | Boolean 데이터 타입 적용시켜보았아요. 잘 세웠던 코드가 작동되지 않을까 시도하기 어려웠는데 격려 감사합니당~ |
@@ -0,0 +1,61 @@
+.Login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+
+ main {
+ display: flex;
+ flex-direction: column;
+ justify-content: space-around;
+ width: 350px;
+ height: 380px;
+ padding: 40px;
+ border: 1px solid #ccc;
+
+ header {
+ ... | Unknown | 기존 html 코드를 옮기다 보니 발생한 문제였어요 :) 해결되었답니당 !! |
@@ -0,0 +1,134 @@
+[
+ {
+ "id": 1,
+ "userName": "eessoo__",
+ "src": "../images/soojeongLee/user2.jpg",
+ "feedText": "💟",
+ "commentData": [
+ {
+ "id": 1,
+ "userName": "wecode",
+ "content": "Welcome to world best coding bootcamp!",
+ "commnetLike": false
+ },... | Unknown | fetching 을 연습해보려고 만들어보았어요 |
@@ -0,0 +1,175 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import Comment from './Comment/Comment';
+
+import '../Feed/Feed.scss';
+
+export class Feed extends Component {
+ constructor() {
+ super();
+ this.state = {
+ comment: '',
+ // commentList: [],
+... | JavaScript | 인스타그램에서 실제 좋아요를 좋아한 숫자에 접근하게 되면 누가 좋아요를 눌렀는지 목록을 볼 수 있어서, 추후에 기능을 넣게 된다면 button을 넣어야 하지 않을까 생각이 들어서 넣어봤습니다. |
@@ -0,0 +1,23 @@
+//라이브러리
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+//컴포넌트
+import { FOOTLIST } from '../FootLists/footData';
+
+// css
+import './FootLists.scss';
+
+export class FootLists extends Component {
+ render() {
+ return FOOTLIST.map(footlists => {
+ ret... | JavaScript | 꼭 풋 리스트를... 컴포넌트화해보겠어요...!!!! |
@@ -1,14 +1,148 @@
-// 필수
import React from 'react';
+import { Link } from 'react-router-dom';
-// 컴포넌트
import Nav from '../../../components/Nav/Nav';
+import Feed from '../Main/Feed/Feed';
+import OtherUserPro from './OtherUserPro/OtherUserPro';
+import FootLists from '../Main/Feed/FootLists/FootLists';
+
+import ... | JavaScript | 네..! 무엇이 어디에 전달되었는지 확인하기가 어려워서 넣어뒀어요 ...! |
@@ -1,14 +1,148 @@
-// 필수
import React from 'react';
+import { Link } from 'react-router-dom';
-// 컴포넌트
import Nav from '../../../components/Nav/Nav';
+import Feed from '../Main/Feed/Feed';
+import OtherUserPro from './OtherUserPro/OtherUserPro';
+import FootLists from '../Main/Feed/FootLists/FootLists';
+
+import ... | JavaScript | ㅎㅎㅎ Return 은 생략될 수 있다 ~ |
@@ -1,8 +1,79 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import './Login.scss';
class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: '',
+ pw: '',
+ };
+ }
+
+ handleInput = event => {
+ const { name, value } = ev... | JavaScript | 계산된속성명 굿 |
@@ -0,0 +1,175 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import Comment from './Comment/Comment';
+
+import '../Feed/Feed.scss';
+
+export class Feed extends Component {
+ constructor() {
+ super();
+ this.state = {
+ comment: '',
+ // commentList: [],
+... | JavaScript | 오.... |
@@ -0,0 +1,175 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import Comment from './Comment/Comment';
+
+import '../Feed/Feed.scss';
+
+export class Feed extends Component {
+ constructor() {
+ super();
+ this.state = {
+ comment: '',
+ // commentList: [],
+... | JavaScript | 이런방법이.. 피드마다 댓글 데이터를 스테이트로 포함하게 해주니 보기 쉽고 좋네요 |
@@ -1,8 +1,79 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import './Login.scss';
class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: '',
+ pw: '',
+ };
+ }
+
+ handleInput = event => {
+ const { name, value } = ev... | JavaScript | 이런 주석들은 불필요하니까 삭제해주시는게 좋아보입니다! |
@@ -1,8 +1,79 @@
import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+
+import './Login.scss';
class Login extends Component {
+ constructor() {
+ super();
+ this.state = {
+ id: '',
+ pw: '',
+ };
+ }
+
+ handleInput = event => {
+ const { name, value } = ev... | JavaScript | event.target 반복되고 있는데 구조분해해서 활용해볼 수 있겠네요!
```const {name,value} = event.target;``` |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.