code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,13 @@
+package kr.co.connect.boostcamp.livewhere.di
+
+
+val appModules = arrayListOf(
+ apiModule
+ , loginModule
+ , sharedModule
+ , databaseModule
+ , homeModule
+ , mapModule
+ , reverseGeoApiModule
+ , detailModule
+) | Kotlin | ๋ค๋ฅธ ์ฝ๋๋ค๊ณผ ์ ํ ๋ค๋ฅธ code format์ธ๋ฐ ํต์ผ์ด ํ์ํด ๋ณด์
๋๋ค. |
@@ -0,0 +1,24 @@
+package kr.co.connect.boostcamp.livewhere.di
+
+import androidx.room.Room
+import kr.co.connect.boostcamp.livewhere.data.database.AppDataBase
+import org.koin.android.ext.koin.androidContext
+import org.koin.dsl.module.module
+
+const val DATABASE_NAME = "mdatabase.db"
+
+val databaseModule = module {... | Kotlin | ์ด ๋ชจ๋์ ์ ์๋ 3๊ฐ์ง injection๋ค์ named inject๊ฐ ํ์ํ๊ฐ์?
๋ถํ์ํด๋ณด์
๋๋ค. |
@@ -0,0 +1,73 @@
+package com.eureka.spartaonetoone.review.application;
+
+import com.eureka.spartaonetoone.review.application.dtos.request.ReviewRequestDto;
+import com.eureka.spartaonetoone.review.application.dtos.response.ReviewResponseDto;
+import com.eureka.spartaonetoone.review.application.exception.ReviewExcepti... | Java | `@Transactional`์ด ๋น ์ง ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,73 @@
+package com.eureka.spartaonetoone.review.application;
+
+import com.eureka.spartaonetoone.review.application.dtos.request.ReviewRequestDto;
+import com.eureka.spartaonetoone.review.application.dtos.response.ReviewResponseDto;
+import com.eureka.spartaonetoone.review.application.exception.ReviewExcepti... | Java | ์ด ๋ถ๋ถ์ด ์ ์ ํฉํ ๋ฆฌ ๋ฉ์๋๋ฅผ ์ฌ์ฉํด์ ์๋ง `Review.createReview(dto)`๊ฐ ๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,59 @@
+package com.eureka.spartaonetoone.review.presentation;
+
+import com.eureka.spartaonetoone.review.application.ReviewService;
+import com.eureka.spartaonetoone.review.application.dtos.request.ReviewRequestDto;
+import com.eureka.spartaonetoone.review.application.dtos.response.ReviewResponseDto;
+
+impo... | Java | dto ์์ `@Valid` ์ถ๊ฐํด์ฃผ์๋ฉด ๊ฐ์ฌํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,59 @@
+package com.eureka.spartaonetoone.review.presentation;
+
+import com.eureka.spartaonetoone.review.application.ReviewService;
+import com.eureka.spartaonetoone.review.application.dtos.request.ReviewRequestDto;
+import com.eureka.spartaonetoone.review.application.dtos.response.ReviewResponseDto;
+
+impo... | Java | ์ฌ๊ธฐ๋ dto ์์ `@Valid` ์ถ๊ฐํด์ฃผ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,62 @@
+package com.eureka.spartaonetoone.store.presentation;
+
+import com.eureka.spartaonetoone.store.application.StoreService;
+import com.eureka.spartaonetoone.store.application.dtos.request.StoreRequestDto; //
+import com.eureka.spartaonetoone.store.application.dtos.response.StoreResponseDto;
+
+import o... | Java | ์ฃผ์ ๋ถ๋ถ๋ง ๋์ค์ ์ ๊ฑฐํด์ฃผ์
๋ ๋ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,13 @@
+export class NetworkError extends Error {
+ constructor(message) {
+ super(message);
+ this.name = "NetworkError";
+ }
+}
+
+export class HttpError extends Error {
+ constructor(message) {
+ super(message);
+ this.name = "HttpError";
+ }
+} | JavaScript | ์ฌ์ฉ๋์ง ์๋ ์ฝ๋๊ฐ ๋จ์์๋ค์, ํน์ ์ด๋ค ์๋๋ก ๋ง๋์
จ์๊น์?! |
@@ -0,0 +1,39 @@
+function formatUrl(config) {
+ const { href, query } = config;
+ const searchParams = new URLSearchParams(query);
+
+ return `${href}?${searchParams.toString()}`;
+}
+
+function formatHeaders(headersRecord) {
+ const headers = new Headers();
+
+ headers.append("content-type", "application/json");... | JavaScript | [MDN Error() ์์ฑ์](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Error/Error) ๋ฌธ์ ์ฒจ๋ถ๋๋ฆฝ๋๋ค!
error ๊ฐ์ฒด๋ ์ฒซ๋ฒ์งธ ์ธ์๋ก `message`๋ฅผ ๋ฐ์ผ๋ฉฐ, ๋๋ฒ์งธ ์ธ๋ฒ์งธ ์ธ์๊ฐ ์๊ธดํ์ง๋ง, ๋นํ์ค์
๋๋ค!
์ค์ ๋ก ์๋ฌ๋ฅผ ์ผ์ผ์ผ๋ณด๋ฉด alert์์ `Http error: ` , `Network error: `
ํด๋น ๋ฌธ์์ด๋ง ๋
ธ์ถ๋๋ ๊ฑธ ํ์ธํ์ค ์ ์์๊ฑฐ์์! |
@@ -0,0 +1,39 @@
+function formatUrl(config) {
+ const { href, query } = config;
+ const searchParams = new URLSearchParams(query);
+
+ return `${href}?${searchParams.toString()}`;
+}
+
+function formatHeaders(headersRecord) {
+ const headers = new Headers();
+
+ headers.append("content-type", "application/json");... | JavaScript | ์ด ํ์ผ์ ๋ํ ์ ๋ฐ์ ์ธ ๋๋์ `formatUrl`, `formatHeaders` ํจ์์ ํ์์ฑ์ ๋ชจ๋ฅด๊ฒ ๋ค.. ์ด๊ธด ํฉ๋๋ค!
`createAPIRequest` ์ฒ๋ผ ์ ์ฒด์ ์ธ ์์ฒญ์ ๋ํ ๊ณตํต ํจ์๋ ์์ผ๋ฉด ๋น์ฐํ ์ข๋ค!
์ด๊ธดํ๋ฐ ํํ์ ๋ํด์๋ ์กฐ๊ธ ์์ฌ์ด ๋ถ๋ถ์ด ์๋ค๊ณ ๋๊ปด์ง๋๋ค!
์ฝ๋ฉํธ๋ก ํ๋ ํ๋ ์์ฑํด๋ณผ๊ฒ์! |
@@ -0,0 +1,39 @@
+function formatUrl(config) {
+ const { href, query } = config;
+ const searchParams = new URLSearchParams(query);
+
+ return `${href}?${searchParams.toString()}`;
+}
+
+function formatHeaders(headersRecord) {
+ const headers = new Headers();
+
+ headers.append("content-type", "application/json");... | JavaScript | `headers.append("content-type", "application/json")`;
์ฌ์ค์ ์ญํ ์ ๋ชจ๋ ์์ฒญ์ ํด๋น ํค๋๋ฅผ ๋ํด์ฃผ๋ ์ญํ ๋ฐ์ ์๋๋ฐ
`createAPIRequest`์ headers์์ ํด์ฃผ๋ฉด ๋์ง ์์๊น ์ถ๋ค์!
```js
headers: {
...request.headers
'content-type': "application/json"
}
``` |
@@ -0,0 +1,39 @@
+function formatUrl(config) {
+ const { href, query } = config;
+ const searchParams = new URLSearchParams(query);
+
+ return `${href}?${searchParams.toString()}`;
+}
+
+function formatHeaders(headersRecord) {
+ const headers = new Headers();
+
+ headers.append("content-type", "application/json");... | JavaScript | ๊ฐ์ฅ ๋จผ์ searchParams์ ์ฌ๋ถ์ ๊ด๊ณ ์์ด URL์ `?`๊ฐ ๋ถ์ต๋๋ค!
๊ทธ๋ฆฌ๊ณ `createAPIRequest`๋ณด๋ค ์ค์ ์์ฒญํ๋ ๊ณณ์์ ์ฌ์ฉํ๋ ๊ฒ์ด ์ด๋จ๊น ์ถ๊ธดํฉ๋๋ค!
์ด๋ค ์๋ฏธ๋๋ฉด์!
fetch API๋ฅผ ์ฌ์ฉํ๋ ๊ฒ์ ๋๋ฌ๋ด๊ณ , ์ฌ์ฉ์ฒ์์ ์ด๋ฅผ ์์๋ณผ ์ ์์ผ๋ฉด ๋ ์ข๊ฒ ๋ค๋ ์๊ฐ์
๋๋ค.
`fetchPopularMovies`๋ fetch API์ ์ง์ ์ฌ์ฉํ ์ ์๋ ํํ์ `createAPIRequest`์ ์๋ง์ ์ธ์๋ฅผ ๋๊ฒจ์ค๋๋ค.
`createAPIRequest`๋ ์ด ์ธ์๋ฅผ ๊ฐ๊ณตํด์ fetch API์ ์ฌ์ฉํ ์ ์๋ ํํ๋ก ๋ณ๊ฒฝ์... |
@@ -0,0 +1,39 @@
+function formatUrl(config) {
+ const { href, query } = config;
+ const searchParams = new URLSearchParams(query);
+
+ return `${href}?${searchParams.toString()}`;
+}
+
+function formatHeaders(headersRecord) {
+ const headers = new Headers();
+
+ headers.append("content-type", "application/json");... | JavaScript | ์ฝ๋ฉํธ๊ฐ ๋ง์ด ๊ธธ์ด์ก๋ค์.. ใ
ใ
ใ
ใ
์์ฝํ์๋ฉด, ์ธํฐํ์ด์ค๋ฅผ ๋๋ฃ๊ฐ ๋ฐ๋ก ๋ฏ์ด๋ณด์ง ์์๋ ๋ฐ๋ก ์ดํดํ ์ ์๋ ํํ๋ก ์์ฑํ์..! ์
๋๋ค |
@@ -0,0 +1,39 @@
+function formatUrl(config) {
+ const { href, query } = config;
+ const searchParams = new URLSearchParams(query);
+
+ return `${href}?${searchParams.toString()}`;
+}
+
+function formatHeaders(headersRecord) {
+ const headers = new Headers();
+
+ headers.append("content-type", "application/json");... | JavaScript | `data` ๋ณ์๋ฅผ ์์ฑํ ํ์ํ ์์ด ๋ฐ๋ก ๊ฒฐ๊ณผ๊ฐ์ ๋ฐํํ๋ฉด ๋ ๊ฒ ๊ฐ๋ค์~ |
@@ -0,0 +1,37 @@
+import "./components/layout/app-header.js";
+import "./components/movie/movie-card.js";
+import "./components/movie/movie-list.js";
+import "./components/movie/movie-container.js";
+
+import { html } from "./utils/template.js";
+
+class App extends HTMLElement {
+ constructor() {
+ super();
+ t... | JavaScript | ์ ๊ฑฐ ํด๋ ๊ด์ฐฎ์ ์คํ์ผ ๊ฐ์๋ฐ ์ด๋ค ์๋ฏธ๊ฐ ์์๊น์? |
@@ -0,0 +1,2 @@
+export const html = String.raw;
+export const css = String.raw; | JavaScript | ๋ง์ฐฌ๊ฐ์ง๋ก ์ฌ์ฉ๋์ง ์๊ณ ์๋ค์! |
@@ -0,0 +1,58 @@
+import endedPopularMovies from "../fixtures/ended-popular-movies.json";
+
+describe("์ํ ๋ชฉ๋ก", () => {
+ beforeEach(() => {
+ const url = "http://localhost:8080";
+ cy.visit(url);
+
+ cy.get("movie-app")
+ .as("movieApp")
+ .shadow()
+ .find("movie-container")
+ .as("movieC... | JavaScript | ํ
์คํธ๊ฐ ๋ชจ๋ ํดํผ์ผ์ด์ค๋ฅผ ๊ฐ์ ํ๊ณ ์์ฑ๋ ๊ฒ ๊ฐ์์!
๋คํธ์ํฌ ์๋ฌ๋ HTTP ์๋ฌ์ ๊ดํ ์ํฉ์ ์ ์ ํ๊ฒ ์์ฑ๋ ์ฝ๋๋๋ก ๋์ํ๋์ง๋ ํ์ธํ๋ฉด ์ข์ ๊ฒ ๊ฐ๋ค์! |
@@ -0,0 +1,143 @@
+import StarFilled from "../../../images/star_filled.png";
+import { html } from "../../utils/template.js";
+
+const BASE_URL = "https://image.tmdb.org/t/p/w220_and_h330_face";
+
+class MovieCard extends HTMLElement {
+ static get observedAttributes() {
+ return ["posterPath", "title", "voteAverag... | JavaScript | `a` ํ๊ทธ ๋ฐ `href="#'`๋ฅผ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์๋์? |
@@ -0,0 +1,13 @@
+<!DOCTYPE html>
+<html lang="ko">
+ <head>
+ <meta charset="UTF-8" />
+ <meta http-equiv="X-UA-Compatible" content="IE=edge" />
+ <meta name="viewport" content="width=device-width, initial-scale=1.0" />
+
+ <title>์ํ๊ด</title>
+ <script defer src="./bundle.js"></script></head>
+ <body>
+... | Unknown | ์๋ง ๋ฐฐํฌ ๋๋ฌธ์ dist ํด๋๋ฅผ ์ด๋ ๊ฒ ์ฌ๋ ค์ฃผ์ ๊ฒ ๊ฐ๋ค์ ใ
ใ
gh-pages ๋ธ๋์น๋ฅผ ์ด์ฉํ๋ฉด ์ด๋จ๊น ์ถ์ด์! |
@@ -0,0 +1,20 @@
+import { createComponent } from "../createComponent";
+import { Header } from "./Header";
+import { Main } from "./Main";
+
+export async function App() {
+ const header = await createComponent(Header);
+ const main = await createComponent(Main);
+
+ const bindEvents = () => {
+ main.bindEvents(... | JavaScript | ์ด์ ๋ณด๋ header๋ main ๋๋ฌธ์ด๊ตฐ์ ใ
ใ
|
@@ -0,0 +1,13 @@
+export let currentComponent = null;
+
+export async function createComponent(component, props) {
+ const previousComponent = currentComponent;
+
+ currentComponent = { name: component.name, stateIndex: 0 };
+
+ const componentInstance = await component(props);
+
+ currentComponent = previousCompon... | JavaScript | ์ฌ๊ธฐ์ previousComponent๊ฐ ํ๋ ์ญํ ์ ๋ฌด์์ผ๊น์? |
@@ -0,0 +1,55 @@
+import { createComponent, currentComponent } from "../createComponent";
+import { fetchMovies } from "../fetch";
+import { useState } from "../state";
+import { MovieCard } from "./MovieCard";
+
+export async function MovieList() {
+ const [page, setPage] = useState(1);
+
+ const movieData = await f... | JavaScript | ๋ง์ฝ ํ ํ์ด์ง์ ์นดํ
๊ณ ๋ฆฌ๋ณ๋ก ์ฌ๋ฌ ๊ฐ์ ์ํ๋ชฉ๋ก์ ๋์์ค๋ค๊ณ ํ์ ๋,
์ด ์ปดํฌ๋ํธ๋ฅผ ์ฌํ์ฉํ ์ ์์๊น์? |
@@ -0,0 +1,55 @@
+import { createComponent, currentComponent } from "../createComponent";
+import { fetchMovies } from "../fetch";
+import { useState } from "../state";
+import { MovieCard } from "./MovieCard";
+
+export async function MovieList() {
+ const [page, setPage] = useState(1);
+
+ const movieData = await f... | JavaScript | ๋ชจ๋ ๊ตฌ๊ฐ์ด ๋ค async/await ์ผ๋ก ๋ง๋ค์ด์ง ์ด์ ๊ฐ ์ฌ๊ธฐ์ ์ถ๋ฐ์ด ๋๋ค์.
์ด ๋ถ๋ถ๋ง ๊ฐ์ ํ๋ฉด async/awiat ์ ์ ์ฒด์ ์ผ๋ก ์ ๊ฑฐํ ์ ์์ง ์์๊น์? |
@@ -0,0 +1,55 @@
+import { createComponent, currentComponent } from "../createComponent";
+import { fetchMovies } from "../fetch";
+import { useState } from "../state";
+import { MovieCard } from "./MovieCard";
+
+export async function MovieList() {
+ const [page, setPage] = useState(1);
+
+ const movieData = await f... | JavaScript | movieData๋ฅผ props๋ก ๋ฐ์์ค๋ฉด ์ด๋จ๊น์? |
@@ -0,0 +1,13 @@
+export async function fetchMovies({ page }) {
+ const baseUrl = "https://api.themoviedb.org/3/movie/popular";
+ const param = new URLSearchParams({
+ page,
+ language: "ko-KR",
+ });
+
+ const response = await fetch(`${baseUrl}?${param}`, {
+ headers: { authorization: `Bearer ${process.en... | JavaScript | ์ฌ์ค ๋ฐฐํฌ๋ ์ฌ์ดํธ์ ๋คํธ์ํฌ ์์ฒญ์ ๊น๋ณด๋ฉด API_KEY ๊ฐ ๊ทธ๋๋ก ๋
ธ์ถ๋๋๊ฑธ ํ์ธํ ์ ์๋ต๋๋ค ใ
ใ
์ด๊ฑด ์ด๋ป๊ฒ ๋ฐฉ์งํ ์ ์์๊น์? |
@@ -0,0 +1,13 @@
+export async function fetchMovies({ page }) {
+ const baseUrl = "https://api.themoviedb.org/3/movie/popular";
+ const param = new URLSearchParams({
+ page,
+ language: "ko-KR",
+ });
+
+ const response = await fetch(`${baseUrl}?${param}`, {
+ headers: { authorization: `Bearer ${process.en... | JavaScript | ์ฌ๊ธฐ์ await์ ์ฌ์ฉํ๋ ๊ฒ๊ณผ ์ฌ์ฉํ์ง ์๋๊ฒ ์ด๋ค ์ฐจ์ด๊ฐ ์๋์ง ํน์ ์์ค๊น์~? |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | description์ ์์ด๋ ๋์ง ์์๊น์? ์ ๋ชจ๋ฅด๊ฒ ์ต๋๋ค ใ
ใ
|
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | https://www.notion.so/wecode/React-Refactoring-Check-List-aea297cf88ed4601b769e4b2c2cfd4e1#089493d6bfca438aa328226e327cff92
์ด ๋ถ๋ถ์ ์ฐธ๊ณ ํ๋ฉด ํ๋์ ๋ฉ์๋๋กค ๋ฌถ์ ์ ์์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ์ด ๋ถ๋ถ์ common.css์ ์์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | font-family๊ฐ์ ์์ฑ์ width๋ margin์๋์ ์์ผ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | ๋ณ์๋ช
์ด ๋ช
์์ ์ด์ฌ์ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค.! |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | ```suggestion
inputKeyPress= (e) => {
```
๊ฐ์ ์ด๋ฆ์ ์ด๋จ๊น์? ๋ฉ์๋๊ฐ ๋ง์์ง๋ฉด ํท๊ฐ๋ฆด ์ ์์ ๊ฑฐ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | ```suggestion
.nav_center {
```
๊ฐ์ด ๋์ด์ฐ๊ธฐ๋ฅผ '-'๋ '_'๋ก ํ์ํด์ฃผ๋ฉด ์์ฑ์ฝ๊ธฐ๊ฐ ๋ ์์ํด ์ง ๊ฑฐ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | scss์ nesting์ ๊ต์ฅํ ์ ์ ์ฉํ์ ๊ฒ ๊ฐ์์
์ด๋ฌ๋ฉด ๋์ค์ component๋จ์๋ก ๋๋ ๋ ๋ ํธํ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | ```suggestion
```
๋น์นธ์ ์ค์ด๋ ๊ฒ๋ ์ข์ ์ต๊ด์ด๋ผ๊ณ ํ๋ค์! |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๋ ๋ํ
์ผํ css ์์ฑ๊ฐ .. ์ฌ์๋ ๋
ธ๊ณ ์ ๊ฒฝ์๋ฅผ..๐๐ป |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | target ๋ณด๋ค๋ ์ง๊ด์ ์ธ ํค๋ค์์ผ๋ก ๋ณ๊ฒฝํ๋ฉด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | - ํ๋์ ์์์ ์ฌ๋ฌ๊ฐ์ง ์์ฑ์ ๋ถ์ฌํ๋ ๊ฒฝ์ฐ ์ค์๋, ๊ด๋ จ๋์ ๋ฐ๋ผ์ ๋๋ฆ์ convention์ ์ง์ผ์ ์์ฑํ๋ ๊ฒ์ด ์ข์ต๋๋ค.
- ์ผ๋ฐ์ ์ธ convention ์ ์๋์ ๊ฐ์ต๋๋ค. ์๋์ ๊ฐ์ด ์์ ์ ์ฉํด์ฃผ์ธ์.
[CSS property ์์]
- Layout Properties (position, float, clear, display)
- Box Model Properties (width, height, margin, padding)
- Visual Properties (color, background, border, box-shadow)
... |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | meta ํ๊ทธ์ ์ข
๋ฅ๊ฐ ๋ง๊ธฐ ๋๋ฌธ์ ์ด๋ค ๋ฐ์ดํฐ์ธ์ง ๋ช
์ํ๋ ์ฐจ์์์๋ ์๋ ๊ฒ์ด ์ข์ ๊ฒ ๊ฐ์ต๋๋ค! |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | ๋ถํ์ํ ์ํฐ ์ฒ๋ฆฌ๋ ์ญ์ ํด์ฃผ์ธ์! |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | Import ์์ ์์ ํด์ฃผ์ธ์! ์ผ๋ฐ์ ์ธ convention์ ๋ฐ๋ฅด๋ ์ด์ ๋ ์์ง๋ง ์์๋ง ์ ์ง์ผ์ฃผ์
๋ ๊ฐ๋
์ฑ์ด ์ข์์ง๋๋ค. ์๋ ์์ ์ฐธ๊ณ ํด์ฃผ์ธ์.
- React โ Library(Package) โ Component โ ๋ณ์ / ์ด๋ฏธ์ง โ css ํ์ผ(scss ํ์ผ) |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | ```js
// render ์๋์์
const isBtnAble = idValue.includes('@') && psValue.length > 5;
<button disabled={!isBtnAble} />
```
- ์ด๋ฐ์์ผ๋ก ๋ณ์๋ฅผ ํ์ฉํ๋ฉด ์ข ๋ ๊น๋ํด์ง ์ ์๊ฒ ๋ค์!
- Boolean ๋ฐ์ดํฐ๋ฅผ ์ฌ์ฉํ๋ ๊ฒฝ์ฐ์๋ ๊ตณ์ด true, false ํ์ํด์ค ํ์ ์์ต๋๋ค! (์ผํญ ์ฐ์ฐ์ ์กฐ๊ฑด์ ํด๋น๋๋ ๋ถ๋ถ์ด ์ด๋ฏธ t/f ๊ฐ์ ๊ฐ๊ธฐ ๋๋ฌธ์) |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๊ฐ๋
์ฑ์ ์ํด selector ์ฌ์ด์ ํ ์ค ๋์์ฃผ์๋ฉด ์ข์ต๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๊ณตํต๋๋ ์์ฑ์ด ๋ง์ด ๋ณด์ด๋ค์! ์ค์ฌ๋ด
์๋ค ๐ ํ๋์ ์์์ ๋ณต์์ className์ ๋ถ์ฌํ ์ ์์ต๋๋ค. |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | addComment์ ๊ฐ์ด ๊ธฐ๋ฅ์ ์๋ฏธ๊ฐ ๋ค์ด๋๋ ์ด๋ฆ์ผ๋ก ํจ์๋ช
์ ์์ฑํด์ฃผ์ธ์! |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | - ํด๋น ํ์ผ์ ๋ฐ์ดํฐ๋ฅผ ๋ฐฐ์ด๋ก ๋ง๋ค์ด์ map ํจ์ ์ ์ฉํ๋ฉด ์ข์ ๋ถ๋ถ์ด ๋ง์ด ๋ณด์ด๋ค์! ์ฐ์ ์ด ๊ฒ ๋ถํฐ ์์ ํด๋ณด์๊ธฐ ๋ฐ๋๋๋ค.
- https://www.notion.so/wecode/React-Refactoring-Check-List-aea297cf88ed4601b769e4b2c2cfd4e1#ef5cf308f13f48458f69175875c239e9 |
@@ -0,0 +1,17 @@
+import React from 'react';
+import './CommentComponent.scss';
+
+class CommentComponent extends React.Component {
+ render() {
+ const { key, name, comment} = this.props
+ return (
+ <li className="CommentComponent">
+ {key}
+ <strong>{name}</strong>
+ {comment... | JavaScript | commentList๋ ul ํ๊ทธ๋ฅผ ์๋ฏธํ๋ ๊ฒ ๊ฐ์์ props ์ด๋ฆ์ comment๋ก ํ๋๊ฒ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -0,0 +1,412 @@
+* {
+ margin: 0;
+ padding: 0;
+}
+nav {
+ position: fixed;
+ width: 100%;
+ top: 0px;
+ left: 0px;
+ right: 0px;
+ background-color: #fff;
+ border-bottom: 1px solid #dbdbdb;
+ .navcontents {
+ width: 935px;
+ height: 54px;
+ background-color: #fff;
+ margin: 0 auto;
+ ... | Unknown | ์ ์ฒด์ ์ผ๋ก camelCase, snake_case ํผ์ฉํด์ ์ฌ์ฉํ๊ณ ๊ณ์ ๋ฐ ๋ค์์๋ ํ์๋ค๊ณผ ์ ํ ๊ท์น๋๋ก ์ ์ฉํด์ฃผ์ธ์! ์ต์ํ ๋ด๊ฐ ์์ฑํ ์ฝ๋ ์์์๋ ์ผ๊ด์ฑ์ด ์์ด์ผ ํฉ๋๋ค. |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ๋ต! ์๊ฒ ์ต๋๋ค! |
@@ -3,7 +3,10 @@
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
- <title>React App</title>
+ <meta name="description" content="Web site created using create-react-app"/>
+ <link href="https://fonts.googleapis.com/css2?family=Lobster&display=s... | Unknown | ์ญ์ ํ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | ์์ ํ์ต๋๋ค! |
@@ -0,0 +1,50 @@
+import React from 'react';
+import { withRouter } from 'react-router-dom';
+import './Login.scss';
+
+
+class LoginJaeyoung extends React.Component {
+ constructor () {
+ super();
+ this.state = {
+ id: '',
+ pw : '',
+ };
+ }
+
+ handleInput = (e) ... | JavaScript | ์...์์ ํ์ต๋๋ค! |
@@ -0,0 +1,85 @@
+* {
+ box-sizing: border-box;
+}
+
+.loginContainer {
+ border: 2px solid #e6e6e6;
+ width: 350px;
+ height: 380px;
+ margin: 0 auto;
+ .logoName {
+ display: flex;
+ justify-content: center;
+ align-items: center;
+ width: 100%;
+ h1 {
+ font-family: "Lobster",... | Unknown | ์์ ํ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋น |
@@ -0,0 +1,190 @@
+import React from 'react';
+import FeedComponent from './FeedComponent/FeedComponent';
+import './Main.scss';
+import explore from '../../../images/jaeyoungLee/Main/explore.jpg';
+import heart from '../../../images/jaeyoungLee/Main/heart.jpg';
+import profile from '../../../images/jaeyoungLee/Main/pr... | JavaScript | ์์ ํ์ต๋๋ค! ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ๋ ์ง ๊ด๋ จ๋ ๋ก์ง์ `LocalDate`์ `DayOfWeek`๋ฅผ ์ ์ฉํ๋ฉด ํจ์ฌ ๊ฐ๊ฒฐํ๊ฒ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ต๋๋ค!! |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ํด๋น ๋ก์ง์ depth๊ฐ 3์ด๊ธฐ์ ์ ์ ํ ๋ฉ์๋ ์ถ์ถ, ๋๋ ๋ฆฌํฉํ ๋ง์ด ํ์ํ ๊ฒ ๊ฐ์๋ฐ์.
์ฃผ๋ง์ ํ์ธํ๊ธฐ ์ํด์ ๋ชจ๋ `Calandar`์ `enum` ์์๋ฅผ ํ์ํ ํ์๋ ์์ ๊ฒ ๊ฐ์ต๋๋ค.
๋ํ, ์คํธ๋ฆผ์ ์ฌ์ฉํ๋ค๋ฉด ๋๋ก ์ฒด์ธ๋ค๋ก ๊ฐ๊ฐ์ ๋จ๊ณ๊ฐ ๊ตฌ๋ถ๋๊ธฐ์ ๊ฐ๋
์ฑ์ด ์ข์์ง๊ธฐ๋ ํ๋ ์คํธ๋ฆผ์ ์ ๊ทน ํ์ฉํ์๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค!
```suggestion
return Arrays.stream(WEEKEND.days)
.anyMatch(day -> day == date);
``` |
@@ -0,0 +1,37 @@
+package christmas.domain;
+
+import java.util.Arrays;
+
+public enum Menu {
+ ์์ก์ด์ํ(6_000), ํํ์ค(5_500), ์์ ์๋ฌ๋(8_000),
+ ํฐ๋ณธ์คํ
์ดํฌ(55_000), ๋ฐ๋นํ๋ฆฝ(54_000), ํด์ฐ๋ฌผํ์คํ(35_000), ํฌ๋ฆฌ์ค๋ง์คํ์คํ(25_000),
+ ์ด์ฝ์ผ์ดํฌ(15_000), ์์ด์คํฌ๋ฆผ(5_000),
+ ์ ๋ก์ฝ๋ผ(3_000), ๋ ๋์์ธ(60_000), ์ดํ์ธ(25_000);
+
+ private final int price;
+... | Java | ์ด ๊ฒฝ์ฐ ๋ฉ๋ด์ ์ถ๊ฐ ๋ฐ ๋ณ๊ฒฝ์ด ์์ ๋ ๋ง๋ค ๋ฉ์๋ ๋ก์ง์ ๋ณ๊ฒฝ ๋ํ ํจ๊ป ๋ฐ์ํด์ผ ํ๋๋ฐ์.
๊ฐ ๋ฉ๋ด์ ์ ๋ณด๊ฐ ๋ฉ๋ด ํ์
์ ํจ๊ป ์ ์ฅํ๊ณ ์๊ฑฐ๋, ๋ฉ๋ด ํ์
์ด ๋ฆฌ์คํธ ํ์์ผ๋ก ๋ฉ๋ด๋ค์ ์ ์ฅํ๊ณ ์๋๋ก ํ๋ฉด `public boolean isTypeOf(MenuType expectedType)`๊ณผ ๊ฐ์ ๋ฉ์๋ ํ๋๋ง ์ ๊ณตํด ์ฃผ๋ ๊ฒ์ผ๋ก ๋ณํ์ ์ฝ๊ฒ ๋์ํ ์๊ฐ ์์ด์! |
@@ -0,0 +1,24 @@
+package christmas.domain;
+
+public enum DiscountType {
+ MIN_EVENT_CONDITION(10000),
+ CHAMPAGNE_CONDITION(120000),
+ CHAMPAGNE(25000),
+ SERVICE_MENU_CONDITION(1),
+ DDAY_CONDITION(25),
+ BASE_AMOUNT(900),
+ DAY_BONUS(100),
+ SPECIALDAY_CONDITION(2023),
+ INIT_COUNT(0),
+ ... | Java | ์ซ์์ ์๋ฆฌ์๊ฐ ๋ง์์ง๋ค๋ฉด _ ์ผ๋ก ์๋ฆฌ์ ๊ตฌ๋ถ์ด ๊ฐ๋ฅํฉ๋๋ค!
```suggestion
CHAMPAGNE_CONDITION(120_000),
``` |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | `InputView`์ ์กด์ฌํ๋ ์ฝ๋ ํ๋ฆ์ ์ค๋ณต์ ๋ค์๊ณผ ๊ฐ์ด ์ ๊ฑฐํ ์ ์์ต๋๋ค!
๋์ ํ๋ผ๋ฏธํฐํ๋ก ๋ณ๊ฒฝ์ด ํ์ํ ๋ก์ง์ ๋ถ๋ถ๋ง ์ค๋ณต๋๋ ํ๋ฆ ์ฌ์ด์ ์ ๋ฌํด ์ฃผ๋ ๋ฐฉ์์ด์์!
```suggestion
public static Order createOrder() {
return getResult(() -> {
String input = Console.readLine();
Validator.isValidOrderFormat(input);
Map<Menu, Intege... |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | `View`์์ ๋๋ฉ์ธ ํด๋์ค ์์ฒด๊ฐ ์์ฑ๋์ด ๋ฐํ๋๋ ๊ฒ์ด `View` ํด๋์ค์ ๋๋ฌด ๋ง์ ์ฑ
์์ด ์กด์ฌํ๋ ๊ฒ ์ฒ๋ผ ๋ณด์ด๊ธฐ๋ ํ๋๋ฐ ์ด ๋ถ๋ถ์ ๋ํด์ ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,48 @@
+package christmas.view.messages;
+
+public enum PrintMessage {
+ INPUT_INTRODUCE("์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น 12์ ์ด๋ฒคํธ ํ๋๋์
๋๋ค."),
+ INPUT_RESERVATION("12์ ์ค ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ ์ธ์ ์ธ๊ฐ์? (์ซ์๋ง ์
๋ ฅํด ์ฃผ์ธ์!)"),
+ INPUT_ORDER("์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ-1,์ด์ฝ์ผ์ดํฌ-1)"),
+
+ OUTPUT_RESULT("12์ 26์ผ์ ์ฐํ
์ฝ ์๋น์์... | Java | ์ฌ๋ฌ ์ค๋ก ๊ตฌ์ฑ๋ `String`์ `"""`๋ก ๊ฐ์ธ์ค ์ ์๋ ๊ฒ์ผ๋ก ์๊ณ ์์ต๋๋ค! |
@@ -0,0 +1,150 @@
+package christmas.validator;
+
+import christmas.domain.Menu;
+import christmas.exception.ErrorMessage;
+import christmas.exception.ValidatorException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.uti... | Java | ํด๋น ๋ก์ง์ 26๋ผ์ธ์ผ๋ก ๊ตฌ์ฑ๋์ด ์์ด์.
๊ฐ ๋จ๊ณ๋ฅผ ๋ฉ์๋๋ก ์ถ์ถํด ๋ณด๋ ๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ์๊ฐํ์ง ๋ชปํ๋ ๋ถ๋ถ์ธ๋ฐ ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | ํ.. ๊ทธ๋ ์ง ์์๋ Stream์ ๋ํด ๊ณ์ ๊ณต๋ถํ๊ณ ์๋๋ฐ ๋ณต์ตํ๋ฉฐ ์ ์ฉํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,24 @@
+package christmas.domain;
+
+public enum DiscountType {
+ MIN_EVENT_CONDITION(10000),
+ CHAMPAGNE_CONDITION(120000),
+ CHAMPAGNE(25000),
+ SERVICE_MENU_CONDITION(1),
+ DDAY_CONDITION(25),
+ BASE_AMOUNT(900),
+ DAY_BONUS(100),
+ SPECIALDAY_CONDITION(2023),
+ INIT_COUNT(0),
+ ... | Java | ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,37 @@
+package christmas.domain;
+
+import java.util.Arrays;
+
+public enum Menu {
+ ์์ก์ด์ํ(6_000), ํํ์ค(5_500), ์์ ์๋ฌ๋(8_000),
+ ํฐ๋ณธ์คํ
์ดํฌ(55_000), ๋ฐ๋นํ๋ฆฝ(54_000), ํด์ฐ๋ฌผํ์คํ(35_000), ํฌ๋ฆฌ์ค๋ง์คํ์คํ(25_000),
+ ์ด์ฝ์ผ์ดํฌ(15_000), ์์ด์คํฌ๋ฆผ(5_000),
+ ์ ๋ก์ฝ๋ผ(3_000), ๋ ๋์์ธ(60_000), ์ดํ์ธ(25_000);
+
+ private final int price;
+... | Java | ์ข ๋ ๊ฐ์ฒด์งํฅ์ ์ผ๋ก ์ค๊ณ๊ฐ ๊ฐ๋ฅํ ๋ถ๋ถ์ด๋ค์. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,150 @@
+package christmas.validator;
+
+import christmas.domain.Menu;
+import christmas.exception.ErrorMessage;
+import christmas.exception.ValidatorException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.uti... | Java | 15๋ผ์ธ์ผ๋ก ์ค์ด๋๋ก ๋
ธ๋ ฅํด๋ณด๊ฒ ์ต๋๋ค. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | ์ต๊ทผ์ ๊ณต๋ถํ๋ฉฐ View๋ ์ปจํธ๋กค๋ฌ์์ Model์ ๋ฐ๊ธฐ๋ง ํด์ผ ํ๋ค๋ ์๊ฐ์ด ๋ค์์ต๋๋ค. ์ด ๋น์์๋ View์์ Model์ ์์ฑํด์ ๋ฐํํ๋ ๋ฐฉ๋ฒ์ด ์ ๋ ๋ง๋๊ฑด๊ฐ? ์๊ฐ์ ํ์๋๋ฐ ๊ฐ๋ง ๋ฐํํด์ฃผ๋ ํ์์ผ๋ก ์์ ํด๋ด์ผ๊ฒ ๋ค์. ๊ฐ์ฌํฉ๋๋ค. |
@@ -0,0 +1,36 @@
+package christmas.view;
+
+import camp.nextstep.edu.missionutils.Console;
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.exception.ValidatorException;
+import christmas.validator.Validator;
+import java.util.Map;
+
+public class I... | Java | ํ ์ด๋ฐ์์ผ๋ก ์ฝ๋๋ฅผ ์์ฑํ ์ ์๊ตฐ์. ์๋ ค์ฃผ์
์ ๊ฐ์ฌํฉ๋๋ค. ์ข ๋ ๊ณต๋ถํด์ ์ ์ฉํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค! |
@@ -0,0 +1,48 @@
+package christmas.view.messages;
+
+public enum PrintMessage {
+ INPUT_INTRODUCE("์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น 12์ ์ด๋ฒคํธ ํ๋๋์
๋๋ค."),
+ INPUT_RESERVATION("12์ ์ค ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ ์ธ์ ์ธ๊ฐ์? (์ซ์๋ง ์
๋ ฅํด ์ฃผ์ธ์!)"),
+ INPUT_ORDER("์ฃผ๋ฌธํ์ค ๋ฉ๋ด๋ฅผ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์๋ ค ์ฃผ์ธ์. (e.g. ํด์ฐ๋ฌผํ์คํ-2,๋ ๋์์ธ-1,์ด์ฝ์ผ์ดํฌ-1)"),
+
+ OUTPUT_RESULT("12์ 26์ผ์ ์ฐํ
์ฝ ์๋น์์... | Java | ์! ๊น๋จน๊ณ ์์๋ค์. ๊ฐ์ฌํฉ๋๋ค! |
@@ -0,0 +1,15 @@
+package christmas.controller;
+
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.domain.Result;
+
+public class EventPlannerController {
+ public static void run() {
+ Reservation reservation = ReservationController.inputReservation();
+ Order or... | Java | ์ด๋ค ์ด์ ๋ก static ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์
จ์๊น์?
static๋ฉ์๋๋ฅผ ์ฌ์ฉํ๋ฉด ํธ๋ฆฌํ ์ ์๋๋ฐ ๋ค๋ฅธ ์ฌ์ด๋ ์ดํํธ๊ฐ ์์๊น์? |
@@ -0,0 +1,20 @@
+package christmas.controller;
+
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.domain.Result;
+import christmas.view.OutputView;
+
+public class ResultController {
+
+ public static Result createResult(Order order, Reservation reservation) {
+ OutputV... | Java | ์ฌ๋ฌ ์ปจํธ๋กค๋ฌ ํด๋์ค๋ฅผ ๋ถ๋ฆฌํ์ ์ด์ ๊ฐ ๋ฌด์์ธ๊ฐ์? |
@@ -0,0 +1,50 @@
+package christmas.domain;
+
+public enum Calendar {
+ WEEKEND(1, 2, 8, 9, 15, 16, 22, 23, 29, 30),
+ WEEKDAY(3, 4, 5, 6, 7, 10, 11, 12, 13, 14, 17, 18, 19, 20, 21, 24, 25, 26, 27, 28, 31),
+ SPECIAL_DAY(3, 10, 17, 24, 25, 31);
+
+ private final int[] days;
+
+ Calendar(int... days) {
+ ... | Java | calendar๋ผ๋ enum์ด 2023๋
12์์ ๋ ์ง๋ง ์์ผ๋ ์กฐ๊ธ ์ด์ํ ๊ฒ ๊ฐ์์ ํด๋์ค ๋ช
์ ์ข ๋ ๋ช
ํํ๊ฒ ํ๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,29 @@
+package christmas.domain;
+
+public enum EventBadge {
+ SANTA(20000, "์ฐํ"),
+ TREE(10000, "ํธ๋ฆฌ"),
+ STAR(5000, "๋ณ"),
+ NONE(0, "์์");
+
+ private final int threshold;
+ private final String description;
+
+ EventBadge(int threshold, String description) {
+ this.threshold = t... | Java | ์ด๊ฒ๋ ์คํธ๋ฆผ์ผ๋ก ํด๊ฒฐํ ์ ์๊ฒ ๋ค์
ํด๋ํฐ์ผ๋ก ํ๋ ๊ฒ์ด๋ผ ์ฝ๋์น๊ธฐ๊ฐ ๋ถํธํด์ ์คํธ๋ฆผ, filter, findAny, orElseGet ์ ์ฌ์ฉํ๋ฉด ๋ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,37 @@
+package christmas.domain;
+
+import java.util.Arrays;
+
+public enum Menu {
+ ์์ก์ด์ํ(6_000), ํํ์ค(5_500), ์์ ์๋ฌ๋(8_000),
+ ํฐ๋ณธ์คํ
์ดํฌ(55_000), ๋ฐ๋นํ๋ฆฝ(54_000), ํด์ฐ๋ฌผํ์คํ(35_000), ํฌ๋ฆฌ์ค๋ง์คํ์คํ(25_000),
+ ์ด์ฝ์ผ์ดํฌ(15_000), ์์ด์คํฌ๋ฆผ(5_000),
+ ์ ๋ก์ฝ๋ผ(3_000), ๋ ๋์์ธ(60_000), ์ดํ์ธ(25_000);
+
+ private final int price;
+... | Java | ์ฌ๊ธฐ๋ง ๋ณ์๋ช
์ ํ๊ธ๋ก ํ์ ์ด์ ๊ฐ ์๋์? ์ ๋ ํ๊ธ ๋ณ์๊ฐ ๊ฐ๋
์ฑ์ด ์ข๋ค๊ณ ์๊ฐํ์ง๋ง ์๋์์ฑ์์ ๋ถํธํ๋๋ผ๊ณ ์
๊ทธ๋ฆฌ๊ณ ์๋์ is~~~ ๋ฉ์๋๊ฐ ๋ง์๋ฐ ๋ฉ๋ด์ ๊ฐ๊ฒฉ๊ณผ ํ์
๋ ๊ฐ์ด ๊ฐ์ง๊ณ ์๋ค๋ฉด ์ข ๋ ๊น๋ํ๊ฒ ์ฝ๋๋ฅผ ์์ฑํ ์ ์์ ๊ฒ ๊ฐ๋ค์ |
@@ -0,0 +1,25 @@
+package christmas.domain;
+
+import christmas.validator.Validator;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+public class Order {
+
+ private Map<Menu, Integer> orderedItems;
+
+ private Order(Map<Menu, Integer> ordered... | Java | ์ ๊ฐ์ ๋ฉ์๋๊ฐ ๋๊ฐ์ผ๊น์? |
@@ -0,0 +1,20 @@
+package christmas.domain;
+
+import christmas.validator.Validator;
+
+public class Reservation {
+ private final int date;
+
+ private Reservation(int date) {
+ Validator.isInRange(date);
+ this.date = date;
+ }
+
+ public static Reservation from(int date) {
+ return n... | Java | ์ฌ๊ธฐ๋ ๊ทธ๋ ๋ค์ ์ด๋ค ์ด์ ๋ก ์์ฑ์๋ฅผ private์ผ๋ก ๋ง์๋์๊ณ static ๋ฉ์๋๋ฅผ ์ฌ์ฉํ์
จ์๊น์ |
@@ -0,0 +1,171 @@
+package christmas.domain;
+
+import static christmas.domain.DiscountType.*;
+
+import java.util.Map;
+
+public class Result {
+
+ private int totalBeforeDiscount;
+ private int serviceMenu;
+ private int dDayDiscount;
+ private int weekdayDiscount;
+ private int weekendDiscount;
+ p... | Java | ํ ๊ฐ์ฒด์ ๋๋ฌด ๋ง์ ํ๋๋ฅผ ์ ์ธํ๋๋ฐ ์ฑ
์์ ๋ถ๋ฆฌํ ์ ์์ง ์์๊น์? |
@@ -0,0 +1,150 @@
+package christmas.validator;
+
+import christmas.domain.Menu;
+import christmas.exception.ErrorMessage;
+import christmas.exception.ValidatorException;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.Map;
+import java.util.Set;
+import java.util.regex.Matcher;
+import java.uti... | Java | validator๋ผ๋ static ๋ฉ์๋๋ง ๊ฐ์ง๊ณ ์๋ ํด๋์ค๋ฅผ ๋ง๋์ ์ด์ ๊ฐ ๊ถ๊ธํฉ๋๋ค |
@@ -0,0 +1,87 @@
+package christmas.domain;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class CalendarTest {
+
+ @DisplayName("ํ์ผ์ ํด๋นํ๋ ๋ ์ง๋ฅผ ์
๋ ฅํ์ ๋ ๊ฒ์ฆ")
+ @Test
+ public void testIsWeekday() {
+ // Given
+ ... | Java | assertJ ๋ผ์ด๋ธ๋ฌ๋ฆฌ๋ฅผ ์ฌ์ฉํ์๋ ๊ฒ์ ์ถ์ฒ๋๋ฆฝ๋๋ค |
@@ -0,0 +1,88 @@
+package christmas.domain;
+
+import static org.junit.jupiter.api.Assertions.*;
+
+import org.junit.jupiter.api.DisplayName;
+import org.junit.jupiter.api.Test;
+
+class MenuTest {
+
+ @DisplayName("์์ก์ด ์ํ ๊ฐ๊ฒฉ ๋์ผํ์ง ๊ฒ์ฆ")
+ @Test
+ public void testGetPrice() {
+ // Given
+ Menu menu... | Java | softAssertion์ด๋ assertAll์ ๋ํด ์์๋ณด์๋ฉด ์ข์ ๊ฒ ๊ฐ์์ |
@@ -0,0 +1,241 @@
+# ๋ฏธ์
- ํฌ๋ฆฌ์ค๋ง์ค ํ๋ก๋ชจ์
๐
+
+## โ
ย ๊ธฐ๋ฅ ๋ชฉ๋ก
+
+### 1. ๊ฒ์ ์์
+
+- [X] ์๋น ์์ ๋ฐฉ๋ฌธ ๋ ์ง๋ฅผ ์
๋ ฅ ๋ฐ๋๋ค.
+ - [X] ๋ฐฉ๋ฌธํ ๋ ์ง๋ 1 ์ด์ 31 ์ดํ์ ์ซ์๋ง ์
๋ ฅ ๋ฐ๋๋ค.
+ - [X] ์๋ชป๋ ๊ฐ์ ์
๋ ฅํ ๊ฒฝ์ฐ ์์ธ ์ฒ๋ฆฌํ๋ค.
+
+- [X] ๊ณ ๊ฐ์๊ฒ ์๋ดํ ์ด๋ฒคํธ ์ฃผ์ ์ฌํญ์ ์ถ๋ ฅํ๋ค.
+
+- [X] ์ฃผ๋ฌธํ ๋ฉ๋ด์ ๊ฐ์๋ฅผ ์
๋ ฅ ๋ฐ๋๋ค.
+ - [X] ๋ฉ๋ดํ์ ์๋ ๋ฉ๋ด๋ฅผ ์
๋ ฅ ์ ์์ธ ์ฒ๋ฆฌํ๋ค.
+ - [X] ๋ฉ๋ด์ ๊ฐ์๋ 1 ์ด์์ ์ซ์๊ฐ ์๋ ๊ฒฝ์ฐ ์์ธ ์ฒ๋ฆฌํ๋ค... | Unknown | ๊ฒ์์ด๋ผ๊ณ ํ์ ์ด์ ๊ฐ ๋ฐ๋ก ์์๊น์? |
@@ -0,0 +1,15 @@
+package christmas.controller;
+
+import christmas.domain.Order;
+import christmas.domain.Reservation;
+import christmas.domain.Result;
+
+public class EventPlannerController {
+ public static void run() {
+ Reservation reservation = ReservationController.inputReservation();
+ Order or... | Java | static ๋ฉ์๋๋ง ์๋ ํด๋์ค๋ผ๋ฉด ์ธ์คํด์ค๋ฅพ ๋ง๋ค ํ์๊ฐ ์์ํ
๋ฐ์, ์ด๋ฅผ ์ด๋ป๊ฒ ๋ฐฉ์งํ ์ ์์๊น์? |
@@ -0,0 +1,117 @@
+package christmas.view;
+
+import static christmas.view.messages.PrintMessage.*;
+
+import christmas.domain.Menu;
+import christmas.domain.Order;
+import christmas.domain.Result;
+import christmas.view.messages.PrintMessage;
+import java.util.Map;
+
+public class OutputView {
+ private static fina... | Java | ๋ถํ์ํ ๊ฐํ์ ์ง์์ฃผ์ธ์..! |
@@ -0,0 +1,21 @@
+import { EOL as LINE_SEPARATOR } from 'os';
+import { TIME, UNITS } from './system.js';
+
+export const OUTPUT_MESSAGES = Object.freeze({
+ intro: `์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น ${TIME.month}${UNITS.month} ์ด๋ฒคํธ ํ๋๋์
๋๋ค.`,
+ outro: `์ผ์ ์ฐํ
์ฝ ์๋น์์ ๋ฐ์ ์ด๋ฒคํธ ํํ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!`,
+});
+
+export const INPUT_MESSAGES = Object.freeze({
+... | JavaScript | ์ด๋ฒคํธ๋ฅผ ์งํํ๋ ๋ฌ์ด ๋ฐ๋๋ ๊ฒ์ ๊ณ ๋ คํด `TIME.month` ์์๋ฅผ ๋ฐ๋ก ์์ฑํ ์ ์ด ์ธ์ ๊น์ด์!
`12์ ์ด๋ฒคํธ ์ฐธ์ฌ ๊ณ ๊ฐ์ 5%๊ฐ ๋ด๋
1์ ์ํด ์ด๋ฒคํธ์ ์ฌ์ฐธ์ฌํ๋ ๊ฒ`
์ด๋ฉ์ผ์ ์ด๋ฌํ ๋ฌธ์ฅ์ด ์ ๋ ๋์ ๋ฐํ๊ธด ํ๋๋ฐ ๊ทธ๋ฅ ๊ธฐ๋ฅ ๊ตฌํ์ ์ง์คํ๋๋ผ ์์ด๋ฒ๋ ธ๊ฑฐ๋ ์..
์ ๋ง ์ฌ์ธํ๊ฒ ๊ณ ๋ฏผํ์๋ฉด์ ๊ตฌํํ์ ๊ฒ ๊ฐ์ต๋๋ค! ๊ฐํ๋ง ๋์ค๋ค์ ๐ฎ |
@@ -0,0 +1,28 @@
+export const TIME = Object.freeze({
+ year: '2023',
+ month: '12',
+ dateFormat: `2023-12-`,
+});
+
+export const PROMOTION_TITLES = Object.freeze({
+ 1: '์ํด',
+ 12: 'ํฌ๋ฆฌ์ค๋ง์ค',
+});
+
+export const SYMBOLS = Object.freeze({
+ comma: ',',
+ dash: '-',
+ colon: ':',
+ blank: '',
+});
+
+export co... | JavaScript | ํ์ฅ์ ๊ณ ๋ คํ์
จ๊ตฐ์! ๋ฐฐ์ฐ๊ณ ๊ฐ๋๋ค ๐
์ค์ ํ์ฌ์๋ค๋ฉด ์ด๋ฒคํธ ๊ธฐํ์๊ฐ ๋๋ฌด ์ข์ํ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,28 @@
+export const TIME = Object.freeze({
+ year: '2023',
+ month: '12',
+ dateFormat: `2023-12-`,
+});
+
+export const PROMOTION_TITLES = Object.freeze({
+ 1: '์ํด',
+ 12: 'ํฌ๋ฆฌ์ค๋ง์ค',
+});
+
+export const SYMBOLS = Object.freeze({
+ comma: ',',
+ dash: '-',
+ colon: ':',
+ blank: '',
+});
+
+export co... | JavaScript | ๊ทธ๋ฅ ๊ฐํ๋ง ๋์ค๋ค์... ํ ๋ง์ด ์๋ค์... ์ต์ข
์ฝํ
์ด๋ฐ๋ถ์ด ๊ฐ์๋๊ตฌ๋... |
@@ -0,0 +1,87 @@
+import VisitDate from '../domain/VisitDate.js';
+import Order from '../domain/Order.js';
+import InputView from '../views/InputView.js';
+import OutputView from '../views/OutputView.js';
+import EventPlanner from '../domain/EventPlanner.js';
+import Save from '../domain/Save.js';
+
+class EventControl... | JavaScript | ์๋ฌ๋ฉ์์ง ์ถ๋ ฅ ๊ธฐ๋ฅ์ `outputView`๊ฐ ์ฑ
์์ ๋งก๋๋ก ํ๊ตฐ์! ๋ฆฌํฉํ ๋ง ํ ๋ ์ ๋ ๋ฐ์ํด๋ด์ผ๊ฒ ์ต๋๋ค ๐ |
@@ -0,0 +1,32 @@
+import { ERROR_MESSAGES } from '../constants/messages.js';
+import { TIME } from '../constants/system.js';
+import validationErrorHandler from '../errors/index.js';
+import { isPositiveInteger, isValidDate } from '../validators/index.js';
+
+class VisitDate {
+ #visitDate;
+
+ constructor(date) {
+ ... | JavaScript | ๊ธฐ๋ณธ ์ ๊ณต๋๋ `Date` ๊ฐ์ฒด๋ฅผ ํ์ฉํ ์๊ฐ์ ๋ชปํ๋ค์!
์ด๋ ๊ฒ ์ ๋ฐํ ๋ฐฉ๋ฒ๋ ์๋ค๋ ๊ฒ์ ์์๊ฐ๋๋ค ๐ |
@@ -0,0 +1,9 @@
+import { ERROR_MESSAGES } from '../constants/messages.js';
+
+class AppError extends Error {
+ constructor(message) {
+ super(`${ERROR_MESSAGES.prefix} ${message}`);
+ }
+}
+
+export default AppError; | JavaScript | ์๋ฌ๋ฅผ ์์ํ์
จ๊ตฐ์! ์ ๋ง ์ฒด๊ณ์ ์ธ ์ฝ๋์ธ ๊ฒ ๊ฐ์์!
`Error`๋ฅผ ์์ํด `AppError` ํด๋์ค๋ฅผ ๋ฐ๋ก ๋ง๋์๊ฒ ๋ ๊ณ๊ธฐ๋ฅผ ์ฌ์ญค๋ด๋ ๋ ๊น์? |
@@ -0,0 +1,12 @@
+import MENUS from '../constants/menus.js';
+
+/**
+ * ๋ฉ๋ด ์ด๋ฆ์ ์
๋ ฅํ๋ฉด ์นดํ
๊ณ ๋ฆฌ ๋ด ๋ฉ๋ด์ ๊ฐ๊ฒฉ ๊ฐ์ ๋ฐํ
+ * @param {string} menu - ๋ฉ๋ด ์ด๋ฆ
+ * @returns {number | undefined}
+ */
+const menuPriceFinder = menu => {
+ return Object.values(MENUS).find(category => menu in category)[menu];
+};
+
+export default menuPriceFinde... | JavaScript | ๊ธฐ๋ฅ์ ๊ตฌํํ๋ค๋ณด๋ฉด ๋ฉ๋ด์ ๊ฐ๊ฒฉ์ ์์ฃผ ๊ฐ์ ธ๋ค ์ฐ๊ฒ ๋๋๋ฐ utils ํด๋์ ๋ฐ๋ก ํจ์๋ฅผ ๊ตฌํํด๋๋ ์ข์ ๊ฒ ๊ฐ์์!
๋ฐฐ์๊ฐ๋๋ค ๐ |
@@ -0,0 +1,15 @@
+import { UNITS } from '../constants/system.js';
+
+/**
+ * number type์ ๊ฐ๊ฒฉ์ ์
๋ ฅ๋ฐ์ ๊ฐ๊ฒฉ์ ๋ณํ ํ '์'์ ํฌํจํ string type์ผ๋ก ๋ณํ
+ * 20000์ด๋ผ๋ ๋งค๊ฐ๋ณ์๋ฅผ ํตํด '20,000์'์ ๋ฐํ
+ * @param {number} price ๊ฐ๊ฒฉ
+ * @returns {string}
+ */
+const priceFormatter = price => {
+ const formattedPrice = new Intl.NumberFormat().format(pr... | JavaScript | `Intl.NumberFormat` ๋ฅผ ์ฒ์ ์ ํ๋๋ฐ ์ด๋ ๊ฒ ๊ฐ๊ฒฉ์ ํฌ๋งทํ๋ ๊ฐ๋จํ ๋ฐฉ๋ฒ์ด ์์๊ตฐ์!
์ ๋ ์ ๊ทํํ์์ผ๋ก ๊ตฌํํ๋๋ฐ ์๋ก์ด ๋ฐฉ๋ฒ์ ์์๊ฐ๊ฒ ๋ผ์ ์ข์์! |
@@ -0,0 +1,68 @@
+import { ERROR_MESSAGES } from '../constants/messages.js';
+import { SYMBOLS } from '../constants/system.js';
+import validationErrorHandler from '../errors/index.js';
+import { isValidMenuName } from '../validators/index.js';
+import { isOnlyBeverage } from '../validators/is-valid-menu/name.js';
+imp... | JavaScript | ๋ฉ์๋ ์์๋ฅผ ์ ์ ํ์
์ ์ดํดํ๊ธฐ ์ ๋ง ์ข์์ต๋๋ค!
์ด, ์ด ๋ฉ์๋๋ ๋ญ์ง? ์ถ์ผ๋ฉด ๋ฐ๋ก ๋ฐ์ ๊ทธ ๋ฉ์๋๊ฐ ์์ด์ ์ ์ ์ฝํ์ด์!
๋ฉ์๋ ์์๋ ์ปจ๋ฒค์
์ด๋ผ๊ณ ํ๋ ๊ณตํต ํผ๋๋ฐฑ์ด ์์๋๋ฐ ๊ทธ๊ฑธ ์ ๋ฐ์ํ์ ๊ฒ ๊ฐ์์ ๐ |
@@ -0,0 +1,57 @@
+import { GIVEAWAYS, TITLES } from '../constants/events.js';
+import { NONE } from '../constants/system.js';
+import menuPriceFinder from '../utils/menuPriceFinder.js';
+
+class Benefit {
+ #isFitGiveaway;
+
+ #benefitList;
+
+ #totalPrice;
+
+ constructor(discountList, isFitGiveaway) {
+ this.#... | JavaScript | 3์ฃผ์ฐจ ๊ณตํต ํผ๋๋ฐฑ์ `ํ๋์ ์๋ฅผ ์ค์ด๊ธฐ ์ํด ๋
ธ๋ ฅํ๋ค`๋ผ๋ ๋ง์ด ์์์ฃ !
`#benefitList`์ `#totalPrice`๋
์์ฑ์์ ์ธ์๋ก ์ ๋ฌ๋ `discountList`, `isFitGiveaway`์ผ๋ก ๋ง๋ค ์ ์๊ธฐ ๋๋ฌธ์
๊ผญ ํ๋๋ก ์ ์ธํด์ผ ํ๋ ๊ฑด์ง์ ๋ํ ์๋ฌธ์ด ์๊น๋๋ค!
ํ๋์ ๊ฐ์๋ฅผ ์ต๋ํ ์ค์ด๋ ๊ฒ ์ ๋ง ์ณ์ ๊ฒ์ธ์ง ๊ณ ๋ฏผ์ด ๋ง์์ง๋ค์
ํฌํ๋ ์๊ฐ์ ์ด๋ ์ ๊ฐ์?! |
@@ -0,0 +1,106 @@
+import { BADGES, GIVEAWAYS } from '../constants/events.js';
+import { NONE } from '../constants/system.js';
+import menuPriceFinder from '../utils/menuPriceFinder.js';
+import Benefit from './Benefit.js';
+import Discount from './Discount.js';
+
+class EventPlanner {
+ #benefit;
+
+ #preTotalPrice;... | JavaScript | `switch`๋ฌธ์ ์ฌ์ฉํ๋ ์ ๋ง ๊น๋ํ ๊ฒ ๊ฐ์์! |
@@ -0,0 +1,43 @@
+import fs from 'fs';
+import { FILE_PATH } from '../constants/system.js';
+
+class Save {
+ #eventPlanner;
+
+ #filePath;
+
+ constructor(eventPlanner) {
+ this.#eventPlanner = eventPlanner;
+ this.#filePath = FILE_PATH;
+ this.#writeData();
+ }
+
+ // ๊ธฐ์กด JSON ๋ฐ์ดํฐ์ ์ ๊ท ๋ฐ์ดํฐ๋ฅผ ์ถ๊ฐํ๊ณ ์ ์ฅ
+ #wr... | JavaScript | ๋ฐฉ๋ฌธํ ์๋๋ค์ ๋ํ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ๋ ๊ธฐ๋ฅ์ ์๊ฐ ๋ชป ํ๋๋ฐ
๋๋ฌด ์ข์ ์์ด๋์ด์
๋๋ค โจ |
@@ -0,0 +1,21 @@
+import { EOL as LINE_SEPARATOR } from 'os';
+import { TIME, UNITS } from './system.js';
+
+export const OUTPUT_MESSAGES = Object.freeze({
+ intro: `์๋
ํ์ธ์! ์ฐํ
์ฝ ์๋น ${TIME.month}${UNITS.month} ์ด๋ฒคํธ ํ๋๋์
๋๋ค.`,
+ outro: `์ผ์ ์ฐํ
์ฝ ์๋น์์ ๋ฐ์ ์ด๋ฒคํธ ํํ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!`,
+});
+
+export const INPUT_MESSAGES = Object.freeze({
+... | JavaScript | ์ด๋ฒ ๋ฏธ์
์์๋ ํ์ฅ์ฑ์ ์ ๊ฒฝ์ฐ๊ณ ์ ๋
ธ๋ ฅํ๋๋ฐ ์์๋ด์ฃผ์
์ ๊ฐ์ฌํ ๋ฐ๋ฆ์
๋๋ค! ๐ |
@@ -0,0 +1,32 @@
+import { ERROR_MESSAGES } from '../constants/messages.js';
+import { TIME } from '../constants/system.js';
+import validationErrorHandler from '../errors/index.js';
+import { isPositiveInteger, isValidDate } from '../validators/index.js';
+
+class VisitDate {
+ #visitDate;
+
+ constructor(date) {
+ ... | JavaScript | ์๋ง ๋ ์ข์ ๋ฐฉ๋ฒ์ด ์์๊ฒ๋๋ค! :) ์ ๋ `Date` ๊ฐ์ฒด๋ฅผ ์ ํ์ฉํ์ง ๋ชปํ ๊ฒ ๊ฐ์์ ๋ ๊ณต๋ถํด๋ณด๋ ค๊ตฌ์! |
@@ -0,0 +1,9 @@
+import { ERROR_MESSAGES } from '../constants/messages.js';
+
+class AppError extends Error {
+ constructor(message) {
+ super(`${ERROR_MESSAGES.prefix} ${message}`);
+ }
+}
+
+export default AppError; | JavaScript | ์๋ฌด๋๋ `[ERROR]` ๋ผ๋ prefix๋ฅผ ํตํด ์๋ฌ ๋ฉ์์ง๋ฅผ ์ ์ํ๋ ๊ณผ์ ์์ ๋ง๋ค๊ฒ ๋์๋๋ฐ์, ์ง์ ์๋ฌ ํด๋์ค๋ฅผ ์ฌ์ฉํ๋ฉด ์ถํ์ ๋ ์ฝ๊ฒ ํ์ฅํ ์ ์๋ ์ฅ์ ์ด ์์ง ์์๊น๋ผ๋ ์๊ฐ์ด์์ต๋๋ค! |
@@ -0,0 +1,15 @@
+import { UNITS } from '../constants/system.js';
+
+/**
+ * number type์ ๊ฐ๊ฒฉ์ ์
๋ ฅ๋ฐ์ ๊ฐ๊ฒฉ์ ๋ณํ ํ '์'์ ํฌํจํ string type์ผ๋ก ๋ณํ
+ * 20000์ด๋ผ๋ ๋งค๊ฐ๋ณ์๋ฅผ ํตํด '20,000์'์ ๋ฐํ
+ * @param {number} price ๊ฐ๊ฒฉ
+ * @returns {string}
+ */
+const priceFormatter = price => {
+ const formattedPrice = new Intl.NumberFormat().format(pr... | JavaScript | `Intl.NumberFormat` ์์ฑ์๋ฅผ ํตํด ๋ค์ํ ํตํ ์์์ ๋ณํํ ์ ์๋๋ผ๊ตฌ์!
[Intl.NumberFormat](https://developer.mozilla.org/ko/docs/Web/JavaScript/Reference/Global_Objects/Intl/NumberFormat)
๋์์ด ๋ ๊น์ถ์ด ๋งํฌ ์ฒจ๋ถํด๋์์ต๋๋ค :) |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.