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) ๊ณผ ๊ฐ์ ์คํ์ผ์ด ๋๋ฉด ์ข๊ฒ ์ต๋๋ค. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.