code stringlengths 41 34.3k | lang stringclasses 8
values | review stringlengths 1 4.74k |
|---|---|---|
@@ -0,0 +1,125 @@
+import React, { Component } from 'react';
+import { withRouter } from 'react-router-dom';
+import { API } from '../../../config';
+import './Login.scss';
+
+class LoginYeseul extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ inputId: '',
+ inputPw: '',
+ ... | JavaScript | ์๋์์ฌ ์ ๊ฐ ์๋ชฐ๋์ด์ ใ
ใ
ใ
ใ
์ํ์
จ์ด์!! |
@@ -0,0 +1,125 @@
+import React, { Component } from 'react';
+import { withRouter } from 'react-router-dom';
+import { API } from '../../../config';
+import './Login.scss';
+
+class LoginYeseul extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ inputId: '',
+ inputPw: '',
+ ... | JavaScript | ์ ๋ ์ด๋ฒคํธ๋ฅผ ์ค input์ name attribute๋ฅผ ๋ถ์ฌํด์ handleInputId์ด๋ handleInputPw ํจ์๋ฅผ ํ๋๋ก ํฉ์ณค๋๋ฐ ์ฐธ๊ณ ํ์
์ ๋ฐ์ํด๋ ์ข์ ๊ฒ ๊ฐ์์ค!
handleInput = e => {
this.setState({
[e.target.name]: e.target.value,
});
}; |
@@ -0,0 +1,125 @@
+import React, { Component } from 'react';
+import { withRouter } from 'react-router-dom';
+import { API } from '../../../config';
+import './Login.scss';
+
+class LoginYeseul extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ inputId: '',
+ inputPw: '',
+ ... | JavaScript | - API ๋ถ๋ ์ดํ์ src/config.js ํ์ผ์ ๋ง๋ค์ด ํด๋น ํ์ผ์์ ์ผ๊ด์ ์ผ๋ก ๊ด๋ฆฌํฉ๋๋ค.
```js
// config.js
const IP = '10.58.6.252:8000';
export const SIGN_IN_API = `http://${IP}/user/signin`;
// Login.js
import { SIGN_IN_API } from '../../config.js';
...
fetch(SIGN_IN_API).then().then()
...
```
- ์์ ๊ฐ์ด config.js ์์ ์ผ๊ด์ ์ผ๋ก ๊ด๋ฆฌํ ๊ฒฝ์ฐ... |
@@ -0,0 +1,125 @@
+import React, { Component } from 'react';
+import { withRouter } from 'react-router-dom';
+import { API } from '../../../config';
+import './Login.scss';
+
+class LoginYeseul extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ inputId: '',
+ inputPw: '',
+ ... | JavaScript | - ์ ๊ท์ ๐ ๐ |
@@ -0,0 +1,125 @@
+import React, { Component } from 'react';
+import { withRouter } from 'react-router-dom';
+import { API } from '../../../config';
+import './Login.scss';
+
+class LoginYeseul extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ inputId: '',
+ inputPw: '',
+ ... | JavaScript | - ํด๋์ค ๋ค์ ๋ค์ด๋ฐ ๐ |
@@ -0,0 +1,60 @@
+@import '../../../Styles/common.scss';
+
+.loginYeseul {
+ position: fixed;
+ top: 50%;
+ left: 50%;
+ transform: translate(-50%, -60%);
+ padding: 32px 0 25px;
+ width: 350px;
+ text-align: center;
+
+ h1 {
+ font-size: 40px;
+ }
+
+ .login-form {
+ margin: 35px 40px 120px;
+
+ &__... | Unknown | - & ์ฐ์ฐ์ ํ์ฉ ๊ตฟ์
๋๋ค! |
@@ -0,0 +1,55 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+import './Comment.scss';
+
+class Comment extends Component {
+ constructor(props) {
+ super(props);
+ this.state = {
+ isLiked: false,
+ };
+ }
+
+ likeComment = () => {
+ this.setState({ isLiked:... | JavaScript | - id ๊ฐ์ ํ๋ก์ ํธ ์ ์ฒด ๋ด์์ ์ ์ผํด์ผํ๊ธฐ ๋๋ฌธ์, ๊ผญ ํ์ํ ๊ฒฝ์ฐ์๋ง ์ฌ์ฉํด์ฃผ์ธ์!
- id ๋์ ์ onClick ์ด๋ฒคํธ์ ๋ฐ๋ก ์ธ์๋ฅผ ๋๊ฒจ์ฃผ์ค ์๋ ์์ต๋๋ค. ์ฐธ๊ณ ํด์ฃผ์ธ์!
```js
onClick = {() => this.props.handleClick(info.id)}
``` |
@@ -0,0 +1,140 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+import User from '../User/User';
+import Comment from '../Comment/Comment';
+import IconButton from '../Button/IconButton';
+import { API } from '../../../../../config';
+import './Feed.scss';
+
+class Feed extends C... | JavaScript | - get ๋ฉ์๋๋ ๊ธฐ๋ณธ ๋ฉ์๋์ด๊ธฐ ๋๋ฌธ์ ์๋ตํด์ฃผ์ค ์ ์์ต๋๋ค.
```suggestion
fetch('/data/Yeseul/commentData.json')
``` |
@@ -0,0 +1,140 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+import User from '../User/User';
+import Comment from '../Comment/Comment';
+import IconButton from '../Button/IconButton';
+import { API } from '../../../../../config';
+import './Feed.scss';
+
+class Feed extends C... | JavaScript | - ๋ถ๋ณ์ฑ ์ ์ง์ผ์ฃผ์
จ๋ค์! ๐ ๐ |
@@ -0,0 +1,140 @@
+import React, { Component } from 'react';
+import { Link } from 'react-router-dom';
+import User from '../User/User';
+import Comment from '../Comment/Comment';
+import IconButton from '../Button/IconButton';
+import { API } from '../../../../../config';
+import './Feed.scss';
+
+class Feed extends C... | JavaScript | - setState ๊ฐ ๊ธฐ์กด์ state ๊ฐ์ **๋ณํฉ** ํ๋ ์คํผ๋ ์ด์
์ด๊ธฐ ๋๋ฌธ์, ...this.state ๋ฅผ ํด์ฃผ์ค ํ์๊ฐ ์์ต๋๋ค.
```suggestion
this.setState({
comments: comments.filter(comment => comment.id !== clickedId),
});
``` |
@@ -2,12 +2,11 @@ import styled from '@emotion/styled';
import { useRouter } from 'next/router';
import React, { useCallback, useMemo } from 'react';
import { FieldValues } from 'react-hook-form';
-import { useMutation } from 'react-query';
import { useRecoilValue } from 'recoil';
import { useGetFlavors } from '... | Unknown | @hy57in
mutation๋ ํ ๋ฒ ๋ํํด์ ์ฌ์ฉํ๋๊ฑด ์ด๋ ์ ๊ฐ์?
```typescript
export const useCreateReviewMutation = () => {
const cache = useQueryClient();
const { mutateAsync: createReviewMutation, ...rest } = useMutation(createReview, {
onSuccess: async () => {
await cache.invalidateQueries(queryKeyFactory.GET_R... |
@@ -2,12 +2,11 @@ import styled from '@emotion/styled';
import { useRouter } from 'next/router';
import React, { useCallback, useMemo } from 'react';
import { FieldValues } from 'react-hook-form';
-import { useMutation } from 'react-query';
import { useRecoilValue } from 'recoil';
import { useGetFlavors } from '... | Unknown | @hy57in
`useGetReviewsByBeer` ๋ queryKey๋ฅผ queryKeyFactory์์ ๊ฐ์ ธ์ค๋ ๋ฐฉ์์ผ๋ก ๋ณ๊ฒฝํ๋๊ฑฐ ์ด๋จ๊น์!?
ref
- https://github.com/beerair/beerair-web/blob/8a3fb178139646a813eac410820e31846c3460c3/src/commons/queryKeyFactory.ts |
@@ -2,12 +2,11 @@ import styled from '@emotion/styled';
import { useRouter } from 'next/router';
import React, { useCallback, useMemo } from 'react';
import { FieldValues } from 'react-hook-form';
-import { useMutation } from 'react-query';
import { useRecoilValue } from 'recoil';
import { useGetFlavors } from '... | Unknown | [bf34ee2](https://github.com/beerair/beerair-web/pull/162/commits/bf34ee2ba98545a4e64603f0bdad6d5195f50a47)
๋ง๋ค์ด๋์ queryKeyFactory ๋ฅผ ์๊ณ ์์๋ค์. ํด๋น๋ถ๋ถ ์์ ํ์ต๋๋ค!
mutaion๋ ๋ํํด์ ์์ ํ์ต๋๋ค! |
@@ -0,0 +1,45 @@
+import { useMutation, useQueryClient } from 'react-query';
+
+import request from '@/commons/axios';
+import { queryKeyFactory } from '@/commons/queryKeyFactory';
+import { IBaseResponse, IReview } from '@/types';
+
+/**
+ * ๋ฆฌ๋ทฐ ๋ฑ๋ก
+ */
+
+export interface ICreateReviewResponseData extends IBaseRespons... | TypeScript | @hy57in
๋ฆฌ๋ทฐ ์์ฑ๋๊ณ ํธ์ถ๋๋ success ํจ์ ๋ด๋ถ์์๋ ๋ฆฌ๋ทฐ ๋ฆฌ์คํธ๋ฅผ invalidate ์์ผ์ผํ์ง ์๋์..? |
@@ -0,0 +1,45 @@
+import { useMutation, useQueryClient } from 'react-query';
+
+import request from '@/commons/axios';
+import { queryKeyFactory } from '@/commons/queryKeyFactory';
+import { IBaseResponse, IReview } from '@/types';
+
+/**
+ * ๋ฆฌ๋ทฐ ๋ฑ๋ก
+ */
+
+export interface ICreateReviewResponseData extends IBaseRespons... | TypeScript | ์ํซ..! ๋ฆฌ๋ทฐ ๋ฆฌ์คํธ๋ฅผ invalidate ํ๋ ๊ฒ์ผ๋ก ์์ ํ์ต๋๋ค. ๋ฆฌ๋ทฐ ๊ฐ์ฌํฉ๋๋ค ๐ซข |
@@ -97,12 +97,12 @@ const BeerTicketTitle: React.FC<BeerTicketTitleProps> = ({
{sliceAndUpperCase(beer?.country?.engName || 'non', 3)}
</span>
<div className="ticket-detail">
- {`${beer?.alcohol?.toFixed(1)}%`}
+ {beer?.alcohol ? `${beer.alcohol?.toFixed(1)}%` : '-'}
... | Unknown | '?' ์์ด๋ ๊ด์ฐฎ์ ๊ฒ ๊ฐ์์!
```suggestion
{beer?.alcohol ? `${beer.alcohol.toFixed(1)}%` : '-'}
``` |
@@ -0,0 +1,20 @@
+import { IsInt, IsNotEmpty, IsPositive, IsString, IsUUID } from 'class-validator';
+
+export class CreateReviewDTO {
+ @IsUUID()
+ @IsNotEmpty()
+ makerId: string;
+
+ @IsInt()
+ @IsPositive()
+ @IsNotEmpty()
+ rating: number;
+
+ @IsString()
+ @IsNotEmpty()
+ content: string;
+
+ @IsUUID()... | TypeScript | ๋ณ์ ์ 0.5์ ์ ์๋์? |
@@ -0,0 +1,20 @@
+import { IsInt, IsNotEmpty, IsPositive, IsString, IsUUID } from 'class-validator';
+
+export class CreateReviewDTO {
+ @IsUUID()
+ @IsNotEmpty()
+ makerId: string;
+
+ @IsInt()
+ @IsPositive()
+ @IsNotEmpty()
+ rating: number;
+
+ @IsString()
+ @IsNotEmpty()
+ content: string;
+
+ @IsUUID()... | TypeScript | ๋ค! ๊ฐ์ ์ ์(1,2,3,4,5)๋ก ๋ฐ๊ธฐ๋ก ํ๊ณ , ์๋ต์๋ ์์์ 1์๋ฆฌ๊น์ง ๋ฐํํ๊ธฐ๋ก ํ์ต๋๋ค |
@@ -0,0 +1,48 @@
+import { PlanReference } from 'src/common/types/plan/plan.type';
+import { ReviewAllProperties, ReviewProperties } from 'src/common/types/review/review.types';
+import { UserReference } from 'src/common/types/user/user.types';
+
+export default class Review {
+ private readonly id?: string;
+ privat... | TypeScript | get ๋ฉ์๋๋ก DB๋ณด๋ด๊ธฐ ๋ณด๋ค๋ DB์๋ createdAt๊ณผ updatedAt์ ์ธ ์ผ์ด ์์ผ๋๊น ๋บด๊ณ toDB ๋ฉ์๋ ์ด๋ฆ์ด ์ข์๋ณด์ฌ์. ๋ง์ฝ ๋ชจ๋ ๋ฐ์ดํฐ๊ฐ ํ์ํ ๋ถ๋ถ์ด ์๊ธด๋ค๋ฉด ๊ทธ ๋ get ๋ฉ์๋๋ก ๋ชจ๋ ๊ฑธ ๋ด๋ณด๋ด๋๊ฑด ์ด๋จ๊น์? |
@@ -0,0 +1,45 @@
+import { Injectable } from '@nestjs/common';
+import ReviewRepository from './review.repository';
+import PlanService from '../plan/plan.service';
+import { StatusEnum } from 'src/common/constants/status.type';
+import BadRequestError from 'src/common/errors/badRequestError';
+import ErrorMessage from... | TypeScript | ๊ฐ์ ๋ฃ์ด์ค ๋ฟ์ด๋๋ผ๋ ์ ์ง๋ณด์ ์ธก๋ฉด์์ static create ๋ฉ์๋๋ก ๋ง๋์๋ ค๋๊ฑฐ ์๋์๋์? |
@@ -0,0 +1,45 @@
+import { Injectable } from '@nestjs/common';
+import ReviewRepository from './review.repository';
+import PlanService from '../plan/plan.service';
+import { StatusEnum } from 'src/common/constants/status.type';
+import BadRequestError from 'src/common/errors/badRequestError';
+import ErrorMessage from... | TypeScript | ์ ๋ฒ์ ๊ทธ๋ ๊ฒ ๋ง์๋๋ ธ์์ฃ ..ใ
ใ
ใ
๊ทธ๋ฐ๋ฐ ์ค๋ review ๋๋ฉ์ธ์ ์๋ก ๋ง๋ค๋ค๋ณด๋ create ๋ฉ์๋์์ return new Revier(data)๋ง ํ๊ณ , ํน๋ณํ ๊ฒ์ฆ์ด๋ ๋ค๋ฅธ ์์
์ด ์์ด์ ๊ตณ์ด ์จ์ผ ํ ๊น ์๋ฌธ์ด ๋ค์ด๊ฐ์ง๊ณ ... ๋ค๋ฅธ ๋๋ฉ์ธ๋ ๋๋ฉ์ธ์ ๋ง๋ค ๋ ํน๋ณํ ์ด์๊ฐ ์๋ค๋ฉด ๋ฐ๊ฟ๊น ํ๋๋ฐ, ์ด๋ป๊ฒ ์๊ฐํ์๋์? |
@@ -0,0 +1,48 @@
+import { PlanReference } from 'src/common/types/plan/plan.type';
+import { ReviewAllProperties, ReviewProperties } from 'src/common/types/review/review.types';
+import { UserReference } from 'src/common/types/user/user.types';
+
+export default class Review {
+ private readonly id?: string;
+ privat... | TypeScript | ๋ค! ์๋น์ค์ get ๋ฉ์๋ ์ถ๊ฐํ๋ฉด์ toDB, toClient ์ด๋ฐ ์์ผ๋ก ์์ ํ๊ฒ ์ต๋๋ค :) |
@@ -0,0 +1,18 @@
+const categoryDao = require('../models/categoryDao');
+const error = require('../utils/error');
+
+const getCategory = async (type) => {
+ const categoryTypes = {
+ '์ง์ถ' : [1, 2, 3],
+ '์์
' : [4]
+ }
+
+ const categories = await categoryDao.getCategoriesByIds(categoryTypes[type]);
+ categori... | JavaScript | ```suggestion
const getCategory = async (type) => {
const categoryTypes = {
'์ง์ถ' : [1, 2, 4],
'์์
' : [3]
}
const categories = await categoryDao.getCategoriesByIds(categoryTypes[type]);
categories.map((category) => { category.type = type })
return categories
}
module.exports = { get... |
@@ -0,0 +1,20 @@
+const categoryService = require('../services/categoryService');
+const error = require('../utils/error');
+
+const getCategory = async (req, res) => {
+ try {
+ const { type } = req.query;
+ if (!type) {
+ error.throwErr(400, 'KEY_ERROR');
+ }
+ const categories = await categoryServi... | JavaScript | ์๋ฌ ๋ฐ์์์ผ ๋ณด์
จ๋์? ๋ชจ๋ ์๋ฌ๊ฐ 'internal_server_error'๋ก ๋ ํ
๋ฐ, ์๋ํ์ ๋ฐ๊ฐ ๋ง์๊น์? |
@@ -0,0 +1,18 @@
+const categoryDao = require('../models/categoryDao');
+const error = require('../utils/error');
+
+const getCategory = async (type) => {
+ const categoryTypes = {
+ '์ง์ถ' : [1, 2, 3],
+ '์์
' : [4]
+ }
+
+ const categories = await categoryDao.getCategoriesByIds(categoryTypes[type]);
+ categori... | JavaScript | 3. ๊ทผ๋ณธ์ ์ธ ์ง๋ฌธ์ด ํ๋ ์๋๋ฐ, category๊ฐ flow_type_id๋ฅผ FK๋ก ๊ฐ์ง๊ณ ์์ผ๋ฉด, ํ๋์ฝ๋ฉ์ ์ํด๋ ๋ ๊ฒ ๊ฐ์๋ฐ FK ์์ฑํ์๋๊ฒ ์ข์ง ์์๊น์? ์ด๋ถ๋ถ์ ๋ฐฑ์๋ ํ ๊ฐ์ด ๋ผ์ด์ง์์ ์ ํ ๋ฒ ์ฐพ์์ ์ฃผ์ธ์! |
@@ -0,0 +1,20 @@
+const categoryService = require('../services/categoryService');
+const error = require('../utils/error');
+
+const getCategory = async (req, res) => {
+ try {
+ const { type } = req.query;
+ if (!type) {
+ error.throwErr(400, 'KEY_ERROR');
+ }
+ const categories = await categoryServi... | JavaScript | ์ ํด๋น **error message** ๋ถ๋ถ ์์ ํ๊ฒ ์ต๋๋ค.
`=> 'INTERNAL_SERVER_ERROR' || err.message}` |
@@ -0,0 +1,14 @@
+const {DataSource} = require('typeorm');
+const dotenv = require('dotenv');
+dotenv.config();
+
+const appDataSource = new DataSource({
+ type : process.env.TYPEORM_CONNECTION,
+ host: process.env.TYPEORM_HOST,
+ port: process.env.TYPEORM_PORT,
+ username: process.env.TYPEORM_USERNAME,
+ password... | JavaScript | ๋ฐ์ํ๊ฒ ์ต๋๋ค! |
@@ -1,9 +1,14 @@
+import java.util.List;
import java.util.Scanner;
public class InputView {
private static final String INPUT_MONEY_MESSAGE = "๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.";
private static final String INPUT_WINNING_LOTTO_MESSAGE = "์ง๋ ์ฃผ ๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.";
+ private static final String MANUAL_LOTTO_COUNT_MESSAGE = ... | Java | ์ ํ๋ฆฌ์ผ์ด์
์คํ์ ์์ผ๋ณด๋ ์
๋ ฅ์ ์ฐ๋ฌ์ ๋ฐ๊ธฐ ๋๋ฌธ์ ํ ์ค ์
๋ ฅ์ ๋ฐ์ ํ ์
๋ ฅ์ ํ ๋ฒ ๋ ๊ธฐ๋ค๋ฆฌ๊ณ ์์ต๋๋ค! ์ด๋ค ์๋๋ก ์ฌ์ฉํ์ ๊ฑธ๊น์? |
@@ -9,19 +9,24 @@ public LottoGame() {
statistics = new TreeMap<>();
}
- public int inputMoney(int money) {
+ public int calculateLottoCount(int money) {
return lottoCount = money / Lotto.LOTTO_PRICE;
}
- public LottoTicket generateAutoLottoTicket() {
+ public LottoTicket gen... | Java | ์๋ ๋ก๋์ ์๋ ๋ก๋๋ฅผ ํจ๊ป ์์ฑํ๊ณ ์๋๋ฐ ์ด๋ฅผ ๋ถ๋ฆฌ์์ผ๋ณด๋ฉด ์ด๋จ๊น์?
```
List<Lotto> lottos = InputView.manualLotto(lottoCount);
OutputView.printLottoTicket(game.generateLottoTicket(lottos));
```
์ฝ๋ ์์ฒด๋ก generateLottoTicket์์ ์๋๋ก๋๊น์ง ์์ฑํด์ฃผ๋ ๊ฒ์ธ์ง ํน์ ์๋ํ๋๋ก ์๋ ๋ก๋์ ์๋ ๋ก๋๋ฅผ ํจ๊ป ์์ฑํ๋ ๊ฒ์ธ์ง ๋ฉ์๋๋ช
๋ง ๋ณด๊ณ ๋ ์๋ฏธ๊ฐ ์กฐ๊ธ ๋ชจํธํ๋ค๊ณ ์๊ฐ๋ฉ๋๋ค. (๊ฐ์ธ์ ์๊ฐ์ผ๋ก)
๊ทธ๋ฆฌ๊ณ ๋์ค์ ์๊ตฌ์ฌํญ์ด ๋ณ๊ฒฝ๋์ด `์... |
@@ -0,0 +1,12 @@
+public class BonusNumber {
+ private LottoNumber bonusNumber;
+
+ public BonusNumber(LottoNumber bonusNumber) {
+ this.bonusNumber = bonusNumber;
+ }
+
+ public LottoNumber getBonusNumber() {
+ return bonusNumber;
+ }
+}
+ | Java | LottoNumber ์์ฒด๋ ์์๊ฐ์ ํฌ์ฅํ ํํ๋ก LottoNumber ํ์
์ผ๋ก bonusNumber๋ฅผ ์ฌ์ฉํ ์ ์๋๋ฐ ์ด๋ฅผ ํ ๋ฒ ๋ ํฌ์ฅํ์ฌ ์ฌ์ฉํ์ ์ด์ ๊ฐ ์์ผ์ค๊น์? BonusNumber์์๋ ์ด๋ ํ ํ์๋ฅผ ํ์ง ์๊ณ ํฌ์ฅ๋ ๊ฐ์ ํ ๋ฒ ๋ Wrapping ํ๋ ํํ๋ก๋ง ์ฌ์ฉ๋๊ณ ์๋๋ฐ ๋ถํ์ํด ๋ณด์ฌ์์~ |
@@ -43,6 +43,10 @@ public int match(WinningLotto winningLotto) {
return matchCount;
}
+ public boolean isBonusMatch(WinningLotto winningLotto) {
+ return lotto.contains(winningLotto.getBonusNumber());
+ }
+
public boolean contains(LottoNumber lottoNumber) {
return lotto.contai... | Java | lotto์ ๋ณด๋์ค ์ซ์๊ฐ ํฌํจ๋์ด์๋์ง ํ๋ณํ๋ ์ญํ ์ ํ๋ ๋ฉ์๋๋ก ๋ณด์ด๋ค์. ๋จ์ํ ํ๋ณ ์ฌ๋ถ๋ผ๋ฉด boolean ํ์
์ผ๋ก ๋ณ๊ฒฝํด์ฃผ๋ฉด ์ด๋จ๊น์? ๋ง์ฝ ๋ณด๋์ค ์ซ์๊ฐ 1๊ฐ ์ด์์ด๋ผ๋ ์๊ตฌ์ฌํญ ๋ณ๊ฒฝ์ ์ผ๋ํ ๊ตฌํ์ด๋ผ๋ฉด 1, 0์ ๋ฆฌํดํ๋ ๊ฒ๋ณด๋ค ๊ตฌ์ฒด์ ์ผ๋ก ๋งค์นญ๋ ๊ฐฏ์๋ฅผ ๋ฆฌํดํด์ฃผ๋ ์์ผ๋ก ๋ณ๊ฒฝํด๋ณด๋ฉด ํ์ฅ์ ์ ๋ฆฌํ ๊ตฌํ์ด ๋ ๊ฒ ๊ฐ์์. ๋ฉ์๋๋ช
๋ ์๋ฏธ์ ๋ฌ์ ์กฐ๊ธ ๋ ๋ช
ํํ๊ฒ ํ๋ฉด ์๋ฒฝํ ๊ฒ ๊ฐ์ต๋๋คb |
@@ -6,6 +6,8 @@ public class OutputView {
private static final String RESULT_STATISTICS_MESSAGE = "๋น์ฒจ ํต๊ณ";
private static final String BOUNDARY_LINE = "---------";
private static final String TOTAL_EARNING_RATIO_MESSAGE = "์ด ์์ต๋ฅ ์ %s ์
๋๋ค.";
+ private static final int SECOND_RANK_COUNT = 5;
+ private... | Java | ์ ์ฝ์ฌํญ ์๊ตฌ์ฌํญ์ ๋ฐ์ํ ๋ `rank.getMatch() == 5 && rank.getBonusMatchCount() == 1` ์ ๊ฐ์ ์ฝ๋๋ฅผ ๋ฉ์๋๋ก ๋ฐ๋ก ๋ถ๋ฆฌํด์ `validateMatchCount(rank)`์ ๊ฐ์ด ์์ฑํ๋ค๋ฉด ์ฝ๋๋ฅผ ์ฝ๋ ๋ค๋ฅธ ๊ฐ๋ฐ์๊ฐ ์ ์ฝ์ฌํญ์ ํ์
ํ๋๋ฐ ๋ ์ฌ์ธ ๊ฒ ๊ฐ์ต๋๋ค. ๋ฉ์๋๋ช
๋ง ๋ณด๊ณ "์ด ์ง์ ์์ validate ์ฒดํฌ๋ฅผ ํ๋ ๊ตฌ๋"๋ผ๊ณ ํ๋์ ํ์
์ด ๋๊ณ , ๊ตฌ์ฒด์ ์ธ ์ ์ฝ์ฌํญ์ด ๊ถ๊ธํ ๋ ํด๋น ๋ฉ์๋ ๋ด๋ถ ๊ตฌํ๋ง ์ฐพ์๋ณด๋ฉด ๋๊ฒ ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ถ๊ฐ๋ก ์ซ์๋ค๋ ์์ ์ฒ๋ฆฌํด์ฃผ๋ฉด ๋ ์ข์ ๊ฒ ๊ฐ์ต๋๋ค. |
@@ -1,10 +1,33 @@
+import exception.*;
+import java.util.List;
+
public class Application {
public static void main(String[] args) {
LottoGame game = new LottoGame();
- OutputView.printLottoCount(game.inputMoney(new Money(InputView.inputMoney()).getMoney()));
- OutputView.printLottoTicket(g... | Java | ํฐ ์์๋ ์๋๊ฒ ์ง๋ง ๊ด๋ จ์ฑ์ ๋ฐ๋ผ์ ๊ฐํ์ ์ถ๊ฐํด ๊ตฌ๋ถ ์ง์ด์ฃผ๋ ๊ฒ๋ ๊ฐ๋
์ฑ์ ๋์ด๋ ์์๋ผ๊ณ ์๊ฐํฉ๋๋ค! |
@@ -1,9 +1,14 @@
+import java.util.List;
import java.util.Scanner;
public class InputView {
private static final String INPUT_MONEY_MESSAGE = "๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.";
private static final String INPUT_WINNING_LOTTO_MESSAGE = "์ง๋ ์ฃผ ๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.";
+ private static final String MANUAL_LOTTO_COUNT_MESSAGE = ... | Java | InputView์์ ์๋ ๋ก๋์ ๋ํด ๋ฒํธ๋ฅผ ์
๋ ฅ ๋ฐ๋ ์ญํ ์ ๋ํด ์ง์ ๋ก๋๋ฅผ ์์ฑํ๋ ์ญํ ๊น์ง ํ๊ณ ์๋ค์. ์ญํ ์ ๋ถ๋ฆฌํด๋ณผ ์ ์์๊น์? ๋ถ๋ฆฌํ์ ๋ ์ด๋ค ์ด์ ์ด ์๊ธธ๊น์? |
@@ -4,44 +4,36 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
public class LottoGameTest {
@Test
- @... | Java | `inputMoney()`๋ผ๋ ์ด๋ฆ์ ๋ฉ์๋์ ๊ฒฐ๊ณผ๊ฐ์ผ๋ก ๋ก๋ ๊ฐฏ์๊ฐ ๋์ค๋๊ฒ ์กฐ๊ธ ์ด์ํ ๊ฒ ๊ฐ์ต๋๋ค. ์
๋ ฅ๋ฐ๋ ๋ฉ์๋์ ๊ฐฏ์๋ฅผ ๋ฐํํ๋ ๋ฉ์๋๋ก ๋ถ๋ฆฌํด๋ณด๋ฉด ์ด๋จ๊น์? |
@@ -4,44 +4,36 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
public class LottoGameTest {
@Test
- @... | Java | ๊ฒฐ๊ณผ๊ฐ๊ณผ ๋น๊ตํ๋ ๊ฐ์ lottoCount๊ฐ ์๋ ์ง์ ์ ์ธ ์ซ์๋ก ๋น๊ตํ๋ฉด ์ด๋จ๊น์? ๋ง์ฝ ์ค์๋ก lottoGame.inputMoney()์์ ์
๋ ฅ๋ฐ์ ๋์ ๋ฐ์ฌ๋ฆผํด์ ์ฅ์๋ฅผ ์ถ๋ ฅํ๋๋ก ํด๋ฒ๋ ธ๋ค๋ฉด ํฐ์ผ์ ์ฌ์ด์ฆ๊ฐ 4๋๋ผ๋ ํ
์คํธ๊ฐ ํต๊ณผํ๊ฒ ๋ ๊ฒ ๊ฐ์ต๋๋ค. ์ฌ์ค ์ง๊ธ ํ
์คํธ ์ฝ๋๋ `lottoGame.inputMoney()`๊ฐ ๋จผ์ ๋ณด์ฅ๋์ด์ผํ๋๋ง ์ ํํ ํ
์คํธ๊ฐ ๊ฐ๋ฅํ ์ฝ๋๋ผ๊ณ ๋ณผ ์ ์์ ๊ฒ ๊ฐ์ต๋๋ค. ํ
์คํธ๋ฅผ ํ๋ค๋ณด๋ฉด ์ด์ฉ ์ ์๋ ๋ถ๋ถ์ผ ์๋ ์๊ณ , ์ ๋ง์ด ์ ๋ต์ ์๋์ง๋ง ๊ฒฐ๊ณผ๊ฐ์ ๊ฐ๊ธ์ ๋ ์ ํํ ๊ฒ์ ์์กดํด์ผํ์ง ์์๊น ์๊ฐ์ด ๋ค์ด ๋ฆฌ๋ทฐ ๋จ๊ฒจ๋ดค์ต๋๋ค. |
@@ -1,9 +1,14 @@
+import java.util.List;
import java.util.Scanner;
public class InputView {
private static final String INPUT_MONEY_MESSAGE = "๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.";
private static final String INPUT_WINNING_LOTTO_MESSAGE = "์ง๋ ์ฃผ ๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.";
+ private static final String MANUAL_LOTTO_COUNT_MESSAGE = ... | Java | ์๋์ด ์๋ ์๋์ผ๋ก ์
๋ ฅํ ๊ฐฏ์๋งํผ ์
๋ ฅ์ ๋ฐ๋๋ก ์๊ตฌ์ฌํญ์ด ๊ธฐ์ฌ๋์ด ์๊ธฐ ๋๋ฌธ์, ๋ง์ฝ `์๋์ผ๋ก ๊ตฌ๋งคํ ๋ก๋ ์๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.` ์์ 2๊ฐ๋ฅผ ์
๋ ฅํ๋ค๋ฉด, 2์ค์ ์
๋ ฅ ๊ฐ์ ๋ฃ์ด์ฃผ์ด์ผ ํฉ๋๋ค! |
@@ -1,9 +1,14 @@
+import java.util.List;
import java.util.Scanner;
public class InputView {
private static final String INPUT_MONEY_MESSAGE = "๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.";
private static final String INPUT_WINNING_LOTTO_MESSAGE = "์ง๋ ์ฃผ ๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.";
+ private static final String MANUAL_LOTTO_COUNT_MESSAGE = ... | Java | <img width="370" alt="แแ
ณแแ
ณแ
แ
ตแซแแ
ฃแบ 2022-07-04 แแ
ฉแแ
ฎ 7 14 35" src="https://user-images.githubusercontent.com/62830487/177134400-0365bef0-a31c-4a57-9020-e294daa65100.png">
๋ก์ง์ ๋ฌธ์ ๊ฐ ์์ด๋ณด์ด๋ค์. ์๋ ๋ก๋ 2์ฅ์ ๊ตฌ๋งคํด์ ๋ก๋ 2์ฅ์ ๋ฒํธ๋ฅผ ์
๋ ฅํ๋๋ฐ ์
๋ ฅ์ ํ ๋ฒ ๋ ๊ธฐ๋ค๋ฆฌ๊ณ ์๋ค์. ํ์ธ ๋ถํ๋๋ ค์. |
@@ -9,19 +9,24 @@ public LottoGame() {
statistics = new TreeMap<>();
}
- public int inputMoney(int money) {
+ public int calculateLottoCount(int money) {
return lottoCount = money / Lotto.LOTTO_PRICE;
}
- public LottoTicket generateAutoLottoTicket() {
+ public LottoTicket gen... | Java | ๊ฒฐ๊ตญ์ ์๋ ๋ก๋์ ์๋ ๋ก๋ ๋ชจ๋ ํ๋์ ๋ก๋ ํฐ์ผ์ผ๋ก ํฉ์ณ์ง๋ ๋ถ๋ถ์ด ํ์ํ๊ธฐ ๋๋ฌธ์, ํ์ฌ `generateLottoTicket()` ๋ด์ ์๋๊ณผ ์๋ ๋ก๋ ์์ฑ ๊ฐ๊ฐ์ ๋ฐ๋ณต๋ฌธ์ `generateManualLottoTicket()`๊ณผ `generateAutoLottoTicket()` ์ผ๋ก ๋ฉ์๋๋ฅผ ๋ถ๋ฆฌํด๋ณด๋๋ก ํ๊ฒ ์ต๋๋ค |
@@ -0,0 +1,12 @@
+public class BonusNumber {
+ private LottoNumber bonusNumber;
+
+ public BonusNumber(LottoNumber bonusNumber) {
+ this.bonusNumber = bonusNumber;
+ }
+
+ public LottoNumber getBonusNumber() {
+ return bonusNumber;
+ }
+}
+ | Java | @sunghyuki ๊ธฐ์กด์ Lotto ๊ฐ์ฒด๋ก๋ง ๊ตฌ์ฑ๋ WinningLotto์ BonusNumber๋ฅผ ์ถ๊ฐํ์ฌ, ๋ก๋ ๋น์ฒจ ๋ฒํธ ์ค 5๊ฐ๊ฐ ์ผ์นํ๋ ๊ฒฝ์ฐ BonusNumber ์ผ์น ์ฌ๋ถ ํ์ธ์ ๋ถ๋ช
ํ๊ฒ ํ๊ธฐ ์ํด LottoNumber ํ์
์ผ๋ก ๊ตฌ์ฑ๋ BonusNumber๋ฅผ ์์ฑํ์ต๋๋ค~ |
@@ -4,44 +4,36 @@
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.util.ArrayList;
-import java.util.HashMap;
import java.util.List;
-import java.util.Map;
import static org.assertj.core.api.Assertions.assertThat;
public class LottoGameTest {
@Test
- @... | Java | @Bellroute ์ ํฌ๋ ์
๋ ฅ ๊ธ์ก๋งํผ ๋ก๋ ๋ฆฌ์คํธ๊ฐ ์ ์ถ๊ฐ๋๋์ง ํ
์คํธํ๋ ค๊ณ ์์ฑํ๋๋ฐ, ์ ์ด์ฃผ์ ๋ฆฌ๋ทฐ๋ฅผ ์ ์ดํดํ์ง ๋ชปํ ๊ฒ ๊ฐ์ต๋๋ค. ๋ถ์ฐ ์ค๋ช
๋ถํ๋๋ ค๋ ๋ ๊น์?? |
@@ -1,9 +1,14 @@
+import java.util.List;
import java.util.Scanner;
public class InputView {
private static final String INPUT_MONEY_MESSAGE = "๊ตฌ์
๊ธ์ก์ ์
๋ ฅํด ์ฃผ์ธ์.";
private static final String INPUT_WINNING_LOTTO_MESSAGE = "์ง๋ ์ฃผ ๋น์ฒจ ๋ฒํธ๋ฅผ ์
๋ ฅํด ์ฃผ์ธ์.";
+ private static final String MANUAL_LOTTO_COUNT_MESSAGE = ... | Java | @Bellroute ๊ธฐ์กด์ ์ ํฌ๊ฐ ์์ฑํ ์ฝ๋๋ ์ง์ ํด์ฃผ์ ๊ฒ์ฒ๋ผ Lottoame ์ฑ
์์ InputView์์ ๋ถ์ฌํ๊ณ ์์ต๋๋ค. ์ด ๊ฒฝ์ฐ ๋ณ๊ฒฝ์ฌํญ์ด ์๊ธธ ๋, InputView์ Lotto๋ฅผ ์์ฑํ๋ LottoGame์ ๋ชจ๋ ์์ ํด์ผํฉ๋๋ค.
ํ์ธํด๋ณด๋ LottoGame์ ๊ธฐ์กด์ ์์ฑํด๋ Lotto ์์ฑ ๋ฉ์๋๋ฅผ ํ์ฉํด์ ๋ฆฌํํ ๋งํ์์ต๋๋ค. |
@@ -3,7 +3,7 @@ import { VerticalLine } from "../Line";
interface LessonInfoProps {
startDate: string;
endDate: string;
- locationType: string;
+ locationType?: string;
address?: string;
}
| Unknown | ์ด๊ฑด ์ ์ต์
๋๋ก ๋ฐ๊พธ์ ๊ฑด๊ฐ์? |
@@ -1,26 +1,30 @@
import { CHAT_SORT_OPTIONS } from '@/constants/chat';
+import { User } from './user';
-export type SortType = keyof typeof CHAT_SORT_OPTIONS;
-
-export interface RoomResponse {
+export interface ChatRoom {
chatId: string;
chattingName: string;
+ description: string;
host: string;
+ hostP... | TypeScript | ๊ณต์ฉ ์ ์ ํ์
๊ณผ ๊ฒน์น๋ ๋ถ๋ถ์ด ๋ง์ ๊ฒ ๊ฐ์ต๋๋ค. User ์ธํฐํ์ด์ค ๊ฐ์ ธ๋ค๊ฐ ์ฐ์๋ฉด ์ข์ ๊ฒ ๊ฐ์์.
์ ํธ๋ฆฌํฐ ํ์
๊ณผ ํ์ฅ ์ด์ฉํ์๋ฉด ๋ ๊ฒ ๊ฐ์์. |
@@ -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 | `func loadImage(of key: String)` ๋ง ๋ณด๊ณ key๊ฐ ๋ฌด์์ธ์ง, key๊ฐ Image์ ์ด๋ค ์ฐ๊ด์ด ์๋์ง ์๊ธฐ ์ด๋ ต๋ค์.
loadCachedImage(of key: String) ์ ๋ ์ ์๋๋ฆฝ๋๋ค. |
@@ -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 | method๋ฅผ ํตํด property๋ฅผ setํ๋ ์ด์ ๋ฅผ ์ถ์ธกํ๊ธฐ ์ด๋ ต๋ค์. |
@@ -0,0 +1,18 @@
+import Foundation
+
+extension URLRequest {
+ init?(api: APIProtocol) {
+ guard let url = api.url else {
+ return nil
+ }
+
+ self.init(url: url)
+ self.httpMethod = "\(api.method)"
+
+ if let postableAPI = api as? Postable {
+ ... | Swift | ์ถ์ํํ์ ๋, Specificํ Type์ผ๋ก casting์ด ํ์ํ๋ค๋ ๊ฑด ์ถ์ํ๊ฐ ์๋ชป๋์๋ค๋ ๋ฐ์ฆ์ด ๋ฉ๋๋ค.
Header setํ๋ ์ฝ๋์ httpBody setํ๋ ๋ถ๋ถ์ APIProtocol Level๋ก ์ฌ๋ ค์ ๊ตฌํ๋ค๋ฉด Postable๋ก์ Casting์ด ํ์์์ ๊ฒ ๊ฐ์ต๋๋ค. ์ด ๋ฐฉํฅ์ผ๋ก ๊ณ ๋ฏผํด์ฃผ์ธ์. |
@@ -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 | Type ์ด๋ฆ์ 'XXFormData'๊ฐ ํฌํจ๋์ด์์ผ๋ฏ๋ก, method ์ด๋ฆ์ FormData๊ฐ ํฌํจ๋์ง ์๋ ๊ฒ์ด ํธ์ถํ์ ๋ ์์ฐ์ค๋ฝ์ต๋๋ค.
multipartFormdata.create๋ง ํด๋ ๋งฅ๋ฝ์ ์ดํดํ๋๋ฐ ๋ฌธ์ ์์ด์.
๋ํ item์ด๋ผ๋ ํ๋ผ๋ฏธํฐ ์ด๋ฆ์ด ๋ชจํธํด๋ณด์
๋๋ค. ์ ํํ ์ ๊ฒ ๋ฌด์จ item์ธ์ง ๋ ์์ธํ๊ฒ ๋ช
์ธ๋์์ผ๋ฉด ํฉ๋๋ค. |
@@ -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 | 'params: params' ์ ๊ฐ์ ๋ชจ์์ด ๋์จ๋ค๋ฉด, ์ธ๋๋ฐ๋ก ํ๋ผ๋ฏธํฐ๋ช
์ ์จ๊ธฐ๋ ๊ฒ์ ๊ณ ๋ คํด๋ณผ ์ ์์ต๋๋ค. |
@@ -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 | static method๊ฐ ๋์ ๊ฑธ๋ฆฌ๋ค์.
์ ๋ ๊ฐ์ฒด ์์ฑ ํ๋ ๊ฒ์ด ๋ ์ข๋ค๊ณ ์๊ฐํฉ๋๋ค. ์ ํ์ด ๊ทธ๋ ๊ฒ ํ๊ณ ์๊ณ ์. (JsonDecoder ๋ฑ.)
BoundaryGenerator().data(forType: .startSymblol) ๊ณผ ๊ฐ์ ์คํ์ผ์ด ๋๋ฉด ์ข๊ฒ ์ต๋๋ค. |
@@ -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,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์ ์ฑ
์๋ ๋ถ๋ฆฌํด์ฃผ์
จ๊ตฐ์ ๐ |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.