code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,102 @@
+import Foundation
+import RxSwift
+
+enum NetworkError: Error, LocalizedError {
+ case statusCodeError
+ case unknownError
+ case urlIsNil
+
+ var errorDescription: String? {
+ switch self {
+ case .statusCodeError:
+ return "์ ์์ ์ธ StatusCode๊ฐ ์๋๋๋ค."
+ c... | Swift | NetworkProvider().request(api: api) ์ ๋ชจ์์ด ๋์ฌ ๊ฒ ๊ฐ์๋ฐ์.
๋งค ์ผ์ด์ค๋ง๋ค ๋ค๋ฅธ NetworkProvider๊ฐ ํ์ํด ๋ณด์ด์ง๋ ์๊ณ ์.
NetworkProvider ๋ฅผ ๋งค๋ฒ ์ป์ด์์ผ ํ๋๊ฒ ๋ฒ๊ฑฐ๋ก์๋ณด์ฌ์.
api.execute()๋ ์ด๋จ๊น์. excute ์์ NetworkProvider์ ๋ก์ง์ ๋ด๋๊ฑฐ์ฃ .
์๋ก ๋ค๋ฅธ provider๊ฐ ํ์ํ๋ค๋ฉด, APIProtocol ๋ด๋ถ์ ๋ช
์ํ๋ ์์ผ๋ก ํด๊ฒฐํ๋ฉด ๋ ๊ฒ ๊ฐ๊ณ ์. |
@@ -0,0 +1,102 @@
+import Foundation
+import RxSwift
+
+enum NetworkError: Error, LocalizedError {
+ case statusCodeError
+ case unknownError
+ case urlIsNil
+
+ var errorDescription: String? {
+ switch self {
+ case .statusCodeError:
+ return "์ ์์ ์ธ StatusCode๊ฐ ์๋๋๋ค."
+ c... | Swift | Observable.create ๊ฐ ํ์ํ์ง ์์๋ณด์
๋๋ค. |
@@ -0,0 +1,52 @@
+import Foundation
+
+struct OpenMarketBaseURL: BaseURLProtocol {
+ var baseURL = "https://market-training.yagom-academy.kr/"
+}
+
+struct HealthCheckerAPI: Gettable {
+ var url: URL?
+ var method: HttpMethod = .get
+
+ init(baseURL: BaseURLProtocol = OpenMarketBaseURL()) {
+ sel... | Swift | var / let ํ์ธ ๋ฐ๋๋๋ค. |
@@ -0,0 +1,37 @@
+import UIKit
+
+struct FlowCoordinator {
+ // MARK: - Properties
+ weak private var navigationController: UINavigationController?
+ private var productListViewController: ProductListViewController!
+ private var productListViewModel: ProductListViewModel!
+ private var menuSegmentedCont... | Swift | class type์ property๋ก ๋ค๊ณ ์์ผ๋, struct๋ณด๋ค๋ class๊ฐ ์ด์ธ๋ ค๋ณด์
๋๋ค. |
@@ -0,0 +1,37 @@
+import UIKit
+
+struct FlowCoordinator {
+ // MARK: - Properties
+ weak private var navigationController: UINavigationController?
+ private var productListViewController: ProductListViewController!
+ private var productListViewModel: ProductListViewModel!
+ private var menuSegmentedCont... | Swift | !๋ ์ฐ์ง ์๋๊ฑธ๋ก ํด์. |
@@ -0,0 +1,37 @@
+import UIKit
+
+struct FlowCoordinator {
+ // MARK: - Properties
+ weak private var navigationController: UINavigationController?
+ private var productListViewController: ProductListViewController!
+ private var productListViewModel: ProductListViewModel!
+ private var menuSegmentedCont... | Swift | FlowCoordinator ๊ฐ ๋ค๋ฅด๊ฒ ๋งํ๋ฉด AppLevel์ Coordinator๋ก ์ดํด๋๋๋ฐ์. ProductList์ ๋ก์ง๊ณผ ์์กด์ฑ์ด ์ปค์ ProductList ์ ์ฉ Coordinator ์ฒ๋ผ ๋ณด์
๋๋ค. ์ ๋ผ๋ฉด ProductListCoordinator ์ ๋๋ฅผ ๋ง๋ค์ด์ ProductList ๋ก์ง์ ๋ชจ๋ํํ๊ณ ์. FlowCoordinator์ rootCoordinator๋ฅผ ProductListCoordinator ๋ก ๋์ด์ FlowCoordinator์ ProductListCoordinator์ ๊ด๊ณ๋ฅผ ๋ถ๋ฆฌํ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,46 @@
+import UIKit
+
+class ProductDetailImageCell: UICollectionViewCell {
+ // MARK: - Properties
+ private let productImageView: UIImageView = {
+ let imageView = UIImageView()
+ imageView.translatesAutoresizingMaskIntoConstraints = false
+ imageView.contentMode = .scaleAspectFi... | Swift | ์ด ๊ฒฝ์ฐ init์ param์ด ์์ผ๋ฏ๋ก, init coder ์ด๋ ค๋ ๋ ๊ฒ ๊ฐ์์.
required init?(coder: NSCoder) {
super.init(coder: coder)
configureUI()
} |
@@ -0,0 +1,57 @@
+import Foundation
+import RxSwift
+import UIKit
+
+class ProductDetailViewModel {
+ // MARK: - Nested Types
+ struct Input {
+ let invokedViewDidLoad: Observable<Void>
+ let cellDidScroll: Observable<IndexPath>
+ }
+
+ struct Output {
+ let product: Observable<Deta... | Swift | inputObserver ์ fetchProduct ๋ฅผ flatMap์ผ๋ก ์ฎ์ด์ product observer๋ฅผ ๋ง๋ค ์ ์์ ๊ฒ ๊ฐ๋ค์. ๊ณ ๋ฏผํด๋ด์ฃผ์ธ์. subscribe๋ ๊ผญ ํ์ํ ์์น์๋ง ํด์ฃผ์ธ์. |
@@ -0,0 +1,57 @@
+import Foundation
+import RxSwift
+import UIKit
+
+class ProductDetailViewModel {
+ // MARK: - Nested Types
+ struct Input {
+ let invokedViewDidLoad: Observable<Void>
+ let cellDidScroll: Observable<IndexPath>
+ }
+
+ struct Output {
+ let product: Observable<Deta... | Swift | output ํ๋ผ๋ฏธํฐ๊ฐ ๋ง์ด ๋ณด์ด๋๋ฐ์. ๋ง์น inout ํค์๋์ ๋น์ทํ ๊ธฐ๋ฅ์ ํ๋ ๊ฒ์ผ๋ก ์ข์ ์ฝ๋๋ก ๋ณด์ด์ง ์์ต๋๋ค. output์ ํ๊ณ ์ถ๋ค๋ฉด return type์ ์ฐ๋ฉด ๋ฉ๋๋ค. |
@@ -0,0 +1,53 @@
+import UIKit
+
+final class BannerCell: UICollectionViewCell {
+ // MARK: - Properties
+ private let stackView: UIStackView = {
+ let stackView = UIStackView()
+ stackView.style(axis: .vertical, alignment: .fill, distribution: .fill)
+ return stackView
+ }()
+ private ... | Swift | reusable cell์ storable property๋ฅผ ๋ค๊ณ ์์ ์ด์ ๊ฐ ๊ฑฐ์ ์์ต๋๋ค.
cell์ UI ๊ป๋ฐ๊ธฐ ์ผ ๋ฟ์ด์ง, ํน์ ๋ฐ์ดํฐ๋ฅผ ๋ํํ ์ ์์ต๋๋ค.
apply์ชฝ์๋ UI ์ธํ
์ ์ํ ViewModel ๋ง ์ ๋ฌ ํ๋ฉด ๋๊ณ ์.
์ด cell์ด ์ด๋ค productID๋ก ๊ตฌ์ฑ๋์๋์ง ๊ถ๊ธํ๋ค๋ฉด, cell์ indexPath๋ฅผ ์ด์ฉํด์ ์ง์ ์ป์ด๋ด๋ฉด ๋ฉ๋๋ค. |
@@ -0,0 +1,53 @@
+import UIKit
+import RxSwift
+import RxCocoa
+
+final class FooterView: UICollectionReusableView {
+ // MARK: - Properties
+ private let bannerPageControl: UIPageControl = {
+ let pageControl = UIPageControl()
+ pageControl.translatesAutoresizingMaskIntoConstraints = false
+ ... | Swift | bind๊ฐ N๋ฒ ํธ์ถ๋์์ ๋ subscribe๊ฐ N๋ฒ ๋ ๊ฐ๋ฅ์ฑ์ ์์์ง ๊ฒํ ๋ฐ๋๋๋ค. |
@@ -0,0 +1,176 @@
+import UIKit
+
+final class GridListCell: UICollectionViewCell {
+ // MARK: - Nested Types
+ private enum Design {
+ static let nameLabelTextColor: UIColor = .black
+ static let stockLabelTextColor: UIColor = .systemOrange
+ static let priceLabelTextColor: UIColor = .system... | Swift | ์ ๋ Design์ ํ์ผ ์ต ํ๋จ์ผ๋ก ๋บด๊ณ ์์ต๋๋ค.
ํ ๋ฒ ์์ฑ๋๋ฉด ๋ณผ ์ผ์ด ๊ฑฐ์ ์๋ ์ฝ๋๋ผ์์. |
@@ -0,0 +1,22 @@
+import UIKit
+
+extension UIStackView {
+ func style(axis: NSLayoutConstraint.Axis,
+ alignment: UIStackView.Alignment,
+ distribution: UIStackView.Distribution,
+ spacing: CGFloat = .zero) {
+ self.translatesAutoresizingMaskIntoConstraints = false
+... | Swift | ์ด๋ถ๋ถ์ ํ๋กํผํฐ๋ฅผ ํด๋ก์ ๋ก ์์ฑํ๋ ๋ถ๋ถ์์ ๋ฐ๋ณต๋๋ ๋ถ๋ถ์ด ๋ง์ ๋ฉ์๋๋ฅผ ํตํด ํ๋กํผํฐ๋ฅผ setํ ์ ์๋๋ก ํ์ต๋๋ค!! |
@@ -0,0 +1,24 @@
+import UIKit
+
+extension UIImageView {
+ func loadImage(of key: String) {
+ let cacheKey = NSString(string: key)
+ if let cachedImage = ImageCacheManager.shared.object(forKey: cacheKey) {
+ self.image = cachedImage
+ return
+ }
+
+ Dispatch... | Swift | ๋ง์ํด์ฃผ์ ๋๋ก ๋ฉ์๋์ด๋ฆ๋ง ๋ด์๋ Cache ๊ธฐ๋ฅ์ ๋ดํฌํ๋ ๊ฒ์ ์ ์ ์์ด์ loadCachedImage(of key: String)๋ก ์์ ํ์ต๋๋ค! |
@@ -0,0 +1,120 @@
+import UIKit
+
+struct MultipartFormData {
+ private(set) var boundary: String
+ let contentType: String
+ private(set) var body: Data = Data()
+
+ init(uuid: String = UUID().uuidString) {
+ self.boundary = "Boundary-\(uuid)"
+ self.contentType = "multipart/form-data; bo... | Swift | createFormData์ createImageFormData ๋ชจ๋ create๋ก ๋ฉ์๋ ์ด๋ฆ์ ๋ณ๊ฒฝํ๊ณ , ๋งค๊ฐ๋ณ์๋ฅผ ํตํด ๊ตฌ๋ถํ ์ ์๋๋ก ํ์ต๋๋ค. ํ์ฌ ํ๋ก์ ํธ์์ Postํ๋ ํ์
์ด product ๋ฐ์ ์์ผ๋ฏ๋ก item์ product๋ผ๋ ์ด๋ฆ์ผ๋ก ๊ตฌ์ฒดํ์์ผฐ์ต๋๋ค. |
@@ -0,0 +1,52 @@
+import Foundation
+
+struct OpenMarketBaseURL: BaseURLProtocol {
+ var baseURL = "https://market-training.yagom-academy.kr/"
+}
+
+struct HealthCheckerAPI: Gettable {
+ var url: URL?
+ var method: HttpMethod = .get
+
+ init(baseURL: BaseURLProtocol = OpenMarketBaseURL()) {
+ sel... | Swift | ๋ชจ๋ initializer์์ ์ง์ ํ๋ ํ๋กํผํฐ๋ผ์ let์ผ๋ก ๋ณ๊ฒฝํ์ต๋๋ค. |
@@ -0,0 +1,22 @@
+package kr.wooco.woocobe.placereview.adapter.out.presistence.entity
+
+import jakarta.persistence.Column
+import jakarta.persistence.Entity
+import jakarta.persistence.Id
+import jakarta.persistence.Table
+import kr.wooco.woocobe.common.infrastructure.storage.Tsid
+import kr.wooco.woocobe.common.infra... | Kotlin | `place_Review_id` -> `place_review_id` ๋๋ฌธ์ ์์ ์ฃผ์ธ์ |
@@ -1,3 +1,5 @@
-import date from './date.svg';
-export * from './Eyes';
+import date from "./date.svg";
+export * from "./Eyes";
export { date };
+import Logo from "./Logo.svg";
+export { Logo }; | TypeScript | svg๋ import logo from './logo.svg'; export {logo}; ์ด๋ฐ ์์ผ๋ก ํด์ฃผ์ด์ผํ ํ
๋ฐ ์ง๊ธ ์ ์ ์๋ํ์๋์?
๊ทธ๋ฆฌ๊ณ ์ด๋ฏธ์ง๋ ์๋ฌธ์๋ก ๋ค์ด๋ฐํ๋ ๊ฒ์ด ์ข์ต๋๋ค. |
@@ -0,0 +1,65 @@
+import styled from "styled-components";
+import { Logo } from "../../assets";
+import { useState } from "react";
+import { LoginBtn } from "../header/LoginBtn";
+import { font } from "../../theme";
+
+export const Header = () => {
+ const [isLogined, setIsLogined] = useState<boolean>(false);
+
+ ret... | Unknown | ์ด๊ฑด ์ ์ด๋ ๊ฒ ๋ถ๋ฌ์ค์๋์ฉ |
@@ -37,6 +37,8 @@ public PageReviewRes<ReviewRes> getPagedReviewsByTemplestayId(Long templestayId,
throw new TemplestayCoreException(ErrorCode.REVIEW_NOT_FOUND);
}
+ Long count = reviewRepository.countByTempleName(templeName);
+
List<ReviewRes> reviewDtos = reviews.getContent().s... | Java | ๋ฆฌ๋ทฐ ์ ์ฒด ๊ฐ์๋ฅผ ๋ฐํํ์ฌ ํ๋ก ํธ์์ ํ์ด์ง ์ฒ๋ฆฌ์ ๋์์ ๋ฐ์ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค! ๊ตฟ |
@@ -0,0 +1,23 @@
+package kdt.prgrms.kazedon.everevent.common;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import kdt.prgrms.kazedon.everevent.domain.user.UserType;
+import org.springframework.security.test.context.support.WithSecurityContext;
+
+@Retention(RetentionPolicy.R... | Java | Long ์ผ๋ก ํ๋๊ฒ ๋ ์ข์๋ณด์ด๋ค์ :) |
@@ -0,0 +1,23 @@
+package kdt.prgrms.kazedon.everevent.common;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import kdt.prgrms.kazedon.everevent.domain.user.UserType;
+import org.springframework.security.test.context.support.WithSecurityContext;
+
+@Retention(RetentionPolicy.R... | Java | ์ ๊ทธ๋ฌ๋ค์! ๊ฐ์ฌํจ๋๋น ๐๐ |
@@ -0,0 +1,185 @@
+package kdt.prgrms.kazedon.everevent.domain.like;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.time.LocalDateTime;
+import java.util.Optional;
+import kdt.prgrms.kazedon.everevent.domain.event.Event;
+import kdt.prgrms.kazedon.everevent.domain.event.repository.EventRepo... | Java | ์๋์ ๊ฒ์ฆํ๋๊น ์ด๊ฑด ๊ด์ฐฎ์ง ์์๊น์? |
@@ -0,0 +1,164 @@
+package kdt.prgrms.kazedon.everevent.domain.review;
+
+import static org.assertj.core.api.Assertions.*;
+
+import java.time.LocalDateTime;
+import kdt.prgrms.kazedon.everevent.domain.event.Event;
+import kdt.prgrms.kazedon.everevent.domain.event.repository.EventRepository;
+import kdt.prgrms.kazedon.... | Java | assertAll()์ ํ๋ฒ ์จ๋ณด๋ฉด ์ข์๊ฑฐ ๊ฐ๋ค์ :) |
@@ -0,0 +1,197 @@
+package kdt.prgrms.kazedon.everevent.service;
+
+import static org.assertj.core.api.Assertions.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.willDoNothing;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import java.time.... | Java | ํ๋ก์ ํธ๊ฐ ๊ฑฐ๋ํด์ง๋ฉด์ ํ
์คํธ์ ๋ํด์ ์ค๋ณต์ฝ๋๊ฐ ๊ต์ฅํ ๋ง์ ์ง์ฃ :)
TestFixture๋ผ๋๊ฑธ ํ๋ฒ ์ ์ฉํด๋ณด๋ฉด ์ด๋ ์ ๊ฐ์? |
@@ -0,0 +1,197 @@
+package kdt.prgrms.kazedon.everevent.service;
+
+import static org.assertj.core.api.Assertions.*;
+import static org.mockito.BDDMockito.given;
+import static org.mockito.BDDMockito.willDoNothing;
+import static org.mockito.Mockito.times;
+import static org.mockito.Mockito.verify;
+
+import java.time.... | Java | ์ค ํ๋ฒ ์ ์ฉํด๋ณด๊ฒ ์ต๋๋ค!! Fixture ํด๋์ค์ static ๋ณ์๋ก ๊ฐ์ฒด ์์ฑํด๋๊ณ ์ฌ์ฉํ๋ฉด ์ฝ๋๊ฐ ๋ง์ด ๊น๋ํด์ง๊ฒ ๋ค์ฉ ๐ธ |
@@ -0,0 +1,164 @@
+package kdt.prgrms.kazedon.everevent.domain.review;
+
+import static org.assertj.core.api.Assertions.*;
+
+import java.time.LocalDateTime;
+import kdt.prgrms.kazedon.everevent.domain.event.Event;
+import kdt.prgrms.kazedon.everevent.domain.event.repository.EventRepository;
+import kdt.prgrms.kazedon.... | Java | ๋ต! |
@@ -0,0 +1,185 @@
+package kdt.prgrms.kazedon.everevent.domain.like;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.time.LocalDateTime;
+import java.util.Optional;
+import kdt.prgrms.kazedon.everevent.domain.event.Event;
+import kdt.prgrms.kazedon.everevent.domain.event.repository.EventRepo... | Java | ๊ทธ๋ฌ๋ค์ฌ..ใ
์ญ์ ํด๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์จ๋ค |
@@ -1,2 +1,219 @@
-.MainKang {
+@mixin center {
+ display: flex;
+ justify-content: center;
+}
+
+@mixin middle {
+ display: flex;
+ flex-direction: column;
+}
+
+@mixin boxes {
+ width: 100%;
+ margin: 5px auto;
+ border: 1px solid rgb(220, 219, 219);
+ background-color: white;
+}
+
+.entire-area {
+ @include... | Unknown | ๋ค๋ฅธ ๋ถ๋ถ์์๋ ์ ํด์ฃผ์
จ๋๋ฐ, ์ ํ์ ๊ฐ์๋ ํ ์ค ๋์์ฃผ์ธ์!
๊ทธ๋ฆฌ๊ณ `id` ์ ํ์๋ณด๋ค๋, `className` ์ ํ์ฉํด์ฃผ์๊ธฐ ๋ฐ๋๋๋ค. ์ด์ ๋ ๋ค์๊ณผ ๊ฐ์ต๋๋ค.
- HTML์์ `id` ๋ ๋ฌธ์ ๋ด์์ ์ ์ผํด์ผ ํฉ๋๋ค. ์ด๋ฌํ ์ด์ ๋ก ๋จ์ผ ์์๋ฅผ ๋ค๋ฃจ๋ ๊ฒฝ์ฐ `id`๋ฅผ ์ฌ์ฉํ ์ ์์ต๋๋ค.
- ํ์ง๋งย ์ ๋ง๋ก ํด๋น ์์์ ๋ํ ์ด๋ฒคํธ๋ ์คํ์ผ ํธ๋ค๋ง์ด ํ๋ก์ ํธ ์ ์ฒด์์ ๋จ ํ๋ฒ๋ง ์ฌ์ฉ ๋๋์งย ์ถฉ๋ถํ ๊ณ ๋ฏผํด์ผํฉ๋๋ค. ์ผ๋ฐ์ ์ผ๋ก ์ปดํฌ๋ํธ๋ ์ฌ์ฌ์ฉ ๋ ์ ์๊ธฐ ๋๋ฌธ์ ๊ฐ์ ์์๊ฐ ์ฌ๋ฌ๋ฒ ์์ฑ๋ ์ ์์ต๋๋ค. ์ด๋ฌํ ์ด์ ๋ก ๋ณดํต์ ๊ฒฝ์ฐ์๋ `classN... |
@@ -1,9 +1,30 @@
import React from 'react';
import './LoginKang.scss';
+import LoginValidation from './components/LoginValidation';
class LoginKang extends React.Component {
render() {
- return <div className="LoginKang">LoginKang</div>;
+ return (
+ <div className="whole-area">
+ <section>
+ ... | JavaScript | kebab-case์ camelCase๋ฅผ ํผ์ฉํ๊ณ ๊ณ์๋ค์! ํต์ผํด์ ์ฌ์ฉํด์ฃผ์
์ผ ํฉ๋๋ค. |
@@ -1,9 +1,30 @@
import React from 'react';
import './LoginKang.scss';
+import LoginValidation from './components/LoginValidation';
class LoginKang extends React.Component {
render() {
- return <div className="LoginKang">LoginKang</div>;
+ return (
+ <div className="whole-area">
+ <section>
+ ... | JavaScript | ํ์ธ ํ ์์ ํ์์ต๋๋ค :) |
@@ -1,2 +1,219 @@
-.MainKang {
+@mixin center {
+ display: flex;
+ justify-content: center;
+}
+
+@mixin middle {
+ display: flex;
+ flex-direction: column;
+}
+
+@mixin boxes {
+ width: 100%;
+ margin: 5px auto;
+ border: 1px solid rgb(220, 219, 219);
+ background-color: white;
+}
+
+.entire-area {
+ @include... | Unknown | ํ์ธ ํ ์์ ํ์ต๋๋น |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ์กํ๋, validation์ ๊ธฐ๋ณธ๊ฐ์ผ๋ก๋ false๋ก ์ฃผ์ ๋ค
์กฐ๊ฑด (in.includes('@') && pwd.length>=5) ์ด true์ผ ๊ฒฝ์ฐ validation๋ true๋ก ๋ณํด์ ๋ฒํผ์ด ํ์ฑํ ๋๋ ๊ธฐ๋ฅ์ ๊ตฌํํ์ ๊ฒ์ด์ฃ ?
์ ๋ render()์์ ๋ฒํผ์ ์กฐ๊ฑด์ ๋ฐ๋ผ ์ผํญ ์ฐ์ฐ์๋ก class๋ช
์ ์ฃผ๊ณ , ์คํ์ผ๋ง์ ๋ค๋ฅด๊ฒ ํด์ ์์๋ง ๋ณ๊ฒฝ๋์๋๋ฐ ๋ฒํผ ํ์ฑํ ์์ฒด๋ฅผ ๊ตฌํํ์ ๊ฒ ๋ณด๊ณ ๋ง์ด ๋ฐฐ์ ์ต๋๋ค๐ |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ์กํ๋, ์ฌ๊ธฐ์ bind(this)๋ฅผ ์ฌ์ฉํ์ ๊ฒ์ ์ด๋ค ์๋ฏธ์ธ์ง ์ฌ์ญค๋ด๋ ๋ ๊น์?
๊ผญ ํ์ํ ์์์ธ์ง ๊ถ๊ธํฉ๋๋ค! |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๋ค ๋ง์์. form ์์ฒด์ submit ์ด๋ฒคํธ๋ฅผ ๋ฐ์์ํค๋ฉด ์ถํ์ ๋ฌธ์ ๊ฐ ์๊ธธ ์ ์์ด์ ์ ํจ์ฑ ๊ฒ์ฌ ํจ์๋ ๋ฐ๋ก ๋นผ์ฃผ๋๊ฒ ์ข์ต๋๋ค. |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ์ ๋ ๊ถ๊ธํฉ๋๋ค! ํ์
์์์ this ์ธ ๋, ๋ฐ๊นฅ์ this ๋ฐ์ผ๋ ค๊ณ ์ฌ์ฉํ๋ ๊ฑธ๋ก ์๊ณ ์์๋๋ฐ this.setState ๋๋ฌธ์ ์ฌ์ฉํ์ ๊ฑด๊ฐ์? |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๋ฆฌ์กํธ ํด๋์ค ์ปดํฌ๋ํธ์์ bind๋ฅผ ์ฌ์ฉํ์ง this๋ `undefined`๋ก ์ธ์ํด์ ๊ทธ๋์ ์ด ๊ฒฝ์ฐ์ this๋ฅผ ์๋ ค์ค์ผ ํ๋๋ฐ ๋๊ฐ์ง ๋ฐฉ๋ฒ์ด ์์ด์.
1. ํ๊ทธ ์์ฒด์์ ์ด๋ฒคํธ๋ฅผ ํ์ดํ ํจ์๋ก ์จ์ฃผ๋ ๊ฒ์
๋๋ค. ex) `<input onChange={(e) => handleChange(e)} >`
2. ์ ๋ ์ฒซ ๋ฒ์งธ ๋ฐฉ์์ด ๊ฐ๋
์ฑ์ด ์ข์ง ์์์ ์ฐจ๋ผ๋ฆฌ ๋ฆฌ์กํธ ๋ฌธ์์์ ๊ถ์ฅํ๋ ๋ ๋ฒ์งธ ๋ฐฉ์์ผ๋ก [this๋ฅผ ์ฐ๊ฒฐ](https://ko.reactjs.org/docs/handling-events.html)ํ์ต๋๋ค. |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๊ถ๊ธํด์ ์ง๋ฌธ ๋จ๊น๋๋ค! [event.target.name]์ ์์ state ์ ์ธํ ๋ ์๋๋ฐ,
input ํ๊ทธ์ ์ด๋ฆ์ ์ฃผ๊ธฐ ์ํ๊ฑด๊ฐ์?
๊ทธ๋ ๋ค๋ฉด, ํน์ ์ฒ์ render ํ ๋๋ 'id'๋ฅผ ๋ฃ๊ณ , ๊ฐ ๋ณ๊ฒฝ๋ ๋ ๊ฐ์ ์ด๋ฆ์ ๋ฃ์ด์ฃผ์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค! |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ์์ง์์ ๊ตฌ๊ฒฝ์์ต๋๋ค:)์ฝ๋๊ฐ ์ ๋ง ์ฌ์ธํ์ธ์!! ๋๋ถ์ bind, ์ ํจ์ฑ ๊ฒ์ฆ ๊ด๋ จํด์ ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค:)! ๊ฐ์ฌํฉ๋๋ค~ |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ์กํ๋, ์ดํดํ์ต๋๋ค! ์ ๋ bind๋ฅผ ํ์ง ์๊ณ ๋ ์ ์คํ๋์ด์ ์์ํ๋๋ฐ, arrow function์ ์ฌ์ฉํ์๋ค์~! ๋งํฌ๊น์ง ๊ฑธ์ด์ฃผ์๋ ์์ธํ ์ค๋ช
์ ๊ฐ๋ํ์ต๋๋ค~ ใ
ใ
|
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๋ง์ต๋๋ค. input ํ๊ทธ์ name, value ์์ฑ์ ์ด์ฉํด์ onChange์ด๋ฒคํธ๊ฐ ๋ฐ์ํ๋ฉด ์ํ๋ ๊ณณ์ ๊ฐ์ ๋ฃ์ด์ฃผ๊ธฐ ์ํด์ ์
๋๋ค. ๋ฆฌ์กํธ ์ฌ์ดํธ์์ [๋ค์ค ์
๋ ฅ ์ ์ดํ๊ธฐ](https://ko.reactjs.org/docs/forms.htmll) ์ฝ์ผ์๋ฉด ๋์ ๋์ค ๊ฑฐ ๊ฐ๋ค์! |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | this์ ๋ํด์ ์ ๊ณ ๋ฏผํด๋ณด์๊ณ bind ๋ฉ์๋๊น์ง ์ ์ฐพ์์ ์ ์ฉํด์ฃผ์
จ๋ค์!
- ๋ค๋ง ์ฌ๊ธฐ์ handleInput ํจ์๋ ์ด๋ฏธ arrow function์ผ๋ก ์์ฑ์ ํ๊ธฐ์ ๋ด๋ถ์ ์ผ๋ก this๋ฅผ ๊ฐ์ง์ง์๊ณ ์์ ์ค์ฝํ์ this๋ฅผ ์ฌ์ฉํ๊ธฐ์ ํ์์ ์ด์ง ์์ต๋๋ค
- ํจ์์ ์ธ + bind method๋ก this๊ฐ ๋ฐ์ธ๋ฉ๋ ์๋ก์ด ํจ์ ์ฌ์์ฑ ๋ณด๋ค๋ arrow function ์ผ๋ก ํ๋ฒ ์์ฑํ๋๊ฒ ๊ฐํธํ๊ณ ๊ฐ๋
์ฑ์ด ์ข๊ธฐ์ arrow function ์ฌ์ฉ์ ๊ถ์ฅ๋๋ฆฝ๋๋ค. |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๐
๊ตฌ์กฐ๋ถํดํ ๋น๊น์ง ํด์ฃผ์๋ฉด ๋ ๊น๋ํ๊ฒ ๋ค์
```
const {name, value} = event;
this.setState{{[name] : value}}
``` |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | [๊ณต์๋ฌธ์ React๋ก ์ฌ๊ณ ํ๊ธฐ](https://ko.reactjs.org/docs/thinking-in-react.html#step-3-identify-the-minimal-but-complete-representation-of-ui-state) ๋ฅผ ๋ณด์๋ฉด ์ด๋ค ๊ฐ๋ค์ด state๊ฐ ๋์ด์ผํ๋์ง์ ๋ํด ์ ํ์์ต๋๋ค.
> ๊ฐ๊ฐ ์ดํด๋ณด๊ณ ์ด๋ค ๊ฒ state๊ฐ ๋์ด์ผ ํ๋ ์ง ์ดํด๋ด
์๋ค. ์ด๋ ๊ฐ ๋ฐ์ดํฐ์ ๋ํด ์๋์ ์ธ ๊ฐ์ง ์ง๋ฌธ์ ํตํด ๊ฒฐ์ ํ ์ ์์ต๋๋ค
> 1. ๋ถ๋ชจ๋ก๋ถํฐ props๋ฅผ ํตํด ์ ๋ฌ๋ฉ๋๊น? ๊ทธ๋ฌ๋ฉด ํ์คํ state๊ฐ ์๋๋๋ค.
> 2. ์... |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | - snake-case๋ฅผ ์ด์ฉํด์ className ๋ถ์ฌํ๊ณ ๊ณ์๊ตฐ์, nesting์ ์ํด์ ์ต์์ ํ๊ทธ์ ๋ถ์ฌํ๋ ํด๋์ค๋ค์์ ํด๋ ์ค๋ค์์ ์ค๋ณต์ ํผํ๊ณ , ์ผ๋ฐ์ ์ธ ํด๋์ค๋ค์๊ณผ ๊ตฌ๋ถํ๊ธฐ ์ํด์ PascalCase๋ก ์์ฑํด์ฃผ๋๊ฒ๋ ์ข์๋ณด์ด๋ค์
- ์ด๋ฐ ๋ถ๋ถ์ ์ปจ๋ฒค์
์ ์ธ ๋ถ๋ถ์ด๊ธฐ์ ํ๋ผ๋ฆฌ ํฉ์ํด์ ์งํํด์ฃผ์๋ฉด ๋์ง๋ง ์์ฝ๋๋ด์์๋ ์ปดํฌ๋ํธ ์ด๋ฆ๊ณผ ๋์ผํ๊ฒ PascalCase๋ฅผ ์ฌ์ฉํ๋๊ฒ์ ๊ถ์ฅํ๊ณ ์์ต๋๋ค(๊ถ์ฅ์ผ ๋ฟ ํ์๋ ์๋๊ธฐ์ ์ปจ๋ฒค์
์ ํ์๋ผ๋ฆฌ ํฉ์ํด์ ์ ์ฉํ์๋ฉด ๋ฉ๋๋ค.) |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | autoComplete, aria-label ๋ฑ์ ์์ฑ๊น์ง ์ธ์ฌํ๊ฒ ์ ๊ฒฝ์ฐ์
จ๋ค์๐ |
@@ -0,0 +1,78 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ border: 1px solid #bdbdbd;
+ text-align: center;
+ background: rgb(250, 250, 250);
+
+ .login-container {
+ width: 350px;
+ height: 350px;
+ padding: 0 40px;
+ border: 1px solid silver;
+... | Unknown | ์ด๋ ๊ฒ ์์ฃผ ์ฌ์ฉ๋๋ ๋ฐ๋ณต๋๋ ์์ฑ์ mixin ํํ๋ก ๋ง๋ค์ด์ ์ฌ์ฉํ๋๊ฒ๋ ์ข์ต๋๋ค. |
@@ -0,0 +1,78 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ border: 1px solid #bdbdbd;
+ text-align: center;
+ background: rgb(250, 250, 250);
+
+ .login-container {
+ width: 350px;
+ height: 350px;
+ padding: 0 40px;
+ border: 1px solid silver;
+... | Unknown | css ์์ฑ ์์ ๊ฐ์ด๋๋ผ์ธ์ ๋ง์ถฐ์ฃผ์ธ์ |
@@ -0,0 +1,78 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ border: 1px solid #bdbdbd;
+ text-align: center;
+ background: rgb(250, 250, 250);
+
+ .login-container {
+ width: 350px;
+ height: 350px;
+ padding: 0 40px;
+ border: 1px solid silver;
+... | Unknown | style์ ๋ถ์ฌํ์ง ์๋ ๊ฒฝ์ฐ์๋ ๊ตณ์ด className ๋ถ์ฌ ๋ฐ ๋ค์คํ
ํ ํ์ ์์ต๋๋ค! |
@@ -0,0 +1,78 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ border: 1px solid #bdbdbd;
+ text-align: center;
+ background: rgb(250, 250, 250);
+
+ .login-container {
+ width: 350px;
+ height: 350px;
+ padding: 0 40px;
+ border: 1px solid silver;
+... | Unknown | ์ฌ๊ธฐ์ ๋ถ์ฌํ๊ณ ์์๋ค์ ํด๋น ์
๋ ํฐ์ ์คํ์ผ์ ์
๋ ํฐ ๋ฐ๋ก ํ์์ ์ ์ด์ฃผ์ธ์ ์ด๋ ๊ฒ ๋ค์คํ
์ด ์ญ ์๊ณ ๊ทธ ๋ค์ ์์ผ๋ฉด ๊ฐ๋
์ฑ์ธก๋ฉด์์ ์ข์ง์์ต๋๋ค. |
@@ -0,0 +1,78 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ border: 1px solid #bdbdbd;
+ text-align: center;
+ background: rgb(250, 250, 250);
+
+ .login-container {
+ width: 350px;
+ height: 350px;
+ padding: 0 40px;
+ border: 1px solid silver;
+... | Unknown | scss์ extends ๋ฌธ๋ฒ ํ์ฉํ๋ฉด ์ข๊ฒ ๋ค์ |
@@ -0,0 +1,78 @@
+.login {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ height: 100vh;
+ border: 1px solid #bdbdbd;
+ text-align: center;
+ background: rgb(250, 250, 250);
+
+ .login-container {
+ width: 350px;
+ height: 350px;
+ padding: 0 40px;
+ border: 1px solid silver;
+... | Unknown | ๋ถํ์ํ ์ฃผ์์ ์ญ์ ํด์ฃผ์ธ์ |
@@ -0,0 +1,19 @@
+import React, { Component } from 'react';
+
+class Comment extends Component {
+ render() {
+ const { profile, name, content } = this.props;
+ return (
+ <li className="feeds-comment__reply">
+ <div className="user-feeds__profile--img">
+ <img src={profile} alt="ํผ๋์ฌ์ง" />
+ ... | JavaScript | ```suggestion
{!this.props.profile && (
<img src={this.props.profile} alt="ํผ๋์ฌ์ง" />
)
```
- !== ์ฐ์ฐ์ ๋ถํ์ํด๋ณด์
๋๋ค, ๋น ๋ฌธ์์ด์ falsy ๊ฐ์ด๊ธฐ์ not ์ฐ์ฐ์์ ์กฐํฉํด์ ๋น๋ฌธ์์ด์ด ์๋๋๋ฅผ ํํ ๊ฐ๋ฅํฉ๋๋ค.
- true์ผ ๊ฒฝ์ฐ์๋ง ๋ ๋๋ง๋๋ฉด ๋๋ค๋ฉด ์ผํญ์ฐ์ฐ์๋ง๊ณ && ์ฐ์ฐ์๋ฅผ ์ด์ฉํด๋ณด์ธ์ |
@@ -0,0 +1,19 @@
+import React, { Component } from 'react';
+
+class Comment extends Component {
+ render() {
+ const { profile, name, content } = this.props;
+ return (
+ <li className="feeds-comment__reply">
+ <div className="user-feeds__profile--img">
+ <img src={profile} alt="ํผ๋์ฌ์ง" />
+ ... | JavaScript | props ๊ตฌ์กฐ๋ถํดํ ๋นํด์ ์ฌ์ฉํ๋ฉด ์ข์๋ณด์ด๋ค์ |
@@ -0,0 +1,43 @@
+import React, { Component } from 'react';
+import Comment from './Comment/Comment';
+import './CommentList.scss';
+
+class CommentList extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ commentList: [],
+ };
+ }
+ componentDidMount() {
+ fetch('http://loc... | JavaScript | data๋ผ๋ ๊ด๋ฒ์ํ ๋ณ์๋ช
๋ณด๋ค๋ ์๋ฏธ๊ฐ ๋๋ฌ๋๊ฒ ๋ณ์๋ช
์ง์ด์ฃผ์ธ์ |
@@ -1,7 +1,246 @@
-import React from 'react';
+import React, { Component } from 'react';
+import CommentList from './CommentList/CommentList';
+import IconList from './IconList/IconList';
+import userImg from '../../../assets/images/IMG_2625.jpg';
+import feedImg from '../../../assets/images/feed.jpg';
+import './Main.... | JavaScript | ์ด๋ ๊ฒ ๋ฐ๋ณต๋๋ UI๋ Array.map์ ํ์ฉํด์ ํํํด๋ณด์ธ์ ์ ์ ์ธ ์ปจํ
์ธ ๋ผ๋ฉด ์์๋ฐ์ดํฐ์ ์กฐํฉํ๋ฉด ํํ ๊ฐ๋ฅํด๋ณด์
๋๋ค. |
@@ -1,7 +1,246 @@
-import React from 'react';
+import React, { Component } from 'react';
+import CommentList from './CommentList/CommentList';
+import IconList from './IconList/IconList';
+import userImg from '../../../assets/images/IMG_2625.jpg';
+import feedImg from '../../../assets/images/feed.jpg';
+import './Main.... | JavaScript | ์ด ํ์ผ์์ ๋ฐ๋ณต๋๋ UI ๋ง์ด ๋ณด์ด๋๋ฐ ๋ค ํ๋ฒ Array.map์ ์ด์ฉํด์ ํํํด๋ณด์ธ์ |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๋ค ์ฝ๋ ๋ฆฌ๋ทฐ ์ ์ฉํ๊ฒ ์ต๋๋ค. |
@@ -1,7 +1,77 @@
-import React from 'react';
+import React, { Component } from 'react';
+import './Login.scss';
-function Login() {
- return <div>Nav bar</div>;
+class Login extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ id: '',
+ pwd: '',
+ };
+ }
+
+ handleInput... | JavaScript | ๊ฐ์ฌํฉ๋๋ค ใ
ใ
|
@@ -5,16 +5,18 @@ export default class ReviewMapper {
constructor(private readonly review: ReviewAllProperties) {}
toDomain() {
+ if (!this.review) return null;
+
return new Review({
id: this.review.id,
- writerId: this.review.writerId,
- writer: this.review.writer,
- ownerId: this... | TypeScript | ์ ๋ ์ด๋ ๊ฒ ํ๋๊ฑฐ ๊ฐ๊ธด ํ๋ฐ if๋ฌธ ์์์ null ๊ฐ๊ณผ undefined๊ฐ์ ์ฒดํฌํด์ ๋ฆฌํด๋ฌธ ์ดํ๋ก ์ต์
๋๋ก ์ค ํ์๋ ์๋๊ฑฐ ๊ฐ์์ |
@@ -1,4 +1,5 @@
import { IsInt, IsNotEmpty, IsPositive, IsString, IsUUID } from 'class-validator';
+import { Type } from 'class-transformer';
export class CreateReviewDTO {
@IsUUID()
@@ -18,3 +19,13 @@ export class CreateReviewDTO {
@IsNotEmpty()
planId: string;
}
+
+export class GetReviewsQueryDTO {
+ @... | TypeScript | ๊ธฐ๋ณธ๊ฐ์ ์ฃผ๋ ค๋ฉด isOptional์ด ์์ด์ผ๋์ง ์๋์? ํ
์คํธํด์ ๊ด์ฐฎ๋๊ฐ์? |
@@ -14,13 +14,13 @@ export interface ReviewProperties {
export interface ReviewAllProperties {
id?: string;
- writerId: string;
+ writerId?: string;
writer?: UserReference;
- ownerId: string;
+ ownerId?: string;
owner?: UserReference;
rating: number;
content: string;
- planId: string;
+ planId?:... | TypeScript | ํ๋์ด ์ญ์ ๋๋๋ผ๋ ๋ฆฌ๋ทฐ๋ ๋จ์์๋ ํ๋ก์ธ์ค์ธ๊ฐ์?
๊ทธ๋ ๋ค๋ ์ ์ ํ์ ์ ํฌ๋ ๋
ผ๋ฆฌ์ญ์ ๋ผ์ planId๋ ์ต์
๋์ด ์๋์ฌ๋ ๋ ๊ฑฐ๊ฐ์์.
ํ๋์ ์ต์
๋๋ก ์ ์งํด์ผ๊ฒ ๋ค์.
์ฌ๊ธฐ createdAt๊ณผ updatedAt์ด ์ต์
๋์ด ์๋์ฌ๋ ๊ด์ฐฎ์ง ์๋์? |
@@ -5,16 +5,18 @@ export default class ReviewMapper {
constructor(private readonly review: ReviewAllProperties) {}
toDomain() {
+ if (!this.review) return null;
+
return new Review({
id: this.review.id,
- writerId: this.review.writerId,
- writer: this.review.writer,
- ownerId: this... | TypeScript | ๋ฆฌํด๋ฌธ์ ์ต์
๋์ ์ ๋ฃ์ผ๋ฉด, ์๋ฅผ ๋ค๋ฉด ์ง๊ธ PR์ ์ฌ๋ฆฐ ๋ฆฌ๋ทฐ ๋ชฉ๋ก ์กฐํ ๋๋ writer ๋ฐ์ดํฐ๋ include๋ฅผ ํ์ง ์๊ณ ๋งคํํ๋๊น ๊ฐ์ด ์๋๋ฐ ๋ฌธ์ ์๋์??? |
@@ -1,4 +1,5 @@
import { IsInt, IsNotEmpty, IsPositive, IsString, IsUUID } from 'class-validator';
+import { Type } from 'class-transformer';
export class CreateReviewDTO {
@IsUUID()
@@ -18,3 +19,13 @@ export class CreateReviewDTO {
@IsNotEmpty()
planId: string;
}
+
+export class GetReviewsQueryDTO {
+ @... | TypeScript | ๋ค ๋ค์ ํ
์คํธํด๋ดค๋๋ฐ ๋ฌธ์ ์์ด์! ์ ์ฐธ๊ณ ๋ก PlanQueryOptionDTO ์ฐธ๊ณ ํด์ ์์ฑํ์ต๋๋ค ใ
ใ
ใ
|
@@ -14,13 +14,13 @@ export interface ReviewProperties {
export interface ReviewAllProperties {
id?: string;
- writerId: string;
+ writerId?: string;
writer?: UserReference;
- ownerId: string;
+ ownerId?: string;
owner?: UserReference;
rating: number;
content: string;
- planId: string;
+ planId?:... | TypeScript | ์ฌ์ค ์ด ์ธํฐํ์ด์ค๋ ์ค์ ํ๋ก์ธ์ค์์ ๋ฆฌ๋ทฐ ๊ฐ์ฒด๋ฅผ ์ด๋ฃจ๋ ๋ฐ์ ํ์ํ ํ๋๋ฅผ ๊ธฐ์ค์ผ๋ก ๋ง๋ค์ด์ rating, content ๋ง๊ณ ๋ ๋ค ์ต์
๋์
๋๋ค.. ์๋ฅผ ๋ค๋ฉด ์ง๊ธ ๋ง๋ API์ ๊ฒฝ์ฐ plan์ ๋ํ ๋ด์ฉ์ด ํ์์๊ธฐ ๋๋ฌธ์ planId๋ฅผ db์์ ๊ฐ์ ธ์ค์ง๋ ์๊ฑฐ๋ ์. ์ด์ ๋ง๋ค๊ฒ ๋ dreamer์ ๋ด๊ฐ ์์ฑํ ๋ฆฌ๋ทฐ ๋ชฉ๋ก์๋ ํ์ํ๊ณ ์. ์ต์
๋์ด ๋๋ฌด ๋ง์์ ํ์
์์ ์ฑ์ด ์ข ์ ๋งคํ๋ค๋ฉด ์ธํฐํ์ด์ค๋ฅผ ์์ ๋๋๊ฑฐ๋ ํด์ผํ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -5,16 +5,18 @@ export default class ReviewMapper {
constructor(private readonly review: ReviewAllProperties) {}
toDomain() {
+ if (!this.review) return null;
+
return new Review({
id: this.review.id,
- writerId: this.review.writerId,
- writer: this.review.writer,
- ownerId: this... | TypeScript | ์ ์ต์
๋์ review๊ฐ ์๋์ง ์ฒดํฌํ๋๊ฑฐ์ง ์๋์? |
@@ -1,4 +1,5 @@
import { IsInt, IsNotEmpty, IsPositive, IsString, IsUUID } from 'class-validator';
+import { Type } from 'class-transformer';
export class CreateReviewDTO {
@IsUUID()
@@ -18,3 +19,13 @@ export class CreateReviewDTO {
@IsNotEmpty()
planId: string;
}
+
+export class GetReviewsQueryDTO {
+ @... | TypeScript | ๊ทธ๋ ๊ตฐ์,, |
@@ -14,13 +14,13 @@ export interface ReviewProperties {
export interface ReviewAllProperties {
id?: string;
- writerId: string;
+ writerId?: string;
writer?: UserReference;
- ownerId: string;
+ ownerId?: string;
owner?: UserReference;
rating: number;
content: string;
- planId: string;
+ planId?:... | TypeScript | ์ดํดํ์ต๋๋ค |
@@ -14,13 +14,13 @@ export interface ReviewProperties {
export interface ReviewAllProperties {
id?: string;
- writerId: string;
+ writerId?: string;
writer?: UserReference;
- ownerId: string;
+ ownerId?: string;
owner?: UserReference;
rating: number;
content: string;
- planId: string;
+ planId?:... | TypeScript | ๋๋๊ธฐ๋ณด๋จ ๊ทธ๋ฅ ์ต์
๋๋ก ํ์
๊ฐ์๋ฅผ ์ค์ด์ฃ |
@@ -5,16 +5,18 @@ export default class ReviewMapper {
constructor(private readonly review: ReviewAllProperties) {}
toDomain() {
+ if (!this.review) return null;
+
return new Review({
id: this.review.id,
- writerId: this.review.writerId,
- writer: this.review.writer,
- ownerId: this... | TypeScript | this.review์ ํด๋น ๊ฐ์ด ์์ผ๋ฉด undefined ๊ฐ์ ํ ๋นํ๋ค๊ณ ํฉ๋๋ค (ํน์๋ ํด์ ๋ค์ ์ฐพ์๋ดค์ต๋๋ค ใ
ใ
ใ
) |
@@ -0,0 +1,213 @@
+<?xml version="1.0" encoding="utf-8"?>
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent"
+ tools:context=".ArchiveReviewFragment" >
+
+ ... | Unknown | ์ฌ๊ธฐ์ ์ปจํ
์คํธ๋ .ArchiveReviewFragment๋ก ์ถ์ ๋ฉ๋๋ค. |
@@ -0,0 +1,22 @@
+package common;
+
+import domain.gameresult.GameResult;
+import domain.gameresult.GameResults;
+import domain.player.Player;
+import domain.player.Players;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class PlayerGameResult {
+ public static Map<String, String> match(Players player... | Java | ์ด ํด๋์ค๊ฐ ๊ผญ ํ์ํ ๊น์? common ํจํค์ง์ ์์นํ ์ด์ ์ ๊ฐ ์ฑ
์์ ๋ค๋ฅธ ํด๋์ค๋ค๋ก ์์ํ ์ ์์์ง ๊ณ ๋ฏผํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,22 @@
+package common;
+
+import domain.gameresult.GameResult;
+import domain.gameresult.GameResults;
+import domain.player.Player;
+import domain.player.Players;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class PlayerGameResult {
+ public static Map<String, String> match(Players player... | Java | command + ,
java code style
method chaining multi line
๋ถ๋ถ์ ์ฒดํฌํ๊ณ ์ ๋ ฌํ์๋ฉด ๊ฐ๋
์ฑ ์ข๊ฒ ์ ๋ ฌ๋ฉ๋๋ค ~ ์ถ์ฒ๋๋ ค์ |
@@ -0,0 +1,22 @@
+package common;
+
+import domain.gameresult.GameResult;
+import domain.gameresult.GameResults;
+import domain.player.Player;
+import domain.player.Players;
+
+import java.util.HashMap;
+import java.util.Map;
+
+public class PlayerGameResult {
+ public static Map<String, String> match(Players player... | Java | get ์ผ๋ก ๊ฐ์ ธ์์ ๊ตฌํํ๋ ๊ฒ๋ณด๋ค Tell don't ask ์์น์ ์ ์ฉํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,106 @@
+package controller;
+
+import common.PlayerGameResult;
+import domain.gameresult.GameResultFactory;
+import domain.gameresult.GameResultName;
+import domain.gameresult.GameResults;
+import domain.ladder.Height;
+import domain.ladder.Ladder;
+import domain.ladder.LadderGenerator;
+import domain.player... | Java | ์ํ๊ฐ์ด ์กด์ฌํ์ง ์๋๋ก ๊ตฌํํด์ static ํ๊ฒ ์ฌ์ฉํด๋ณด๋ฉด ์ด๋จ๊น์ |
@@ -0,0 +1,106 @@
+package controller;
+
+import common.PlayerGameResult;
+import domain.gameresult.GameResultFactory;
+import domain.gameresult.GameResultName;
+import domain.gameresult.GameResults;
+import domain.ladder.Height;
+import domain.ladder.Ladder;
+import domain.ladder.LadderGenerator;
+import domain.player... | Java | Players ๊ฐ ์๋ Factory ํด๋์ค๋ฅผ ๋์
ํ์ ๋ ์ด๋ค ์ฅ์ ์ด ์์๊น์? |
@@ -0,0 +1,106 @@
+package controller;
+
+import common.PlayerGameResult;
+import domain.gameresult.GameResultFactory;
+import domain.gameresult.GameResultName;
+import domain.gameresult.GameResults;
+import domain.ladder.Height;
+import domain.ladder.Ladder;
+import domain.ladder.LadderGenerator;
+import domain.player... | Java | controller ์์ input ์ ๋ฐ๋๊ฒ ์๋๋ฏ๋ก ๋ฉ์๋๋ช
์ ๋ฐ๊ฟ๋ณด๋ฉด ์ด๋จ๊น์?
์ฌํํ๊ฒ getGameResultNames() ๋ ์ด๋จ๊น์ |
@@ -0,0 +1,106 @@
+package controller;
+
+import common.PlayerGameResult;
+import domain.gameresult.GameResultFactory;
+import domain.gameresult.GameResultName;
+import domain.gameresult.GameResults;
+import domain.ladder.Height;
+import domain.ladder.Ladder;
+import domain.ladder.LadderGenerator;
+import domain.player... | Java | null ๋ก ํ ๋นํ๋ ๊ฒ๊ณผ ArrayList ๋ก ํ ๋นํ๋ ๊ฒ ์ค ์ด๋๊ฒ ๋ ํจ์จ์ ์ผ๊น์ |
@@ -0,0 +1,106 @@
+package controller;
+
+import common.PlayerGameResult;
+import domain.gameresult.GameResultFactory;
+import domain.gameresult.GameResultName;
+import domain.gameresult.GameResults;
+import domain.ladder.Height;
+import domain.ladder.Ladder;
+import domain.ladder.LadderGenerator;
+import domain.player... | Java | Ladder ์ ์์ฑ์๋ฅผ ํตํด ์์ฑํ์ง ์๊ณ Generator ๋ฅผ ํตํด ์์ฑํ๋ฉด ์ด๋ค ์ฅ์ ์ด ์์๊น์ |
@@ -0,0 +1,46 @@
+package domain.player;
+
+import domain.line.Line;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Players {
+
+ private List<Player> players;
+
+ public Players(List<Player> players) {
+ this.playe... | Java | getPlayerNames ๋ ์ด๋จ๊น์ |
@@ -0,0 +1,46 @@
+package domain.player;
+
+import domain.line.Line;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Players {
+
+ private List<Player> players;
+
+ public Players(List<Player> players) {
+ this.playe... | Java | player.getPositionX(); ๋ก ๋๋ฏธํฐ๋ฒ์น์ ์ง์ผ๋ณด๋ฉด ์ด๋จ๊น์ |
@@ -0,0 +1,32 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Line {
+ private List<Point> points;
+
+ public Line(List<Point> points) {... | Java | getDirectionFlags() ๋ ์ด๋ค๊ฐ์? |
@@ -0,0 +1,28 @@
+package domain.gameresult;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class GameResults {
+ private List<GameResult> gameResults;
+
+ public GameResults(List<GameResult> gameResults) {
+ this.gameRes... | Java | ๊ฐ์ฒด์ ์ํ๋ฅผ ๋ณํํ๋๊ฒ ์๋๊ณ ๋ฐํํ๋ ๊ฒ์ด๋ฏ๋ก get ์ด๋ผ๋ ๋์ฌ์ด๊ฐ ์ด์ธ๋ฆด ๊ฒ ๊ฐ์ต๋๋ค |
@@ -0,0 +1,106 @@
+package controller;
+
+import common.PlayerGameResult;
+import domain.gameresult.GameResultFactory;
+import domain.gameresult.GameResultName;
+import domain.gameresult.GameResults;
+import domain.ladder.Height;
+import domain.ladder.Ladder;
+import domain.ladder.LadderGenerator;
+import domain.player... | Java | Collection ํ๋ ์์ํฌ ๋ค์ด๋ฐ์ ์ฐธ๊ณ ํด๋ณด๋ฉด players.contains(playerName) ์ด ๋ ์์ฐ์ค๋ฝ์ง ์์๊น์~? |
@@ -0,0 +1,32 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Line {
+ private List<Point> points;
+
+ public Line(List<Point> points) {... | Java | this.points = points ๋ก ํ๋ฉด ์ด๋ป๊ฒ ๋ ๊น์? |
@@ -0,0 +1,32 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Line {
+ private List<Point> points;
+
+ public Line(List<Point> points) {... | Java | unmodifiable ๋ก ํ๋ฒ ๊ฐ์ผ ์ด์ ๊ฐ ์์ผ์ค๊น์? |
@@ -0,0 +1,32 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Line {
+ private List<Point> points;
+
+ public Line(List<Point> points) {... | Java | array out of index ์๋ฌ๋ ๊ฑฑ์ ํ์ง ์์๋ ๋๋๊ฑด๊ฐ์? |
@@ -0,0 +1,32 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Line {
+ private List<Point> points;
+
+ public Line(List<Point> points) {... | Java | find ์ get ๋ฉ์๋ ๋ค์ด๋ฐ์ ์ฐจ์ด๊ฐ ๋ฌด์์ผ๊น์? |
@@ -0,0 +1,32 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Line {
+ private List<Point> points;
+
+ public Line(List<Point> points) {... | Java | points ๋ฅผ Line ์ผ๋ก ์ถ์ํํ์ ๊ฒ ๊ฐ์๋ฐ getPoints() ๊ฐ ํ์ํ ์ผ์ด์ค๊ฐ ์์๊น์? |
@@ -0,0 +1,21 @@
+package domain.gameresult;
+
+import domain.player.Position;
+
+public class GameResult {
+ private GameResultName name;
+ private Position position;
+
+ public GameResult(GameResultName name, Position position) {
+ this.name = name;
+ this.position = position;
+ }
+
+ pub... | Java | ์์ฑ์์ getter ๋ฟ์ธ๋ฐ ์ด๊ฑด DTO ์ญํ ์ธ๊ฐ์? |
@@ -0,0 +1,17 @@
+package domain.gameresult;
+
+import domain.player.Position;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class GameResultFactory {
+
+ public static GameResults from(List<GameResultName> gameResultNames, int positionY) {
+ List<GameResult> gameResults = new ArrayList<>()... | Java | ์์ฑ์ Factory ๋ก ๋ชจ๋ ์์ํ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค.
Factory ์์ด ๋๋ฉ์ธ ํด๋์ค์ ์ ์ ํฉํ ๋ฆฌ ๋ฉ์๋๋ฅผ ํตํด ์์ฑํ๋ฉด ์ด๋ค ์ ์ข์ ์ ์ด ์์๊น์?
๊ทธ๋ฆฌ๊ณ GameResultsFactory ๊ฐ ์๋๊น์? |
@@ -0,0 +1,21 @@
+package domain.ladder;
+
+public class Height {
+ private static final String INPUT_POSITIVE_MESSAGE = "[ERROR] ๋์ด๋ 0 ์ด๊ณผ๋ฅผ ์
๋ ฅํฉ๋๋ค.";
+ private int height;
+
+ public Height(int height) {
+ validatePositive(height);
+ this.height = height;
+ }
+
+ public void validatePositive... | Java | private ์ด์ด์ผ ํ์ง ์์๊น์~? |
@@ -0,0 +1,18 @@
+package domain.ladder;
+
+import domain.line.Line;
+import domain.line.LineGenerator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LadderGenerator {
+
+ public static Ladder generate(int ladderHeight, int playerCount) {
+ List<Line> lines = new ArrayList<>();
+ ... | Java | Ladder ๋ก ์์ํ๋ฉด ์ด๋จ๊น์ |
@@ -0,0 +1,49 @@
+package domain.line;
+
+import domain.point.Point;
+import domain.point.RandomPointGenerator;
+
+import java.util.ArrayList;
+import java.util.List;
+
+public class LineGenerator {
+
+ public static Line generate(int playerCount) {
+ List<Point> points = new ArrayList<>();
+ if (playe... | Java | Line ๋ฟ๋ง ์๋๋ผ Point, List<Point> ํ์
๊น์ง ์์ฑํ๊ณ ์๋๋ฐ
๊ฐ์ ์์๋ ๋งํ ๋๋ฉ์ธ ํด๋์ค๊ฐ ์์ง ์์๊น์? ํ๋ฒ ๊ณ ๋ฏผํด๋ณด๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,35 @@
+package domain.player;
+
+import domain.point.Direction;
+
+public class Player {
+ private Name name;
+ private Position position;
+
+ public Player(Name name, Position position) {
+ this.name = name;
+ this.position = position;
+ }
+
+ public void move(Direction directio... | Java | ์ธํฐํ์ด์ค๋ฅผ ํ์ฉํด์ if ๋ฌธ์ ์์จ ์ ์์ง ์์๊น์? |
@@ -0,0 +1,46 @@
+package domain.player;
+
+import domain.line.Line;
+
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.stream.Collectors;
+
+public class Players {
+
+ private List<Player> players;
+
+ public Players(List<Player> players) {
+ this.playe... | Java | ์ด ๋ฉ์๋๋ ์ด๋์ ์ฌ์ฉ๋๋๊ฑด๊ฐ์~? |
@@ -0,0 +1,54 @@
+package domain.player;
+
+import java.util.Objects;
+
+public class Position {
+ private static final String NEGATIVE_ERROR_MESSAGE = "[ERROR] Position์ x, y ๊ฐ์ ์์์
๋๋ค.";
+ private int x;
+ private int y;
+
+ public Position(int x, int y) {
+ validateNegative(x, y);
+ this.x =... | Java | equals ์ hashcode ๋ฅผ ์ฌ์ ์ํ ์ด์ ๋ฅผ ์ค๋ช
ํด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์~ |
@@ -0,0 +1,65 @@
+package domain.point;
+
+public class Point {
+ private static final String CONTINUOUS_CONNECTION_BRIDGE_ERROR_MESSAGE = "[ERROR] ๋ค๋ฆฌ๋ ์ฐ์๋์ด ์กด์ฌํ ์ ์์ต๋๋ค.";
+
+ private boolean left;
+ private boolean right;
+ private Direction direction;
+
+ public Point(boolean left, boolean right) {
+ ... | Java | check ๋ผ๋ ๋ฉ์๋๋ Direction ์ ๋ฐํํ๊ธฐ์ ์ ์ ํ์ง ์์ ๋ฉ์๋๋ช
์ธ ๊ฒ ๊ฐ์ต๋๋ค.
getConnectedDirection() ์ ์ด๋จ๊น์ |
@@ -0,0 +1,12 @@
+package domain.point;
+
+import java.util.Random;
+
+public class RandomPointGenerator {
+
+ private static Random random = new Random();
+
+ public static boolean generate() {
+ return random.nextBoolean();
+ }
+} | Java | ์ญํ ์ Random ์ ๊ฐ์ผ wrapper ํด๋์ค์ธ๋ฐ Point ๋ผ๋ ์ ํ์ ์ด๋ฆ์ผ๋ก ์ฃผ๊ฒ ๋๋ ๊ฒ ๊ฐ์ต๋๋ค.
RandomGenerator util ๋ก ๋ณด๋ฉด ์ด๋จ๊น์ |
@@ -0,0 +1,80 @@
+package domain.line;
+
+import domain.point.Direction;
+import domain.point.Point;
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import static org.assertj.core.api.Assertions.assertThat;
+
+class LineTest {
+
+ ... | Java | good ํ
์คํธ ์ ์์ฑํ์
จ๋ค์ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.