code
stringlengths
41
34.3k
lang
stringclasses
8 values
review
stringlengths
1
4.74k
@@ -0,0 +1,22 @@ +import React from 'react'; + +class Story extends React.Component { + render() { + const { nickname, img } = this.props; + return ( + <li className="user main-right__user"> + <img + className="user__img user__img--brder-red" + alt={nickname} + src={img} + ...
JavaScript
์—ฌ๊ธฐ๋‘์šฉ~
@@ -0,0 +1,281 @@ +/*------๊ณตํ†ต-----*/ +/*------๊ณตํ†ต-----*/ + +.main-body { + background-color: var(--color-boxgray); +} + +main { + display: flex; + margin-left: 100px; +} + +ul > li { + margin: 10px 0; +} + +a { + text-decoration: none; + color: inherit; +} + +.box { + background-color: white; + border: 1px solid...
Unknown
common.scss ํŒŒ์ผ์— ์ด๋ฏธ ์žˆ์–ด์„œ ํ•ด๋‹น ๋ถ€๋ถ„ ์‚ญ์ œํ–ˆ์–ด์šฉ ใ…Ž...๐Ÿ˜ฑ
@@ -0,0 +1,51 @@ +import React from 'react'; +import { withRouter } from 'react-router-dom'; + +class LoginForm extends React.Component { + constructor() { + super(); + this.state = { id: '', ps: '' }; + } + + goToMain = e => { + this.props.history.push('/main-yoonhee'); + }; + + handleInput = e => { + ...
JavaScript
๋ž˜์˜๋‹˜ ๊ฐ•์˜ ๋•๋ถ„์ž…๋‹ˆ๋‹น ใ…‹.ใ…‹
@@ -0,0 +1,59 @@ +import React from 'react'; +import Comment from './Comment'; + +class CommentBox extends React.Component { + constructor(props) { + super(props); + this.state = { feedComment: '', commentList: [] }; + } + + handleInput = e => { + this.setState({ [e.target.name]: e.target.value }); + }; + ...
JavaScript
๋ฐ์ดํ„ฐ ๋‚ด์šฉ์˜ ๋œป์„ ์•Œ ์ˆ˜ ์žˆ๊ฒŒ comment๋กœ ๋ณ€๊ฒฝํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,36 @@ +package me.misik.api.infra + +import me.misik.api.core.Chatbot +import org.springframework.beans.factory.annotation.Value +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration +import org.springframework.http.HttpHeaders +import org.springfram...
Kotlin
hoxy ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋“ฑ๋กํ•˜๋Š”๊ฑฐ๋ฉด @Value ์‚ฌ์šฉํ•ด๋„ ๋ ๊นŒ์š”? ํ˜น์€ @Qualifier๋Š” ์‚ฌ์šฉํ•  ๋นˆ ๊ฐ์ฒด ์„ ํƒ ์‹œ ์“ฐ๋Š”๊ฑธ๋กœ ์•Œ๊ณ ์žˆ๋Š”๋ฐ ํ™˜๊ฒฝ๋ณ€์ˆ˜ ๋“ฑ๋กํ•  ๋•Œ๋„ ์“ธ ์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์ด ์žˆ๋Š”์ง€์šฉ? ๐Ÿ˜
@@ -0,0 +1,17 @@ +package me.misik.api.api + +import me.misik.api.app.ReCreateReviewFacade +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +class ReviewController( +...
Kotlin
์žฌ์ƒ์„ฑ๋œ ๋ฆฌ๋ทฐ๋„ ์บ์‹ฑ์— ํ™œ์šฉํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์€๋ฐ ์ œ๊ฐ€ #5 ํ•  ๋•Œ ์ถ”๊ฐ€ํ•ด๋ด๋„ ๋ ๊นŒ์š”? 1) ์žฌ์‚ฌ์šฉ์„ ์œ„ํ•ด DB์— ์ €์žฅ 2) ์ด๋ฏธ ๊ฐ™์€ ์œ ์ €์—๊ฒŒ ์ œ๊ณต๋œ ๋ฆฌ๋ทฐ๋Š” ๋˜ ์ œ๊ณต X ์œ„๋ฅผ ์œ„ํ•ด์„œ device id ํ—ค๋”๋ฅผ ๋ฐ›์•„์˜ค๋ ค๊ณ  ํ•ฉ๋‹ˆ๋‹น!
@@ -0,0 +1,24 @@ +# ๋ฆฌ๋ทฐ ์ƒ์„ฑ + +๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. + +## Request + +### HTTP METHOD : `GET` + +### url : `https://api.misik.me/reviews/{id}` +### Http Headers +- device-id: ์‹๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’ + `๋ฏธ๋ž˜์—๋„ ๋ณ€ํ•˜์ง€ ์•Š์•„์•ผํ•จ ์•ฑ์„ ์‚ญ์ œํ–ˆ๋‹ค ๋‹ค์‹œ ๊น”์•„๋„ ์•ˆ๋ณ€ํ•˜๋Š” ๊ฐ’์œผ๋กœ ์ค„ ์ˆ˜ ์žˆ๋Š”์ง€` + +### Response + +#### `Response Status 200 OK` + +```json +{ + "isSuccess": true, // ๋ฆฌ๋ทฐ๊ฐ€ ์ƒ...
Unknown
์ด ๋ถ€๋ถ„ ๋‹ค์Œ ์—”์ง€๋‹ˆ์–ด ํšŒ์˜ ๋•Œ ํด๋ผ์ด์–ธํŠธ ๋ถ„๋“ค๊ณผ ์ด์•ผ๊ธฐ ํ•ด๋ณด๋ฉด ์–ด๋–จ๊นŒ์š”? ๐Ÿ˜ ์•ž์œผ๋กœ๋„ ๋น„์Šทํ•œ ์กฐํšŒ ๋กœ์ง์„ ์œ„ํ•ด ํ•ฉ์˜ํ•ด๋‘๋ฉด ์ข‹์„๋“ฏ์š”! ์ง€๊ธˆ์ฒ˜๋Ÿผ ์กฐํšŒํ•  ๋•Œ ๊ฐ’์ด ์—†์œผ๋ฉด 200์„ ์ฃผ๊ณ  ํ•„๋“œ๋กœ ๊ตฌ๋ถ„ํ•˜๊ฒŒ ํ•  ๊ฒƒ์ธ์ง€, ์•„๋‹ˆ๋ฉด 400์„ ๋‚ด๋ ค์ค„์ง€์— ๋Œ€ํ•ด์„œ์šฉ!
@@ -0,0 +1,17 @@ +package me.misik.api.api + +import me.misik.api.app.ReCreateReviewFacade +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +class ReviewController( +...
Kotlin
hoxy ์—ฌ๊ธฐ ๋ฉ”์„œ๋“œ๋ช…์ด reCreateReview๊ฐ€ ์•„๋‹Œ createReview์ธ๋ฐ ์˜๋„ํ•˜์‹ ๊ฑธ๊นŒ์š”? ๐Ÿฅณ
@@ -0,0 +1,24 @@ +# ๋ฆฌ๋ทฐ ์ƒ์„ฑ + +๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. + +## Request + +### HTTP METHOD : `GET` + +### url : `https://api.misik.me/reviews/{id}` +### Http Headers +- device-id: ์‹๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’ + `๋ฏธ๋ž˜์—๋„ ๋ณ€ํ•˜์ง€ ์•Š์•„์•ผํ•จ ์•ฑ์„ ์‚ญ์ œํ–ˆ๋‹ค ๋‹ค์‹œ ๊น”์•„๋„ ์•ˆ๋ณ€ํ•˜๋Š” ๊ฐ’์œผ๋กœ ์ค„ ์ˆ˜ ์žˆ๋Š”์ง€` + +### Response + +#### `Response Status 200 OK` + +```json +{ + "isSuccess": true, // ๋ฆฌ๋ทฐ๊ฐ€ ์ƒ...
Unknown
๐Ÿ‘ ๋„˜ ์ข‹์•„์š”! streaming ๋ฐฉ์‹ ์ง€์›ํ• ๊ฑฐ๋ผ์„œ ์ƒ์„ฑ์‹œ ๋ฆฌ๋ทฐ id๋งŒ ๋ฐ˜ํ™˜ํ•˜๊ณ , id๋กœ ์—ฌ๋Ÿฌ ๋ฒˆ ์กฐํšŒํ•ด์˜ค๊ฒŒ ํ•˜๊ธฐ!! ์ข‹์Šต๋‹ˆ๋‹น!!
@@ -0,0 +1,65 @@ +package me.misik.api.core + +import kotlinx.coroutines.flow.Flow +import me.misik.api.domain.Review +import org.springframework.web.bind.annotation.RequestBody +import org.springframework.web.service.annotation.PostExchange + +fun interface Chatbot { + + @PostExchange("/testapp/v1/chat-completions/...
Kotlin
HTTP Interface ๐Ÿ‘ ๊ฐ€๋…์„ฑ ์งฑ์ด๋„ค์šฉ
@@ -0,0 +1,24 @@ +# ๋ฆฌ๋ทฐ ์ƒ์„ฑ + +๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. + +## Request + +### HTTP METHOD : `GET` + +### url : `https://api.misik.me/reviews/{id}` +### Http Headers +- device-id: ์‹๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’ + `๋ฏธ๋ž˜์—๋„ ๋ณ€ํ•˜์ง€ ์•Š์•„์•ผํ•จ ์•ฑ์„ ์‚ญ์ œํ–ˆ๋‹ค ๋‹ค์‹œ ๊น”์•„๋„ ์•ˆ๋ณ€ํ•˜๋Š” ๊ฐ’์œผ๋กœ ์ค„ ์ˆ˜ ์žˆ๋Š”์ง€` + +### Response + +#### `Response Status 200 OK` + +```json +{ + "isSuccess": true, // ๋ฆฌ๋ทฐ๊ฐ€ ์ƒ...
Unknown
์•„ ์ด๊ฒŒ 60์ดˆ ๋Œ€๊ธฐ๋•Œ๋ฌธ์— ์ถ”๊ฐ€๋œ๊ฑฐ๊ตฐ์š”! 1. ๋ฆฌ๋ทฐ ์ƒ์„ฑ ์ค‘, ์•„์ง ๋œ ์ƒ์„ฑ๋จ 2. ์•„์˜ˆ ์—†๋Š” ๋ฆฌ๋ทฐid๋ฅผ ์กฐํšŒํ•˜๋ ค๊ณ  ํ•จ 3. ๋ฆฌ๋ทฐ ์ƒ์„ฑ๋จ, ์กฐํšŒ ๊ฐ€๋Šฅ ์ด๋ ‡๊ฒŒ 3๊ฐ€์ง€ ๊ฒฝ์šฐ๊ฐ€ ์žˆ์–ด๋ณด์—ฌ์š”!
@@ -0,0 +1,36 @@ +package me.misik.api.infra + +import me.misik.api.core.Chatbot +import org.springframework.beans.factory.annotation.Value +import org.springframework.context.annotation.Bean +import org.springframework.context.annotation.Configuration +import org.springframework.http.HttpHeaders +import org.springfram...
Kotlin
์˜ค ์˜คํƒ€์ž…๋‹ˆ๋‹ค! ใ…‹ใ…‹ใ…‹ใ…‹ ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค [b838a91](https://github.com/Nexters/misik-api/pull/7/commits/b838a916d60cf5b000f306c15caf7652e9ee0082)
@@ -0,0 +1,17 @@ +package me.misik.api.api + +import me.misik.api.app.ReCreateReviewFacade +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +class ReviewController( +...
Kotlin
๋„ต ๋‹น์—ฐํ•˜์ฃต ์ˆ˜์ •ํ•ด์ฃผ์…”๋„ ๋ฉ๋‹ˆ๋‹ค! ์ถ”๊ฐ€๋กœ, ๊ตฌํ˜„ํ•˜๋ฉด์„œ ์ถœ์‹œ์ „์— ํ•ด์•ผํ• ๊ฑฐ ๊ฐ™์€ ์บ์‹ฑ์„ ๋ฐœ๊ฒฌํ–ˆ๋Š”๋ฐ์š”. ํ˜„์žฌ๋Š” ๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ• ๋•Œ, streaming๋ฐฉ์‹์œผ๋กœ DB์— ํ•˜๋‚˜์”ฉ ์ ์žฌ๋ฅผ ํ•˜๋Š” ๋ฐฉ์‹์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ฆ‰, ์ฟผ๋ฆฌ๊ฐ€ streaming์˜ ์‘๋‹ต๊ฐฏ์ˆ˜ ๋งŒํผ ๋‚˜๊ฐ€๊ณ , ์œ„ ์‚ฌ์ง„์—์„œ๋Š” ์ด 77๋ฒˆ ์ฟผ๋ฆฌ๊ฐ€ ์ˆ˜ํ–‰๋˜์—ˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๋กœ์ง์„ ์งœ๋Š”๊ฑด DB์— ๋ถ€๋‹ด์ด ๋˜๊ณ , ์„ฑ๋Šฅ๋„ ๋‚˜์˜ค๊ธฐ ํž˜๋“œ๋‹ˆ ์“ฐ๊ธฐ ์บ์‹ฑ์„ ํ•ด์•ผํ• ๊ฑฐ ๊ฐ™์•„์š”. ๋‘๊ฐ€์ง€ ํ”Œ๋กœ์šฐ์— ๋ ˆ๋””์Šค ํ˜น์€ ์ธ๋ฉ”๋ชจ๋ฆฌ๋กœ ์บ์‹ฑ์„ ์ถ”๊ฐ€ํ•ด์•ผํ• ๊ฑฐ ๊ฐ™์€๋ฐ์š”. 1. ์‹ค์‹œ๊ฐ„ ํด๋ง ๋ฆฌ๋ทฐ ์กฐํšŒ (1์ฐจ MVP์—์„œ๋Š” ์—†์Œ) -> redis์—...
@@ -0,0 +1,24 @@ +# ๋ฆฌ๋ทฐ ์ƒ์„ฑ + +๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ•ฉ๋‹ˆ๋‹ค. + +## Request + +### HTTP METHOD : `GET` + +### url : `https://api.misik.me/reviews/{id}` +### Http Headers +- device-id: ์‹๋ณ„ํ•  ์ˆ˜ ์žˆ๋Š” ๊ฐ’ + `๋ฏธ๋ž˜์—๋„ ๋ณ€ํ•˜์ง€ ์•Š์•„์•ผํ•จ ์•ฑ์„ ์‚ญ์ œํ–ˆ๋‹ค ๋‹ค์‹œ ๊น”์•„๋„ ์•ˆ๋ณ€ํ•˜๋Š” ๊ฐ’์œผ๋กœ ์ค„ ์ˆ˜ ์žˆ๋Š”์ง€` + +### Response + +#### `Response Status 200 OK` + +```json +{ + "isSuccess": true, // ๋ฆฌ๋ทฐ๊ฐ€ ์ƒ...
Unknown
๋„ต๋„ต ์„œ๋ฒ„์‚ฌ์ด๋“œ ํด๋ง (60์ดˆ ๋Œ€๊ธฐ) ๋•Œ๋ฌธ์— ์ถ”๊ฐ€๋œ ๋ถ€๋ถ„์ž…๋‹ˆ๋‹ค! ๋ฆฌ๋ทฐ๊ฐ€ ์ƒ์„ฑ์ค‘์ด๋ฉด false, ๋ฆฌ๋ทฐ๊ฐ€ ์ƒ์„ฑ๋˜์—ˆ์œผ๋ฉด true๋ฅผ ์‘๋‹ตํ•ด์ฃผ๋ ค๊ณ  ํ•ด์š”. > ์•„์˜ˆ ์—†๋Š” ๋ฆฌ๋ทฐid๋ฅผ ์กฐํšŒํ•˜๋ ค๊ณ  ํ•จ ์—๋Ÿฌ ์‘๋‹ต์ด๋ž‘์€ ๋‹ค๋ฅธ๋‚ด์šฉ๊ฐ™์•„์„œ, ์—๋Ÿฌ ์‘๋‹ตํ…œํ”Œ๋ฆฟ์€ ๋”ฐ๋กœ ์ •์˜ํ•ด๋ณด๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ํ˜„์žฌ๋Š” ์—†๋Š” ๋ฆฌ๋ทฐ๋ฅผ ์กฐํšŒํ•˜๋ ค๊ณ  ํ•˜๋ฉด 400 BadRequest๋กœ ์‘๋‹ตํ•˜๊ณ  ์žˆ์”๋‹ˆ๋‹ค.
@@ -0,0 +1,17 @@ +package me.misik.api.api + +import me.misik.api.app.ReCreateReviewFacade +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +class ReviewController( +...
Kotlin
์˜คํƒ€์ž…๋‹ˆ๋‹ค! ์ˆ˜์ •ํ–ˆ์Šต๋‹ˆ๋‹ค ๐Ÿฅณ
@@ -0,0 +1,17 @@ +package me.misik.api.api + +import me.misik.api.app.ReCreateReviewFacade +import org.springframework.web.bind.annotation.PathVariable +import org.springframework.web.bind.annotation.PostMapping +import org.springframework.web.bind.annotation.RestController + +@RestController +class ReviewController( +...
Kotlin
์กฐํšŒ, ์ƒ์„ฑ(๋ฐ ์žฌ์ƒ์„ฑ) ๋‘ ์ผ€์ด์Šค ๋‹ค ์บ์‹ฑ ๊ฐ€์‹œ์ฃ ! ๐Ÿ‘
@@ -0,0 +1,14 @@ +const flowTypeDao = require('../models/flowTypeDao'); +const error = require('../utils/error'); + +const getFlowTypes = async () => { + const flowTypes = await flowTypeDao.getFlowTypes(); + if (flowTypes.length === 0) { + error.throwErr(404, 'NOT_FOUND_TYPE'); + } + return flowTypes; +} + +modu...
JavaScript
```suggestion return flowTypes; } ``` else ์—†์–ด๋„ ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค :)
@@ -0,0 +1,83 @@ +@import '../../../../../Styles/common.scss'; + +.navYeseul { + position: fixed; + top: 0; + left: 50%; + right: 0; + transform: translateX(-50%); + padding: 8px 0; + border-bottom: 1px solid $main-border; + background-color: #fff; + z-index: 9999; + + .inner-nav { + display: flex; + ju...
Unknown
css ์†์„ฑ ์ˆœ์„œ์— ๋”ฐ๋ฅด๋ฉด z-index๊ฐ€ ๊ฐ€์žฅ ์•„๋ž˜์— ์™€์•ผ ํ•  ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ˜€
@@ -0,0 +1,83 @@ +@import '../../../../../Styles/common.scss'; + +.navYeseul { + position: fixed; + top: 0; + left: 50%; + right: 0; + transform: translateX(-50%); + padding: 8px 0; + border-bottom: 1px solid $main-border; + background-color: #fff; + z-index: 9999; + + .inner-nav { + display: flex; + ju...
Unknown
common css์— ์žˆ์–ด์„œ ๋นผ์…”๋„ ๋  ๊ฒƒ ๊ฐ™์•„์š”!
@@ -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,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
์˜คํ™ ์˜ˆ์Šฌ๋‹˜์€ filter๋กœ ๊ตฌํ˜„ํ•˜์…จ๋„ค์—ฌ! :)
@@ -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
id๊ฐ’์œผ๋กœ key props ํ• ๋‹น ๐Ÿ‘ ๐Ÿ’ฏ ๐Ÿฅ‡
@@ -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
checkId์— ๋“ค์–ด๊ฐ€๋Š”๋ฐ์ดํ„ฐ๋Š” ์–ด๋–ค๊ฑธ ์˜๋ฏธํ•˜๋Š”๊ฑด๊ฐ€์—ฌ????
@@ -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
> checkId์— ๋“ค์–ด๊ฐ€๋Š”๋ฐ์ดํ„ฐ๋Š” ์–ด๋–ค๊ฑธ ์˜๋ฏธํ•˜๋Š”๊ฑด๊ฐ€์—ฌ???? ์ž…๋ ฅํ•œ ์•„์ด๋””๊ฐ€ ์ด๋ฉ”์ผ ํ˜•์‹์— ๋งž๋Š”์ง€ ์ฒดํฌํ•˜๋Š” ์ •๊ทœํ‘œํ˜„์‹์ด์—์š”! ๋„ค์ด๋ฐ์ด ์ง๊ด€์ ์ด์ง€ ์•Š์€๊ฐ€์š”??
@@ -0,0 +1,83 @@ +@import '../../../../../Styles/common.scss'; + +.navYeseul { + position: fixed; + top: 0; + left: 50%; + right: 0; + transform: translateX(-50%); + padding: 8px 0; + border-bottom: 1px solid $main-border; + background-color: #fff; + z-index: 9999; + + .inner-nav { + display: flex; + ju...
Unknown
์˜ค ๊ผผ๊ผผํžˆ ๋ด์ฃผ์…จ๋„ค์š” ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹น :) ๊ณ ์น˜๋Ÿฌ๊ฐ€์œ 
@@ -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,83 @@ +@import '../../../../../Styles/common.scss'; + +.navYeseul { + position: fixed; + top: 0; + left: 50%; + right: 0; + transform: translateX(-50%); + padding: 8px 0; + border-bottom: 1px solid $main-border; + background-color: #fff; + z-index: 9999; + + .inner-nav { + display: flex; + ju...
Unknown
์™œ ์ œ common์—” ์—†์ฃ ?!?!
@@ -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,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
๋ฐ˜์˜ํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค!
@@ -47,4 +47,13 @@ final class SettingViewModel { seconds: 0, identifier: "SelectedTimeNotification") } + + // URL ์—ด๊ธฐ ๋ฉ”์„œ๋“œ + func openURL(_ urlString: String) { + guard let url = URL(string: urlString), UIApplication.shared.canOpenURL(url) else { + print("์œ ํšจํ•˜์ง€ ์•Š...
Swift
url ์ด๋™์ด ์ด๋ ‡๊ฒŒ ๊ตฌํ˜„ํ•˜๋Š” ๊ฑฐ๊ตฐ์š”
@@ -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 ์ƒ์„ฑ ๋ฉ”์„œ๋“œ๋ฅผ ํ™œ์šฉํ•ด์„œ ๋ฆฌํŽ™ํ† ๋งํ•˜์˜€์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,209 @@ +import styled from '@emotion/styled'; +import { colors } from '@sopt-makers/colors'; +import { fonts } from '@sopt-makers/fonts'; +import { IconCheck, IconChevronDown } from '@sopt-makers/icons'; +import { Button } from '@sopt-makers/ui'; +import { ReactNode, useEffect, useState } from 'react'; + +im...
Unknown
๊ทธ `BottomSheetSelect`์ปดํฌ๋„ŒํŠธ๋ฅผ ์ด์ „์— ๋„์˜์ด๊ฐ€ ๊ตฌํ˜„ํ•ด์คฌ์—ˆ๋Š”๋ฐ ์š”๊ฒŒ ๋™์ผํ•œ ๋ชฉ์ ์„ ๊ฐ€์ง„ ์ปดํฌ๋„ŒํŠธ์ธ๊ฑธ๋กœ ๋ณด์—ฌ์„œ์š”..!!! ํ˜น์‹œ ๋”ฐ๋กœ ๊ตฌํ˜„ํ•˜์‹  ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”?? ํ˜น์‹œ ์กด์žฌํ•˜๋Š”์ง€ ๋ชฐ๋ž๋˜๊ฑธ๊นŒ ์ฃผ๋ฅต.. ๋งŒ์•ฝ์— ๊ทธ๋Ÿฐ๊ฒƒ์ด๋ผ๋ฉด ์–ด์ฐจํ”ผ mds๋กœ ๋Œ€์ฒด๋˜์–ด์•ผํ•  ๋ถ€๋ถ„์ด๋‹ˆ, ์ž˜ ์ž‘๋™ํ•œ๋‹ค๋ฉด ์ˆ˜์ •ํ•  ํ•„์š”๋Š” ์—†์„๊ฑฐ๊ฐ™์Šต๋‹ˆ๋‹ค!!!!
@@ -0,0 +1,328 @@ +import styled from '@emotion/styled'; +import { colors } from '@sopt-makers/colors'; +import { fonts } from '@sopt-makers/fonts'; +import { Button, Callout, SelectV2, Tag, TextArea, useDialog, useToast } from '@sopt-makers/ui'; +import { useMutation } from '@tanstack/react-query'; +import { useRouter...
Unknown
mutation ์‹คํŒจ์‹œ ์—๋Ÿฌ์ฒ˜๋ฆฌ๋„ ๋„ฃ์–ด์ฃผ๋ฉด ์ข‹์„๊ฑฐ๊ฐ™์•„์š”!! onError ์˜ต์…˜์„ ์ถ”๊ฐ€ํ•ด์„œ '๋ฌธ์ œ๊ฐ€ ๋ฐœ์ƒํ–ˆ์–ด์š”.' ์™€ ๊ฐ™์€ toast๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์–ด๋„ ์ข‹์„๊ฑฐ๊ฐ™์•„์š”!
@@ -0,0 +1,209 @@ +import styled from '@emotion/styled'; +import { colors } from '@sopt-makers/colors'; +import { fonts } from '@sopt-makers/fonts'; +import { IconCheck, IconChevronDown } from '@sopt-makers/icons'; +import { Button } from '@sopt-makers/ui'; +import { ReactNode, useEffect, useState } from 'react'; + +im...
Unknown
์•— ์ด๊ฑฐ ์ฝ”๋“œ ์ž์ฒด๊ฐ€ ๋„์˜์ด๊ฐ€ ๋งŒ๋“ ๊ฑฐ ๊ธฐ๋ฐ˜์ด ๋งž์Šต๋‹ˆ๋‹ค ใ…Žใ…Ž! ๋‹จ, ์ด๋ฒˆ์— mds ๋””์ž์ธ์ด ์—…๋ฐ์ดํŠธ ๋˜๋ฉด์„œ ๊ธฐ์กด ๋ฐ”ํ…€์‹œํŠธ ๋””์ž์ธ์ด ์•„๋‹ˆ๋ผ.. description ๋ถ€๋ถ„์ด ์ถ”๊ฐ€๋˜์–ด๊ฐ€์ง€๊ณ , ๋„์˜์ด๊ฐ€ ๋งŒ๋“ค์–ด์ค€ ์นœ๊ตฌ๋ž‘ ์กฐ๊ธˆ ๋‹ค๋ฅด๊ฒŒ ์ž‘๋™ํ•ด์•ผ ํ–ˆ์Šต๋‹ˆ๋‹ค..! ๊ธฐ์กด์— ์“ฐ์ด๋˜ ๋ฐ”ํ…€์‹œํŠธ๋ฅผ ์ˆ˜์ •ํ•˜๋ฉด ์‚ฌ์ด๋“œ์ดํŽ™ํŠธ๊ฐ€ ์ข€ ๋งŽ์ด ์ƒ๊ธธ ๊ฒƒ ๊ฐ™์•„์„œ ์ผ๋‹จ์€ ํ˜„์žฌ ์ปค์Šคํ…€์œผ๋กœ ๊ตฌํ˜„ํ•ด๋‘”๊ฑฐ๋ผ, Mds๋กœ ๋Œ€์ฒดํ•˜๋ฉด ๋  ๊ฒƒ๊ฐ™์•„์š”!
@@ -0,0 +1,328 @@ +import styled from '@emotion/styled'; +import { colors } from '@sopt-makers/colors'; +import { fonts } from '@sopt-makers/fonts'; +import { Button, Callout, SelectV2, Tag, TextArea, useDialog, useToast } from '@sopt-makers/ui'; +import { useMutation } from '@tanstack/react-query'; +import { useRouter...
Unknown
์•„์•„ ๋„ˆ๋ฌด ์ข‹์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,209 @@ +import styled from '@emotion/styled'; +import { colors } from '@sopt-makers/colors'; +import { fonts } from '@sopt-makers/fonts'; +import { IconCheck, IconChevronDown } from '@sopt-makers/icons'; +import { Button } from '@sopt-makers/ui'; +import { ReactNode, useEffect, useState } from 'react'; + +im...
Unknown
์•„ UI๊ฐ€ ์ข€ ๋‹ฌ๋ž๊ตฐ์š”~!!! ํ™•์ธํ–ˆ์Šต๋‹ˆ๋‹ค ใ…Žใ…Žใ…Ž
@@ -0,0 +1,31 @@ +package com.spoteditor.backend.domain.user.controller; + +import com.spoteditor.backend.common.exceptions.user.UserException; +import com.spoteditor.backend.common.exceptions.user.UserErrorCode; +import com.spoteditor.backend.domain.user.service.UserTokenService; +import jakarta.servlet.http.HttpServl...
Java
BaseException์ด RuntimeException์„ ์ƒ์†๋ฐ›๋Š” ์ €ํฌ ํ”„๋กœ์ ํŠธ์˜ ์ตœ์ƒ์œ„ ์˜ˆ์™ธ๊ฐ€ ๋งž๋‹ค๋ฉด ์ง์ ‘ ๋…ธ์ถœ์„ ํ•  ํ•„์š”๊ฐ€ ์—†์–ด๋ณด์ž…๋‹ˆ๋‹ค. ์ตœ์ƒ์œ„ ์–ธ์ฒดํฌ ์˜ˆ์™ธ๋ฅผ ๊ฐœ๋ฐœ ํ›„ ๊ทธ ์–ธ์ฒดํฌ ์˜ˆ์™ธ๋ฅผ ์ƒ์†๋ฐ›๊ณ  ๊ฐ๊ฐ์˜ ์ปค์Šคํ…€ ์˜ค๋ฅ˜ ์ฝ”๋“œ๋ฅผ ๋“ฑ๋กํ•œ๋‹ค๋ฉด ๋  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๋Š” ์„ธ๋ฐ€ํ•˜๊ฒŒ ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,41 @@ +package com.spoteditor.backend.domain.user.service; + +import com.spoteditor.backend.common.exceptions.user.UserErrorCode; +import com.spoteditor.backend.common.exceptions.user.UserException; +import com.spoteditor.backend.common.util.CookieUtils; +import com.spoteditor.backend.domain.user.common.dto....
Java
์ด ๋ถ€๋ถ„๋„ ๋™์ผํ•œ ๋งฅ๋ฝ์ž…๋‹ˆ๋‹ค.
@@ -0,0 +1,43 @@ +package com.spoteditor.backend.security.oauth.handler; + +import com.spoteditor.backend.common.util.CookieUtils; +import com.spoteditor.backend.security.jwt.JwtConstants; +import com.spoteditor.backend.security.jwt.JwtUtils; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpSe...
Java
`/success` ๊ฒฝ๋กœ๊ฐ€ ์ฝœ๋ฐฑ ์ฒ˜๋ฆฌ์ธ๊ฐ€์š”?
@@ -0,0 +1,43 @@ +package com.spoteditor.backend.security.oauth.handler; + +import com.spoteditor.backend.common.util.CookieUtils; +import com.spoteditor.backend.security.jwt.JwtConstants; +import com.spoteditor.backend.security.jwt.JwtUtils; +import jakarta.servlet.ServletException; +import jakarta.servlet.http.HttpSe...
Java
๋„ค ๋งž์Šต๋‹ˆ๋‹ค
@@ -0,0 +1,31 @@ +package com.spoteditor.backend.domain.user.controller; + +import com.spoteditor.backend.common.exceptions.user.UserException; +import com.spoteditor.backend.common.exceptions.user.UserErrorCode; +import com.spoteditor.backend.domain.user.service.UserTokenService; +import jakarta.servlet.http.HttpServl...
Java
๋‹ต๋ณ€์ฃผ์‹  ๋‚ด์šฉ์ด BaseException์„ ์ƒ์†๋ฐ›๋Š” ๊ฐ๊ฐ์˜ ์ปค์Šคํ…€ ์˜ค๋ฅ˜ ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•ด์„œ ๋” ์˜๋ฏธ๋ฅผ ๋ช…ํ™•ํ•˜๊ฒŒ ํ•˜๋ผ๋Š” ๋ง์”€์ด์‹ ๊ฐ€์š”?
@@ -0,0 +1,31 @@ +package com.spoteditor.backend.domain.user.controller; + +import com.spoteditor.backend.common.exceptions.user.UserException; +import com.spoteditor.backend.common.exceptions.user.UserErrorCode; +import com.spoteditor.backend.domain.user.service.UserTokenService; +import jakarta.servlet.http.HttpServl...
Java
๋„ค, ์ง€๊ธˆ ์ฝ”๋“œ๋ฅผ ๋ณด์‹œ๋ฉด BaseException์„ ๊ทธ๋Œ€๋กœ ๋ฐ˜ํ™˜ํ•˜๋„๋ก ๋˜์–ด ์žˆ๋Š”๋ฐ ์ถ”๊ฐ€ ์š”๊ตฌ์‚ฌํ•ญ ์ ‘์ˆ˜์‹œ ์œ ์ง€๋ณด์ˆ˜๊ฐ€ ์–ด๋ ค์šธ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,31 @@ +package com.spoteditor.backend.domain.user.controller; + +import com.spoteditor.backend.common.exceptions.user.UserException; +import com.spoteditor.backend.common.exceptions.user.UserErrorCode; +import com.spoteditor.backend.domain.user.service.UserTokenService; +import jakarta.servlet.http.HttpServl...
Java
๊ทธ๋ฆฌ๊ณ  ์ถ”๊ฐ€์ ์œผ๋กœ ๋ง์”€์„ ๋“œ๋ฆฌ๋Š”๊ฑด ์ €ํฌ ๊ฐ„ํŠธ ์ฐจํŠธ์— ์žˆ๋Š” ๊ทœ์•ฝ์„ ๋‹ค์‹œ ํ•œ ๋ฒˆ ์ดํ•ด๋ฅผ ํ•˜์…”์•ผ ํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค POST ์š”์ฒญ์ธ ๊ฒฝ์šฐ์—๋Š” ๋ถ„๋ช… ๋ฐ”๋””๊ฐ€ ์—†์ด HTTP Status Code๋ฅผ ๋ช…ํ™•ํ•˜๊ฒŒ ๋ณด๋‚ด์ค˜์•ผํ•˜๋Š”๋ฐ ์˜คํžˆ๋ ค List ์ปฌ๋ ‰์…˜์„ ๋ฐ˜ํ™˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค
@@ -0,0 +1,41 @@ +package com.spoteditor.backend.domain.user.service; + +import com.spoteditor.backend.common.exceptions.user.UserErrorCode; +import com.spoteditor.backend.common.exceptions.user.UserException; +import com.spoteditor.backend.common.util.CookieUtils; +import com.spoteditor.backend.domain.user.common.dto....
Java
์ด UserIdDto๋ฅผ ์ปจํŠธ๋กค๋Ÿฌ์—์„œ ์–ด๋–ป๊ฒŒ ํ™œ์šฉํ•  ์ˆ˜ ์žˆ๋Š”์ง€๋ฅผ ๋ฌธ์„œํ™”ํ•ด์ฃผ์‹œ๋ฉด ์ฝ์–ด๋ณด๊ณ  ๊ณต๊ฐ„ ์ธก์— ์ ์šฉํ•˜๊ฒ ์Šต๋‹ˆ๋‹ค.
@@ -12,9 +12,7 @@ import com.doubleowner.revibe.domain.user.entity.User; import com.doubleowner.revibe.global.config.auth.UserDetailsImpl; import com.doubleowner.revibe.global.exception.ImageException; -import com.doubleowner.revibe.global.exception.ReviewException; import com.doubleowner.revibe.global.exception.er...
Java
_:hammer_and_wrench: Refactor suggestion_ **RuntimeException ๋Œ€์‹  ๋งž์ถคํ˜• ์˜ˆ์™ธ๋ฅผ ์‚ฌ์šฉํ•ด์ฃผ์„ธ์š”** ์ผ๋ฐ˜์ ์ธ `RuntimeException` ๋Œ€์‹  ๋„๋ฉ”์ธ์— ๋งž๋Š” ๋งž์ถคํ˜• ์˜ˆ์™ธ ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์‚ฌ์šฉํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ํ•˜๋ฉด ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ์‹œ ๋” ๊ตฌ์ฒด์ ์ธ ์ •๋ณด๋ฅผ ์ œ๊ณตํ•˜๊ณ , ์˜ˆ์™ธ๋ฅผ ํšจ๊ณผ์ ์œผ๋กœ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, `PaymentNotFoundException`์„ ์ƒ์„ฑํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```java public class PaymentNotFoundException extends Runtime...
@@ -12,9 +12,7 @@ import com.doubleowner.revibe.domain.user.entity.User; import com.doubleowner.revibe.global.config.auth.UserDetailsImpl; import com.doubleowner.revibe.global.exception.ImageException; -import com.doubleowner.revibe.global.exception.ReviewException; import com.doubleowner.revibe.global.exception.er...
Java
_:hammer_and_wrench: Refactor suggestion_ **RuntimeException ๋Œ€์‹  ๋งž์ถคํ˜• ์˜ˆ์™ธ๋ฅผ ์‚ฌ์šฉํ•ด์ฃผ์„ธ์š”** `Execution` ๊ฐ์ฒด๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†์„ ๋•Œ `RuntimeException`์„ ๋ฐœ์ƒ์‹œํ‚ค๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋„๋ฉ”์ธ์— ๋งž๋Š” ๋งž์ถคํ˜• ์˜ˆ์™ธ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๋ฅผ ๊ฐœ์„ ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, `ExecutionNotFoundException`์„ ์ƒ์„ฑํ•˜์—ฌ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```java public class ExecutionNotFoundException extends RuntimeException { pu...
@@ -12,9 +12,7 @@ import com.doubleowner.revibe.domain.user.entity.User; import com.doubleowner.revibe.global.config.auth.UserDetailsImpl; import com.doubleowner.revibe.global.exception.ImageException; -import com.doubleowner.revibe.global.exception.ReviewException; import com.doubleowner.revibe.global.exception.er...
Java
_:warning: Potential issue_ **์˜ˆ์™ธ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค** `findMyReview` ๋ฉ”์„œ๋“œ๋ฅผ ํ˜ธ์ถœํ•œ ํ›„, ๋ฆฌ๋ทฐ๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์„ ๊ฒฝ์šฐ์— ๋Œ€ํ•œ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๋ฆฌ๋ทฐ๋ฅผ ์ฐพ์„ ์ˆ˜ ์—†๋Š” ๊ฒฝ์šฐ๋ฅผ ๋Œ€๋น„ํ•˜์—ฌ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๋ฅผ ์ถ”๊ฐ€ํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```diff -Review review = reviewRepository.findMyReview(id, userDetails.getUser().getId()); +Review review = reviewRepository.findMyReview(id, userDet...
@@ -12,9 +12,7 @@ import com.doubleowner.revibe.domain.user.entity.User; import com.doubleowner.revibe.global.config.auth.UserDetailsImpl; import com.doubleowner.revibe.global.exception.ImageException; -import com.doubleowner.revibe.global.exception.ReviewException; import com.doubleowner.revibe.global.exception.er...
Java
_:warning: Potential issue_ **์˜ˆ์™ธ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค** `deleteReview` ๋ฉ”์„œ๋“œ์—์„œ๋„ ๋ฆฌ๋ทฐ๋ฅผ ์ฐพ์ง€ ๋ชปํ•  ๊ฒฝ์šฐ๋ฅผ ๋Œ€๋น„ํ•œ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```diff -Review review = reviewRepository.findMyReview(id, user.getId()); +Review review = reviewRepository.findMyReview(id, user.getId()) + .orElseThrow(() -> new ReviewNotFoundException("๋ฆฌ๋ทฐ๋ฅผ ...
@@ -12,9 +12,7 @@ import com.doubleowner.revibe.domain.user.entity.User; import com.doubleowner.revibe.global.config.auth.UserDetailsImpl; import com.doubleowner.revibe.global.exception.ImageException; -import com.doubleowner.revibe.global.exception.ReviewException; import com.doubleowner.revibe.global.exception.er...
Java
_:warning: Potential issue_ **RuntimeException์— ์˜๋ฏธ ์žˆ๋Š” ๋ฉ”์‹œ์ง€๋ฅผ ์ถ”๊ฐ€ํ•ด์ฃผ์„ธ์š”** `orElseThrow`์—์„œ ์˜ˆ์™ธ๋ฅผ ๋ฐœ์ƒ์‹œํ‚ฌ ๋•Œ, ํ˜„์žฌ ๋ฉ”์‹œ์ง€๊ฐ€ ์—†๋Š” `RuntimeException`์„ ์‚ฌ์šฉํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ๋ช…ํ™•ํ•œ ์˜ˆ์™ธ ๋ฉ”์‹œ์ง€๋ฅผ ํฌํ•จํ•˜์—ฌ ๋ฌธ์ œ์˜ ์›์ธ์„ ์ „๋‹ฌํ•˜๋Š” ๊ฒƒ์ด ์ข‹์Šต๋‹ˆ๋‹ค. ์•„๋ž˜์™€ ๊ฐ™์ด ์ˆ˜์ •ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค: ```diff -Payment payment = paymentRepository.findByPaymentId(reviewRequestDto.getPaymentId()).orElseThrow(() -> new Ru...
@@ -6,6 +6,7 @@ import com.doubleowner.revibe.domain.review.service.ReviewService; import com.doubleowner.revibe.global.common.dto.CommonResponseBody; import com.doubleowner.revibe.global.config.auth.UserDetailsImpl; +import jakarta.validation.Valid; import lombok.RequiredArgsConstructor; import org.springframewor...
Java
_:bulb: Codebase verification_ **ํŒŒ์ผ ์—…๋กœ๋“œ ๋ณด์•ˆ ๊ฒ€์ฆ์ด ๋ฏธํกํ•ฉ๋‹ˆ๋‹ค** ํ˜„์žฌ ํŒŒ์ผ ํฌ๊ธฐ ์ œํ•œ(5MB)๋งŒ ์„ค์ •๋˜์–ด ์žˆ์œผ๋ฉฐ, ๋‹ค์Œ๊ณผ ๊ฐ™์€ ์ค‘์š”ํ•œ ๋ณด์•ˆ ๊ฒ€์ฆ์ด ๋ˆ„๋ฝ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค: 1. ์ด๋ฏธ์ง€ ํŒŒ์ผ ํ˜•์‹ ๊ฒ€์ฆ ๋กœ์ง (ํ—ˆ์šฉ๋œ ํ™•์žฅ์ž: jpg, png ๋“ฑ) 2. Content-Type ๊ฒ€์ฆ (`image/*`) 3. ํŒŒ์ผ๋ช… ๋ณด์•ˆ ์ฒ˜๋ฆฌ (XSS ๋ฐฉ์ง€๋ฅผ ์œ„ํ•œ ํŠน์ˆ˜๋ฌธ์ž ์ œ๊ฑฐ ๋“ฑ) ๊ตฌํ˜„ ์ œ์•ˆ: - `FileValidator` ํด๋ž˜์Šค๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ์œ„ ๊ฒ€์ฆ ๋กœ์ง์„ ๊ตฌํ˜„ํ•˜๊ณ  `ReviewService`์—์„œ ํ™œ์šฉ - ํŒŒ์ผ ์—…๋กœ๋“œ ์ „ `MediaType.I...
@@ -0,0 +1,45 @@ +package com.example.momogum.repository.redisRepository; + +import lombok.RequiredArgsConstructor; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Repository; + +import java.time.Duration; +import java.util.Objects; +import java.util.Set; +import java.u...
Java
redis template๋ฅผ ์ดํ•ดํ•˜๊ณ  ์‚ฌ์šฉํ•˜์‹  ๊ฒƒ ๊ฐ™๋„ค์š” ํ™•์‹คํžˆ ์ดํ•ด๋งŒ ์ž˜ ํ•  ์ˆ˜ ์žˆ๋‹ค๋ฉด crudRepository๋ณด๋‹ค template๊ตฌํ˜„ํ•˜๋Š”๊ฒŒ ์˜๋„๋ฅผ ๋” ์ž˜ ๋‹ด์„ ์ˆ˜ ์žˆ์–ด์„œ ์ข‹์€ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ณ ์ƒํ•˜์…จ์–ด์š”!
@@ -1,20 +1,59 @@ package com.example.momogum.config; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.sp...
Java
์ด๋ ‡๊ฒŒ ์ค‘๋ณต๋˜๋Š” ์„ค์ •๋ถ€๋ถ„์„ ๋”ฐ๋กœ ํด๋ž˜์Šค๋กœ ๋ถ„๋ฆฌํ•˜๋ฉด ๊ฐ€๋…์„ฑ์ด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค! ex) `private void setSerialzer { redisTemplate.setKeySerializer(new StringRedisSerializer()); redisTemplate.setHashKeySerializer(new StringRedisSerializer()); redisTemplate.setValueSerializer(new GenericJackson2JsonRedisSerializer()); ...
@@ -2,11 +2,24 @@ import com.example.momogum.domain.MealDiary; import com.example.momogum.domain.UserEntity; +import com.example.momogum.domain.common.enums.IsRevisit; +import io.lettuce.core.dynamic.annotation.Param; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jp...
Java
๋™์  ์ฟผ๋ฆฌ๊ฐ€ ๋งŽ์€ ๊ฒฝ์šฐ queryDsl๋„ ๊ดœ์ฐฎ์•„๋ณด์ž…๋‹ˆ๋‹ค. ์—ฌ๊ฒฌ์ƒ ๋„์ž…ํ•  ์ˆ˜ ์žˆ์œผ๋ฉด ํ•˜๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,45 @@ +package com.example.momogum.repository.redisRepository; + +import lombok.RequiredArgsConstructor; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Repository; + +import java.time.Duration; +import java.util.Objects; +import java.util.Set; +import java.u...
Java
`redisTemplate.opsForSet().members(key)` ์ด๋ถ€๋ถ„์—์„œ NullPointerException์ด ๋ฐœ์ƒํ•  ์ˆ˜๋„ ์žˆ๋‹ค๊ณ  ์ƒ๊ฐํ•˜๋Š”๋ฐ.. .. ์ž˜ ๋ชจ๋ฅด์ง€๋งŒ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋Š”์ง€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค
@@ -0,0 +1,111 @@ +package com.example.momogum.service.viewMealDiaryService; + +import com.example.momogum.domain.MealDiary; +import com.example.momogum.domain.MealDiaryImage; + +import com.example.momogum.domain.common.enums.IsRevisit; +import com.example.momogum.repository.mealDiaryRepo.MealDiaryRepository; +import c...
Java
์ด ๋ถ€๋ถ„์—์„œ id ๋ฐ˜ํ™˜/ dto ๋ณ€ํ™˜, redis ttl ์„ค์ • ์ด๋Ÿฐ์‹์œผ๋กœ ์žˆ๋Š” ๊ฒƒ ๊ฐ™์•„์„œ ํด๋ž˜์Šค 3๊ฐœ๋กœ ์ชผ๊ฐœ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค SRP
@@ -0,0 +1,45 @@ +package com.example.momogum.repository.redisRepository; + +import lombok.RequiredArgsConstructor; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Repository; + +import java.time.Duration; +import java.util.Objects; +import java.util.Set; +import java.u...
Java
๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค !
@@ -1,20 +1,59 @@ package com.example.momogum.config; +import org.springframework.beans.factory.annotation.Value; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.data.redis.connection.RedisConnectionFactory; +import org.sp...
Java
๊ฐ€๋…์„ฑ ๋ฟ๋งŒ ์•„๋‹ˆ๋ผ ์œ ์ง€๋ณด์ˆ˜์—์„œ๋„ ์ด์ ์ด ์žˆ์„๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค ! ์ง๋ ฌํ™”๊ฐ€ ํ•„์š”ํ•ด์„œ ๊ธ‰ํ•˜๊ฒŒ ์ถ”๊ฐ€ํ•˜๋‹ค ๋ณด๋‹ˆ ์‹œ์•ผ๊ฐ€ ์ข์•„์กŒ๋˜๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค ์ถฉ๊ณ  ๊ฐ์‚ฌํ•ฉ๋‹ˆ๋‹ค !
@@ -2,11 +2,24 @@ import com.example.momogum.domain.MealDiary; import com.example.momogum.domain.UserEntity; +import com.example.momogum.domain.common.enums.IsRevisit; +import io.lettuce.core.dynamic.annotation.Param; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jp...
Java
queryDSL์„ ๊ณ ๋ ค๋ฅผ ํ–ˆ์—ˆ๋Š”๋ฐ ์•„๋ฌด๋ž˜๋„ ์กฐ๊ธˆ์€ ํ›„์ˆœ์œ„๊ฐ€ ๋  ๋“ฏํ•ฉ๋‹ˆ๋‹ค ใ…œใ…œ
@@ -0,0 +1,45 @@ +package com.example.momogum.repository.redisRepository; + +import lombok.RequiredArgsConstructor; +import org.springframework.data.redis.core.RedisTemplate; +import org.springframework.stereotype.Repository; + +import java.time.Duration; +import java.util.Objects; +import java.util.Set; +import java.u...
Java
ํ˜„์žฌ ๊ฒ€์ฆ์ด๋‚˜ @annotation ๋ถ€๋ถ„์— ๋Œ€ํ•ด์„œ๋Š” ์ถ”๊ฐ€์ ์ธ mealdiary ์ˆ˜์ • ์‚ฌํ•ญ ๋ฐ˜์˜ํ•ด์„œ ์ง„ํ–‰ํ• ๋ ค๊ณ  ๊ณ„ํš์ค‘์ž…๋‹ˆ๋‹ค. ์กฐ๊ธˆ์”ฉ ๋ณ€๋™์‚ฌํ•ญ์ด ์žˆ์–ด ์ถ”ํ›„ ํ•œ๋ฒˆ์— ๊ฒ€์ฆ ๋‹จ๊ณ„์— ํ•„์š”ํ•œ ๋ถ€๋ถ„์„ ๋ชจ์•„๋‘˜๋ ค๊ณ  ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค !
@@ -0,0 +1,111 @@ +package com.example.momogum.service.viewMealDiaryService; + +import com.example.momogum.domain.MealDiary; +import com.example.momogum.domain.MealDiaryImage; + +import com.example.momogum.domain.common.enums.IsRevisit; +import com.example.momogum.repository.mealDiaryRepo.MealDiaryRepository; +import c...
Java
๋‹ค์‹œ ์ฝ์–ด ๋ณด๋‹ˆ ๋„ˆ๋ฌด ๋ฐ€์ง‘๋˜์–ด ์žˆ๋Š” ๊ฒƒ ๊ฐ™๋„ค์š” ,, ์ถ”ํ›„ 2์ฐจ ์„ค๊ณ„ ๋•Œ ์ด ๋ถ€๋ถ„ ๊ผญ ์ธ์ง€ํ•ด์„œ ๋ฆฌํŒฉํ„ฐ๋ง ์ง„ํ–‰ํ•ด๋ณด๊ฒ ์Šต๋‹ˆ๋‹ค !
@@ -1,18 +1,21 @@ -package com.antique.service; +package com.antique.service.review; import com.antique.domain.Product; import com.antique.domain.Review; -import com.antique.domain.User; import com.antique.dto.review.ReviewRequestDTO; +import com.antique.domain.User; import com.antique.dto.user.GetUserReviewDTO; ...
Java
์ˆ˜์ • ๋ฐ ์‚ญ์ œ ๋ฉ”์†Œ๋“œ์— ์•ˆ์ „ํ•œ ๋ฐ์ดํ„ฐ๋ฒ ์ด์Šค ์ž‘์—…์„ ์œ„ํ•ด์„œ @Transactional ์–ด๋…ธํ…Œ์ด์…˜์„ ๋ถ™์ด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„~~ ์ฐธ๊ณ ์ž๋ฃŒ https://velog.io/@zedy_dev/Transactional-%EC%96%B4%EB%85%B8%ED%85%8C%EC%9D%B4%EC%85%98%EC%9D%84-%ED%86%B5%ED%95%9C-%ED%8A%B8%EB%9E%9C%EC%9E%AD%EC%85%98-%EA%B4%80%EB%A6%AC-%EB%9E%80-%ED%99%9C%EC%9A%A9%EB%B0%A9%EB%B2%95-%EB%82%B4-%EA%B2%BD%ED%97...
@@ -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) ๊ณผ ๊ฐ™์€ ์Šคํƒ€์ผ์ด ๋˜๋ฉด ์ข‹๊ฒ ์Šต๋‹ˆ๋‹ค.