code
stringlengths
41
34.3k
lang
stringclasses
8 values
review
stringlengths
1
4.74k
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
`idle` ์ด๋ฒคํŠธ๊ฐ€ ๋ธŒ๋ผ์šฐ์ € ์ฐฝ ํฌ๊ธฐ๋ฅผ ๋ณ€๊ฒฝํ• ๋•Œ ๋„ˆ๋ฌด ์ž์ฃผ ๋ฐœ์ƒํ•˜๋ฏ€๋กœ debounce ์ฒ˜๋ฆฌํ•˜๋Š”๊ฒŒ ์ข‹๊ฒ ์Œ
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
์ž…๋ ฅ๊ฐ’๋„ ์—†๊ณ , ๋ฆฌํ„ด๊ฐ’๋„ ๊ณ ์ •๊ฐ’์ธ๋ฐ ํ•จ์ˆ˜๋กœ ๋งŒ๋“ค์–ด์„œ ๋ฐ˜ํ™˜ํ•  ์ด์œ ๊ฐ€ ์—†์–ด๋ณด์ž„.
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
`mainPageLoad`์—์„œ ๋ฐ์ดํ„ฐ ๋กœ๋”ฉ์ด ๋๋‚˜๋Š” ์‹œ์ ์— ๋งž๊ฒŒ ๊ธฐ์กดํ•€์„ ์ œ๊ฑฐํ•˜๋Š” `DataDelete`๋ฅผ ์ฒ˜๋ฆฌํ•ด์•ผํ• ๋“ฏ ํ•จ.
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
์ดํ›„์— ```suggestion } else { this.drawList[el.id].setMap(null); delete this.drawList[el.id]; } ``` ์ด๋ ‡๊ฒŒ ํ•ด์•ผํ•˜์ง€ ์•Š์„๊นŒ?
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
ํ•„์š”์—†์Œ ์ œ๊ฑฐ
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
๊ฐ‘์ž๊ธฐ ์™œ ๋Œ€๋ฌธ์ž๋กœ ์‹œ์ž‘ํ• ๊นŒ์š”? ์ด๋ฆ„๋„ `deleteDraw` / `unsetDraw` ๋“ฑ์œผ๋กœ ํ•ด์•ผํ•  ๋“ฏ
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
`0.01`์„ ์ƒ์ˆ˜์ฒ˜๋ฆฌ
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
์ด๊ฒƒ๋งŒ underscore๋กœ ์‹œ์ž‘ํ•˜๋Š” ์ด์œ ๊ฐ€ ๋ชจ์—์š”? ๊ทธ๋ฆฌ๊ณ  ๋„ค์ด๋ฐ์œผ๋กœ ๋ฌด์Šจ ์ผ์„ ํ•˜๋Š” ๋ฉ”์„œ๋“œ์ธ์ง€ ์•Œ์•„์ฑ„๊ธฐ ํž˜๋“œ๋„ค์š”.
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
๋ฆฌํ„ด๊ฐ’์ด ๊ธฐ์กด๊ฐ’์ธ๊ฒŒ ์ด์ƒํ•œ๋ฐ, ์‚ดํŽด๋ณด๋‹ˆ ๋ฆฌํ„ด๊ฐ’ ๋ฐ›์•„์„œ ์“ฐ๋Š”๋ฐ๋„ ์—†๋Š”๊ฑฐ ๊ฐ™์•„์š”.
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
์ดํ›„ ์ฝ”๋“œ๊ฐ€ `mainPageLoad`๋ž‘ ์ค‘๋ณต๋˜๋Š” ๋ถ€๋ถ„์ด ๋งŽ์€๋ฐ ์ผ๋ฐ˜ํ™” ํ•ด์•ผ๊ฒ ๋„ค์š”.
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
style์„ inline์œผ๋กœ ์ง์ ‘ ์ง€์ •ํ•˜๋Š” ๊ฒƒ ๋ณด๋‹ค๋Š” style์€ `less(css)`์— ์ •์˜ํ•˜๊ณ  class๋ช…์„ toggle ํ•˜๋Š” ๋ฐฉ์‹์„ ์“ฐ๋Š”๊ฒŒ ์ข‹์•„์š”.
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
์—ฌ๊ธฐ๋„ ๋งˆ์ฐฌ๊ฐ€์ง€
@@ -0,0 +1,519 @@ +import React, { Component } from 'react'; +import * as d3 from 'd3'; +import drawData from './Module/loadHandle'; +import FilterContainer from './Components/FilterContainer'; +import LoginModal from './Components/LoginModal'; +import DrawContainer from './Components/DrawContainer'; +import './l...
JavaScript
`closeFn` ์ด๋ ‡๊ฒŒ postfix๋กœ ๋„ค์ด๋ฐํ•˜๋Š” ๊ฒƒ๋„ ๋‹ค๋ฅธ ํ•จ์ˆ˜๋“ค๊ณผ๋Š” ๋‹ค๋ฅธ ๋ฐฉ์‹์œผ๋กœ ์ฒ˜๋ฆฌ๋˜์—ˆ๋„ค์š”. ํ†ต์ผ์„ฑ์„ ์œ„ํ•ด ๊ทธ๋ƒฅ ๋–ผ๋Š”๊ฒŒ ์ข‹๊ฒ ์Œ. `onClose` ์ •๋„๋‚˜, ํ˜น์€ ์•„๋ž˜์ชฝ์—” `handle~` ์ด๋Ÿฐ์‹์œผ๋กœ ์ผ์œผ๋‹ˆ `handleToggle` ๋ญ ์ด๋Ÿฐ์‹์ด์–ด๋„ ์ข‹๊ฒ ๊ณ ์š”.
@@ -0,0 +1,62 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import Drawing from './Drawing'; +import '../less/Toolbox.less'; + +class DrawContainer extends Component { + static propTypes = { + drawingData: PropTypes.array.isRequired, + mapLoad: PropTypes.ob...
JavaScript
less ๋กœ ๋นผ๋‚ด๊ธฐ
@@ -0,0 +1,62 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import Drawing from './Drawing'; +import '../less/Toolbox.less'; + +class DrawContainer extends Component { + static propTypes = { + drawingData: PropTypes.array.isRequired, + mapLoad: PropTypes.ob...
JavaScript
{``} ๋กœ ๊ฐ์Œ€ ํ•„์š”๊ฐ€ ์—†์Œ
@@ -0,0 +1,438 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import '../less/Drawing.less'; +import Button from '../Module/Button'; +import Line from '../CustomOverlay/Line'; +import Arrow from '../CustomOverlay/Arrow'; +import Circle from '../CustomOverlay/Circle'; +import ...
JavaScript
key ์ •์˜ ์•ˆ๋˜์—ˆ์Œ
@@ -0,0 +1,438 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import '../less/Drawing.less'; +import Button from '../Module/Button'; +import Line from '../CustomOverlay/Line'; +import Arrow from '../CustomOverlay/Arrow'; +import Circle from '../CustomOverlay/Circle'; +import ...
JavaScript
์ƒ์ˆ˜๋กœ ๋บ„๊ฒƒ. ๊ณ ์ •๋œ ๊ฐ’์ด๋ผ๋ฉด state๋กœ ์ •์˜ํ•  ํ•„์š”์—†์Œ.
@@ -0,0 +1,438 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import '../less/Drawing.less'; +import Button from '../Module/Button'; +import Line from '../CustomOverlay/Line'; +import Arrow from '../CustomOverlay/Arrow'; +import Circle from '../CustomOverlay/Circle'; +import ...
JavaScript
icons์— ๋Œ€์‘ํ•˜๋Š” overlay ์˜ ํ˜•ํƒœ์ธ๊ฑฐ ๊ฐ™์€๋ฐ ์ƒ์ˆ˜๋กœ ๋นผ์„œ `const SHAPES = [{ icons: 'line', overlay: Line }, ...]` ์ด๋Ÿฐ์‹์œผ๋กœ ์ •์˜ํ•˜๋Š”๊ฒŒ ์ข‹๊ฒ ์Œ.
@@ -0,0 +1,438 @@ +import React, { Component } from 'react'; +import PropTypes from 'prop-types'; +import '../less/Drawing.less'; +import Button from '../Module/Button'; +import Line from '../CustomOverlay/Line'; +import Arrow from '../CustomOverlay/Arrow'; +import Circle from '../CustomOverlay/Circle'; +import ...
JavaScript
break; ์•ˆํ•˜๋ฉด ๋ฐฐ์—ด ๊ณ„์† ์ˆœํšŒํ•จ.
@@ -0,0 +1,96 @@ +import React, { Component } from 'react'; +import '../less/Filter.less'; +import PropTypes from 'prop-types'; +import FilterBox from './FilterBox'; +import * as constants from '../constants'; + +class Filter extends Component { + static propTypes = { + MyInfoButton: PropTypes.bool.is...
JavaScript
์ƒ์ˆ˜...
@@ -0,0 +1,96 @@ +import React, { Component } from 'react'; +import '../less/Filter.less'; +import PropTypes from 'prop-types'; +import FilterBox from './FilterBox'; +import * as constants from '../constants'; + +class Filter extends Component { + static propTypes = { + MyInfoButton: PropTypes.bool.is...
JavaScript
css๋กœ ๋นผ๋‚ด๊ธฐ
@@ -0,0 +1,96 @@ +import React, { Component } from 'react'; +import '../less/Filter.less'; +import PropTypes from 'prop-types'; +import FilterBox from './FilterBox'; +import * as constants from '../constants'; + +class Filter extends Component { + static propTypes = { + MyInfoButton: PropTypes.bool.is...
JavaScript
๊ฐ์Œ€ํ•„์š” ์—†์Œ
@@ -11,13 +11,19 @@ "test": "jest" }, "dependencies": { + "identity-obj-proxy": "^3.0.0", + "jest-svg-transformer": "^1.0.0", "react": "^18.2.0", "react-dom": "^18.2.0", "react-error-boundary": "^4.0.13", + "react-router-dom": "^6.23.1", "recoil": "^0.7.7", - "styled-component...
Unknown
์ด๊ฑด ์–ด๋””์— ์“ฐ์˜€๋Š”์ง€ ๊ถ๊ธˆํ•ด์š”~~
@@ -0,0 +1,18 @@ +import * as Styled from './style'; + +interface HeaderProps { + title: string; + onClick?: () => void; +} + +const Header = ({ title, onClick }: HeaderProps) => { + return ( + <Styled.Header> + <Styled.AppTitle onClick={() => onClick && onClick()}> + {title} + </Styled.AppTitle>...
Unknown
๊ทธ๋ƒฅ onClick์„ ๋„ฃ์–ด์ค˜๋„ ๊ดœ์ฐฎ์„ ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,73 @@ +import { CartItem } from '../../type'; +import * as Styled from './style'; +import CheckedBox from '../assets/CheckedBox.svg'; +import UnCheckedBox from '../assets/UnCheckedBox.svg'; +import PlusButton from '../assets/PlusButton.svg'; +import MinusButton from '../assets/MinusButton.svg'; +import BinBu...
Unknown
์ €๋Š” ์™ธ๋ถ€์—์„œ ํ•จ์ˆ˜๋ฅผ ์ฃผ์ž…๋ฐ›์„ ๋•Œ, ์ตœ๋Œ€ํ•œ ์ธ์ž์™€ ๋ฐ˜ํ™˜๊ฐ’ ํƒ€์ž…์„ ์ฃผ์ง€ ์•Š์œผ๋ ค๊ณ  ํ•ด์š”.( ()=>void) ์‚ฌ์šฉ์ฒ˜์—์„œ์˜ ์ž์œ ๋„๋ฅผ ๋†’์ด๊ธฐ ์œ„ํ•จ์ธ๋ฐ์š”. ํ•ด์‹œ๋Š” ํ•จ์ˆ˜๋ฅผ ์ฃผ์ž… ๋ฐ›์„ ๋•Œ ๊ทธ ํ•จ์ˆ˜์˜ ์ธ์ž ํƒ€์ž…์„ ์ฃผ๋Š” ๊ฒƒ ๊ฐ™์•„์š”. ๊ทธ๋ ‡๊ฒŒํ•˜๋Š” ์ด์œ ๊ฐ€ ์žˆ์„๊นŒ์š”??(๊ทผ๋ฐ ์•„๋งˆ ๊ฐœ์ธ ์ทจํ–ฅ์˜ ์˜์—ญ์ผ๋“ฏ..?)
@@ -0,0 +1,68 @@ +import { CartItem } from '../../type'; +import Item from './Item'; +import * as Styled from './style'; +import CheckedBox from '../assets/CheckedBox.svg'; +import UnCheckedBox from '../assets/UnCheckedBox.svg'; +import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; +import { Sele...
Unknown
์•„๋งˆ ์ด tryCatch ๋ฌธ์—์„œ๋Š” ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ๋ฅผ ์ปค๋ฒ„ํ•˜๊ธฐ ์œ„ํ•ด ์ด๋Ÿฐ์‹์œผ๋กœ ์ž‘์„ฑํ•œ ๊ฒƒ ๊ฐ™์€๋ฐ์š”. updateCartItem์„ ๋ฐ–์œผ๋กœ ๋นผ๋ฉด ์—๋Ÿฌ ํ•ธ๋“ค๋ง์ด ์กฐ๊ธˆ ๋” ๋ช…ํ™•ํ•ด์งˆ ๊ฒƒ ๊ฐ™์•„์š”. ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ์„ ๊ฒฝ์šฐ์—๋Š” catch๋ฌธ์—์„œ return์„ ํ•˜๋ฉด ์›ํ•˜๋Š” ๊ฒฐ๊ณผ๊ฐ€ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ์„ ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•ด์š”.
@@ -0,0 +1,68 @@ +import { CartItem } from '../../type'; +import Item from './Item'; +import * as Styled from './style'; +import CheckedBox from '../assets/CheckedBox.svg'; +import UnCheckedBox from '../assets/UnCheckedBox.svg'; +import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; +import { Sele...
Unknown
๊ทธ๋ฆฌ๊ณ  ์ด๋ ‡๊ฒŒ ์—๋Ÿฌ์ปจํŠธ๋กค์„ ํ•˜๋‹ˆ๊นŒ ๋„คํŠธ์›Œํฌ ์—๋Ÿฌ๊ฐ€ ๋‚ฌ์„ ๋•Œ ์ˆ˜๋Ÿ‰ ๋ฐ˜์˜์ด ์•ˆ๋˜๋Š” ํšจ๊ณผ๊ฐ€ ์žˆ๋„ค์š”! ๋‚™๊ด€์  ์—…๋ฐ์ดํŠธ๋Š” ๋˜์ง€ ์•Š์ง€๋งŒ ์ด๊ฒƒ๋„ ์ด๊ฒƒ ๋‚˜๋ฆ„์˜ ํšจ๊ณผ๊ฐ€ ์žˆ์„ ๊ฒƒ ๊ฐ™๋‹ค๋Š” ์ƒ๊ฐ์ด ๋“ค์–ด์š”!
@@ -0,0 +1,68 @@ +import { CartItem } from '../../type'; +import Item from './Item'; +import * as Styled from './style'; +import CheckedBox from '../assets/CheckedBox.svg'; +import UnCheckedBox from '../assets/UnCheckedBox.svg'; +import { useRecoilState, useRecoilValue, useSetRecoilState } from 'recoil'; +import { Sele...
Unknown
์‚ญ์ œ๊ธฐ๋Šฅ์ด ์ž˜ ๋™์ž‘ํ•˜๋Š” ์ง€ ๊ถ๊ธˆํ•ด์š”.. ์ฝ”๋“œ๋งŒ ๋ดค์„ ๋•Œ์—๋Š” ์‚ญ์ œ๋ฅผ ํ•˜๋ฉด ๋ชจ๋“  ์•„์ดํ…œ์ด ๋‹ค ์‚ญ์ œ๋  ๊ฒƒ ๊ฐ™๋‹ค๋Š” ๋А๋‚Œ์ด ๋“ค์–ด์„œ์š”
@@ -0,0 +1,549 @@ +import json +import os +from typing import List, Tuple +import requests +import re +import groq +import logging +from review_config import ( + IGNORED_EXTENSIONS, + IGNORED_FILES, + IMPORTANT_FILE_CHANGE_THRESHOLD, + MAX_COMMENTS_PER_FILE +) + +from scripts.review_prompt import ( + ...
Python
AI Code Review: ๋‹ค์Œ์€ ๊ฐ ํ•ญ๋ชฉ์— ๋Œ€ํ•ด ๋ฌธ์ œ์ ์„ ์ง€์ ํ•˜๊ณ  ๊ฐœ์„  ๋ฐฉ์•ˆ์„ ์ œ์‹œํ•ฉ๋‹ˆ๋‹ค. **1. Pre-condition Check** * `github_token` ๋ณ€์ˆ˜์˜ ์ƒํƒœ๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ `os.environ['GITHUB_TOKEN']`๊ฐ€ None์ด๋ฉด ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒใ—ใพใ™. `github_token` ๋ณ€์ˆ˜๋Š” ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋กœ ์„ค์ •๋˜์–ด์•ผ ํ•˜๋ฉฐ, None์ด๋ฉด ์ฝ”๋“œ ์ž‘๋™ํ•˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. * `repo` ๋ณ€์ˆ˜์˜ ์ƒํƒœ๋ฅผ ํ™•์ธํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. ํ˜„์žฌ `os.environ['GITHUB_REPOSITORY']`๊ฐ€ None์ด๋ฉด ์˜ˆ์™ธ๊ฐ€ ๋ฐœ์ƒํ•ฉ๋‹ˆ๋‹ค. `repo` ๋ณ€์ˆ˜๋Š” ...
@@ -0,0 +1,60 @@ +name: AI Code Review + +on: + pull_request: + types: [opened, synchronize] + +permissions: + contents: read + pull-requests: write + +jobs: + code-review: + runs-on: ubuntu-latest + # runs-on: self-hosted + + steps: + - uses: actions/checkout@v4 + + # - name: Set Python Pat...
Unknown
AI Code Review: 1. Pre-condition Check: - ํ•จ์ˆ˜๋‚˜ ๋ฉ”์„œ๋“œ๊ฐ€ ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์ž‘๋™ํ•˜๊ธฐ ์œ„ํ•ด ํ•„์š”ํ•œ ๋ณ€์ˆ˜์˜ ์ƒํƒœ๋‚˜ ๊ฐ’์˜ ๋ฒ”์œ„๋ฅผ ๊ฐ€์ง€๊ณ  ์žˆ๋Š”์ง€ ๊ฒ€์‚ฌ ๋ฌธ์ œ์ : - ํ˜„์žฌ ์ฝ”๋“œ๋Š” GITHUB_TOKEN์„ ์‚ฌ์šฉํ•˜์—ฌ AI Code Review๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ํ•˜์ง€๋งŒ GITHUB_TOKEN์€ secrets์— ๅญ˜๊ณ  ์žˆ๋Š” secretes.GITHUB_TOKEN์˜ ๊ฐ’์ด ์˜ฌ๋ฐ”๋ฅธ์ง€ ํ™•์ธ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. - ๋‹ค๋ฅธ ๋ณ€์ˆ˜๋‚˜ ๊ฐ’์ด ์˜ฌ๋ฐ”๋ฅด๊ฒŒ ์„ค์ •๋˜์–ด ์žˆ๋Š”์ง€ ํ™•์ธ๋˜์ง€ ์•Š์Šต๋‹ˆ๋‹ค. ๊ฐœ์„  ๋ฐฉ์•ˆ: - GITHUB_TOKEN์˜ ๊ฐ’์ด ์˜ฌ๋ฐ”๋ฅธ์ง€ ํ™•์ธํ•˜...
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
AI Code Review: 1. Pre-condition Check: ๋ฌธ์ œ์ : ์ฝ”๋“œ๋Š” ๋ณ€์ˆ˜์˜ ์ƒํƒœ๋‚˜ ๊ฐ’์˜ ๋ฒ”์œ„๋ฅผ ๊ฒ€์‚ฌํ•˜์ง€ ์•Š๊ณ  directly ์‚ฌ์šฉํ•˜๋Š” ๊ฒฝ์šฐ๊ฐ€ ๋งŽ์Šต๋‹ˆ๋‹ค. ๊ฐœ์„  ๋ฐฉ์•ˆ: ํ•จ์ˆ˜๋‚˜ ๋ฉ”์„œ๋“œ์—์„œ ํ•„์š”ํ•œ ๋ณ€์ˆ˜์˜ ์ƒํƒœ๋‚˜ ๊ฐ’์˜็ฏ„์œ„๋ฅผเธ•เธฃเธงเธˆเธชเธญเธšํ•˜๊ณ , ํ•„์š”ํ•œ ๊ฒฝ์šฐ ์˜ˆ์™ธ ์ฒ˜๋ฆฌ๋‚˜ rร ng์ œ๋ฅผ ์‚ฌ์šฉํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, ์ˆซ์ž๊ฐ€ negative๋กœ ๋‚˜์˜ฌ ์ˆ˜ ์žˆ๋Š”์ง€ ํ™•์ธํ•˜๊ธฐ ์œ„ํ•ด `if` ๊ตฌ๋ฌธ๊ณผ `try-except` ๋ธ”๋ก์„ ์‚ฌ์šฉํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. ```python def example_function(num): if num < 0: r...
@@ -0,0 +1,549 @@ +import json +import os +from typing import List, Tuple +import requests +import re +import groq +import logging +from review_config import ( + IGNORED_EXTENSIONS, + IGNORED_FILES, + IMPORTANT_FILE_CHANGE_THRESHOLD, + MAX_COMMENTS_PER_FILE +) + +from scripts.review_prompt import ( + ...
Python
## .github/scripts/ai_code_review.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ GitHub Actions๋ฅผ ํ†ตํ•ด PR(ํ’€ ใƒชใ‚ฏใ‚จใ‚นใƒˆ)์„ ๊ฒ€ํ† ํ•˜๊ณ , ๋ฆฌ๋ทฐ ์ฝ”๋ฉ˜ํŠธ๋ฅผ ๊ฒŒ์‹œํ•˜๋Š” ์Šคํฌ๋ฆฝํŠธ์ž…๋‹ˆ๋‹ค. ์ฃผ์š” ๊ธฐ๋Šฅ์œผ๋กœ๋Š” PR ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€์„œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ , ์ค‘์š” ํŒŒ์ผ์— ๋Œ€ํ•œ ์ƒ์„ธ ๋ฆฌ๋ทฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋ฉฐ, ๋ผ์ธ ๋ณ„ ์ฝ”๋ฉ˜ํŠธ๋ฅผ ๊ฒŒ์‹œํ•˜๋Š” ๋“ฑ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ์Šคํฌ๋ฆฝํŠธ๋Š” GitHub API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ PR ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€์„œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ , ๋ฆฌ๋ทฐ ์ฝ”๋ฉ˜ํŠธ๋ฅผ ๊ฒŒ์‹œํ•˜๋Š” ๋“ฑ ์ž๋™ํ™”๋œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ตฌํ˜„ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. * ์ค‘์š” ํŒŒ์ผ์— ๋Œ€ํ•œ ์ƒ์„ธ ๋ฆฌ...
@@ -0,0 +1,60 @@ +name: AI Code Review + +on: + pull_request: + types: [opened, synchronize] + +permissions: + contents: read + pull-requests: write + +jobs: + code-review: + runs-on: ubuntu-latest + # runs-on: self-hosted + + steps: + - uses: actions/checkout@v4 + + # - name: Set Python Pat...
Unknown
## .github/workflows/code-review.yml ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ GitHub Actions ์›Œํฌํ”Œ๋กœ์šฐ๋ฅผ ์ •์˜ํ•˜๋ฉฐ, Pull Request ์ด๋ฒคํŠธ์— ๋Œ€ํ•œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ž๋™ํ™”ํ•ฉ๋‹ˆ๋‹ค. ์›Œํฌํ”Œ๋กœ์šฐ๋Š” Ubuntu ์ตœ์‹  ๋ฒ„์ „์—์„œ ์‹คํ–‰๋˜๋ฉฐ, Python 3.x ํ™˜๊ฒฝ์„ ์„ค์ •ํ•˜๊ณ , ์˜์กด์„ฑ์„ ์„ค์น˜ํ•˜๊ณ , AI ์ฝ”๋“œ ๋ฆฌ๋ทฐ ์Šคํฌ๋ฆฝํŠธ๋ฅผ ์‹คํ–‰ํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ์›Œํฌํ”Œ๋กœ์šฐ๋Š” Pull Request ์ด๋ฒคํŠธ์— ๋Œ€ํ•œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ž๋™ํ™”ํ•˜์—ฌ ๊ฐœ๋ฐœ ํ”„๋กœ์„ธ์Šค๋ฅผ ํšจ์œจ์ ์œผ๋กœ ๊ฐœ์„ ํ•ฉ๋‹ˆ๋‹ค. * Python 3.x ํ™˜๊ฒฝ์„ ์„ค์ •ํ•˜๊ณ , ์˜์กด์„ฑ์„ ์„ค์น˜ํ•˜์—ฌ ์ฝ”๋“œ ๋ฆฌ๋ทฐ ...
@@ -25,3 +25,4 @@ flake8-comprehensions flake8-pytest-style isort mypy +groq \ No newline at end of file
Unknown
## app/backend/requirements.txt ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ app/backend/requirements.txt ํŒŒ์ผ์€ Python ํ”„๋กœ์ ํŠธ์˜ ๋ฐฑ์—”๋“œ ์ข…์†์„ฑ ๋ชฉ๋ก์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ์ด ํŒŒ์ผ์—๋Š” ํ”„๋กœ์ ํŠธ์—์„œ ์‚ฌ์šฉํ•˜๋Š” ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ํŒจํ‚ค์ง€์˜ ๋ฒ„์ „์ด ํฌํ•จ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ### ์ข‹์€ ์  - ํ”„๋กœ์ ํŠธ์˜ ์ข…์†์„ฑ์„ ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. - ๊ฐ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ํŒจํ‚ค์ง€์˜ ๋ฒ„์ „์„ ์ง€์ •ํ•˜์—ฌ ํ”„๋กœ์ ํŠธ์˜ ์•ˆ์ •์„ฑ์„ ๋ณด์žฅํ•ฉ๋‹ˆ๋‹ค. - ๋‹ค์–‘ํ•œ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ํŒจํ‚ค์ง€๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ํ”„๋กœ์ ํŠธ์˜ ๊ธฐ๋Šฅ์„ ํ™•์žฅํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  - ์ผ๋ถ€ ๋ผ์ด๋ธŒ๋Ÿฌ๋ฆฌ์™€ ํŒจํ‚ค์ง€์˜ ๋ฒ„์ „์ด ๋ช…์‹œ...
@@ -2,7 +2,7 @@ from dotenv import load_dotenv # load .env file -load_dotenv() +load_dotenv('app/backend/.env') from pydantic import ( PostgresDsn, @@ -73,6 +73,9 @@ class Settings(BaseSettings): # ALGORITHM : str # ACCESS_TOKEN_EXPIRE_MINUTES : int + # Groq API + GROQ_API_KEY: str + ...
Python
## app/backend/src/main/core/config.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ ํ”„๋กœ์ ํŠธ์˜ ์„ค์ •์„ ์ •์˜ํ•˜๊ณ  ๊ด€๋ฆฌํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ํ”„๋กœ์ ํŠธ์˜ ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋ฅผ ๋กœ๋“œํ•˜๊ณ , ์„ค์ • ํด๋ž˜์Šค๋ฅผ ์ •์˜ํ•˜์—ฌ ์„ค์ • ๊ฐ’์„ ๊ด€๋ฆฌํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ํ”„๋กœ์ ํŠธ์˜ ์„ค์ •์„ ๋ณ„๋„์˜ ํŒŒ์ผ๋กœ ๋ถ„๋ฆฌํ•˜์—ฌ ๊ด€๋ฆฌํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ํ”„๋กœ์ ํŠธ์˜ ์ฝ”๋“œ๋ฅผ ๊น”๋”ํ•˜๊ฒŒ ์œ ์ง€ํ•˜๊ณ , ์„ค์ • ๊ฐ’์„ ์‰ฝ๊ฒŒ ๊ด€๋ฆฌํ•  ์ˆ˜ ์žˆ๋„๋ก ํ•ฉ๋‹ˆ๋‹ค. * Pydantic์„ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์ • ํด๋ž˜์Šค๋ฅผ ์ •์˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋Š” ์„ค์ • ๊ฐ’์˜ ํƒ€์ž…์„ ๊ฐ•์ œํ•˜๊ณ , ์œ ํšจ์„ฑ์„ ๊ฒ€์ฆํ•˜์—ฌ ์˜ค๋ฅ˜๋ฅผ ๋ฐฉ์ง€ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. * dotenv๋ฅผ...
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
## scripts/review_prompt.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์— ๋Œ€ํ•œ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ œ๊ณตํ•˜๋Š” ๊ธฐ๋Šฅ์„ ๋‹ด๋‹นํ•ฉ๋‹ˆ๋‹ค. ๋‹ค์–‘ํ•œ ์œ ํ˜•์˜ ๋ฆฌ๋ทฐ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ •์˜ํ•˜๊ณ , ํ•„์š”ํ•œ ๋ฐ์ดํ„ฐ๋ฅผ ํฌํ•จํ•˜์—ฌ ํ”„๋กฌํ”„ํŠธ๋ฅผ ๋ฐ˜ํ™˜ํ•˜๋Š” ํ•จ์ˆ˜๋“ค์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  - ์ฝ”๋“œ๋Š” ๊ฐ€๋…์„ฑ์ด ์ข‹๊ณ , ๊ฐ ํ•จ์ˆ˜์˜ ์—ญํ• ์ด ๋ช…ํ™•ํ•ฉ๋‹ˆ๋‹ค. - ํ”„๋กฌํ”„ํŠธ ํ…œํ”Œ๋ฆฟ์€ string.format() ๋ฉ”์„œ๋“œ๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ๋™์ ์œผ๋กœ ๋ฐ์ดํ„ฐ๋ฅผ ํฌํ•จํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. - ํ•จ์ˆ˜๋ช…๊ณผ ๋ณ€์ˆ˜๋ช…์ด ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  - ํ•จ์ˆ˜์˜ ์—ญํ• ์ด ๋ช…ํ™•ํ•˜์ง€๋งŒ, ํ•จ์ˆ˜์˜ ์„ค๋ช…๊ณผ ๋„ํ๋จผํŠธ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค....
@@ -0,0 +1,549 @@ +import json +import os +from typing import List, Tuple +import requests +import re +import groq +import logging +from review_config import ( + IGNORED_EXTENSIONS, + IGNORED_FILES, + IMPORTANT_FILE_CHANGE_THRESHOLD, + MAX_COMMENTS_PER_FILE +) + +from scripts.review_prompt import ( + ...
Python
## ์ „์ฒด ์ฝ”๋“œ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” GitHub PR ๋ฆฌ๋ทฐ๋ฅผ ์œ„ํ•œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ ์ž๋™ํ™” ํˆด์ž…๋‹ˆ๋‹ค. ์ฃผ์š” ๊ธฐ๋Šฅ์œผ๋กœ๋Š” PR์— ํฌํ•จ๋œ ํŒŒ์ผ์˜ ์ค‘์š”๋„๋ฅผ ํŒ๋‹จํ•˜๊ณ , ์ค‘์š” ํŒŒ์ผ์— ๋Œ€ํ•œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ PR ์ฝ”๋ฉ˜ํŠธ๋กœ ๊ฒŒ์‹œํ•˜๋Š” ๊ฒƒ์ž…๋‹ˆ๋‹ค. ### ์ข‹์€ ์  1. PR ๋ฆฌ๋ทฐ ํ”„๋กœ์„ธ์Šค๋ฅผ ์ž๋™ํ™”ํ•˜์—ฌ ๋ฆฌ๋ทฐ์–ด์˜ ์—…๋ฌด๋Ÿ‰์„ ์ค„์—ฌ ์ค๋‹ˆ๋‹ค. 2. ์ค‘์š” ํŒŒ์ผ์„ ํŒ๋‹จํ•˜์—ฌ ๋ฆฌ๋ทฐ์˜ ํšจ์œจ์„ฑ์„ ๋†’์ž…๋‹ˆ๋‹ค. 3. GitHub API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ PR ์ฝ”๋ฉ˜ํŠธ๋ฅผ ์ž๋™์œผ๋กœ ์ƒ์„ฑํ•˜์—ฌ ๋ฆฌ๋ทฐ ํ”„๋กœ์„ธ์Šค๋ฅผ ๊ฐ„์†Œํ™”ํ•ฉ๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  1. ์ฝ”๋“œ์˜ ๊ฐ€๋…์„ฑ์„ ๋†’์ด๊ธฐ ์œ„ํ•ด ํ•จ์ˆ˜ ๋ถ„๋ฆฌ ๋ฐ ์ฃผ์„ ์ถ”๊ฐ€๊ฐ€ ...
@@ -0,0 +1,27 @@ +# ๋ฆฌ๋ทฐ์—์„œ ์ œ์™ธํ•  ํŒŒ์ผ ๋ชฉ๋ก +IGNORED_FILES = [ + '.gitignore', + 'requirements.txt', + 'docker-compose.yml', + 'Dockerfile', + 'setup.cfg', + 'pyproject.toml', + '.env.example', + 'README.md', + 'LICENSE', +] + +# ๋ฆฌ๋ทฐ์—์„œ ์ œ์™ธํ•  ํŒŒ์ผ ํ™•์žฅ์ž +IGNORED_EXTENSIONS = [ + '.md', + '.txt', + ...
Python
## .github/scripts/review_config.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ GitHub ๋ฆฌ๋ทฐ์— ๋Œ€ํ•œ ์„ค์ •์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์ฆ‰, ๋ฆฌ๋ทฐ์—์„œ ์ œ์™ธํ•  ํŒŒ์ผ ๋ชฉ๋ก, ํŒŒ์ผ ํ™•์žฅ์ž, ์ค‘์š” ํŒŒ์ผ ํŒ๋‹จ ๊ธฐ์ค€ ๋“ฑ์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ํŒŒ์ผ์„ ๊ฐ€๋…์„ฑ ์žˆ๊ฒŒ ๊ตฌ์กฐํ™”ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. * ๋ณ€์ˆ˜๋ช…์ด ๋ช…ํ™•ํ•˜๊ณ  ์ดํ•ดํ•˜๊ธฐ ์‰ฝ์Šต๋‹ˆ๋‹ค. * ์ฃผ์„์ด ์ ์ ˆํ•˜๊ฒŒ ์ž‘์„ฑ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  * IGNORED_FILES ๋ชฉ๋ก์ด ๋„ˆ๋ฌด ๊ธธ์–ด ์ฝ”๋“œ ๊ฐ€๋…์„ฑ์„ ํ•ด์นฉ๋‹ˆ๋‹ค. ์ด๋ฅผ ๊ฐœ์„ ํ•˜์—ฌ ๋” ๊ฐ€๋…์„ฑ ์žˆ๊ฒŒ ์ž‘์„ฑํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค. * IMPORTANT_FILE_CHA...
@@ -2,7 +2,7 @@ from dotenv import load_dotenv # load .env file -load_dotenv() +load_dotenv('app/backend/.env') from pydantic import ( PostgresDsn, @@ -73,6 +73,9 @@ class Settings(BaseSettings): # ALGORITHM : str # ACCESS_TOKEN_EXPIRE_MINUTES : int + # Groq API + GROQ_API_KEY: str + ...
Python
## app/backend/src/main/core/config.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ ํ”„๋กœ์ ํŠธ์˜ ์„ค์ •์„ ๊ด€๋ฆฌํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ์„ค์ •์€ `.env` ํŒŒ์ผ์—์„œ ์ฝ์–ด๋“ค์—ฌ Pydantic์˜ `BaseSettings` ํด๋ž˜์Šค๋ฅผ ํ†ตํ•ด ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ์ˆ˜ํ–‰ํ•˜๊ณ , ์„ค์ •์„ ์ €์žฅํ•˜๋Š” ํด๋ž˜์Šค `Settings`๋ฅผ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * `.env` ํŒŒ์ผ์„ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์ •์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐฉ์‹์€ ์ผ๋ฐ˜์ ์ด๊ณ  ํŽธ๋ฆฌํ•ฉ๋‹ˆ๋‹ค. * Pydantic์˜ `BaseSettings` ํด๋ž˜์Šค๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์„ค์ •์˜ ์œ ํšจ์„ฑ ๊ฒ€์‚ฌ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋Š” ๋ฐฉ์‹์€ ์•ˆ์ „ํ•˜๊ณ  ๊ฐ•๋ ฅํ•ฉ๋‹ˆ๋‹ค. * ์„ค์ •์„ ์ €์žฅํ•˜๋Š”...
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
## scripts/review_prompt.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์— ๋Œ€ํ•œ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ œ๊ณตํ•˜๋Š” ํ•จ์ˆ˜๋“ค์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ํ”„๋กฌํ”„ํŠธ๋Š” ์ „์ฒด ์ฝ”๋“œ ๋ฆฌ๋ทฐ, ํŒŒ์ผ ๋ฆฌ๋ทฐ, ๋ผ์ธ๋ณ„ ์ฝ”๋ฉ˜ํŠธ, ์ „์ฒด ๋ฆฌ๋ทฐ ์š”์•ฝ์„ ์œ„ํ•œ ํ…œํ”Œ๋ฆฟ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ํ•จ์ˆ˜๋ช…์ด ๋ช…ํ™•ํ•˜๊ณ  ์ง๊ด€์ ์ž…๋‹ˆ๋‹ค. * ํ”„๋กฌํ”„ํŠธ ํ…œํ”Œ๋ฆฟ์ด ์ •๋ฆฌ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. * ํ•จ์ˆ˜๊ฐ€ ๋…๋ฆฝ์ ์ด๋ฉฐ ์žฌ์‚ฌ์šฉ์ด ๊ฐ€๋Šฅํ•ฉ๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  * ํ•จ์ˆ˜์— ๋Œ€ํ•œ ๋ฌธ์„œํ™”๊ฐ€ ๋ถ€์กฑํ•ฉ๋‹ˆ๋‹ค. ํ•จ์ˆ˜์˜ ์„ค๋ช…๊ณผ ํŒŒ๋ผ๋ฏธํ„ฐ์— ๋Œ€ํ•œ ์ •๋ณด๊ฐ€ ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. * ํ”„๋กฌํ”„ํŠธ ํ…œํ”Œ๋ฆฟ์— ๋Œ€ํ•œ ์„ค๋ช…์ด ํ•„์š”ํ•ฉ๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด, `{code}`,...
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
REVIEW_PROMPT ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ๊ธธ์Šต๋‹ˆ๋‹ค. REVIEW_TEMPLATE๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
FILE_REVIEW_PROMPT ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ๊ธธ์Šต๋‹ˆ๋‹ค. FILE_TEMPLATE๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
LINE_COMMENTS_PROMPT ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ๊ธธ์Šต๋‹ˆ๋‹ค. LINE_TEMPLATE๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
get_review_prompt ํ•จ์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ์ผ๋ฐ˜์ ์ž…๋‹ˆ๋‹ค. get_review_template์œผ๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
get_file_review_prompt ํ•จ์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ์ผ๋ฐ˜์ ์ž…๋‹ˆ๋‹ค. get_file_template์œผ๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
get_line_comments_prompt ํ•จ์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ์ผ๋ฐ˜์ ์ž…๋‹ˆ๋‹ค. get_line_template์œผ๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
get_total_comments_prompt ํ•จ์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ์ผ๋ฐ˜์ ์ž…๋‹ˆ๋‹ค. get_total_template์œผ๋กœ ๋ฐ”๊ฟ€ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,549 @@ +import json +import os +from typing import List, Tuple +import requests +import re +import groq +import logging +from review_config import ( + IGNORED_EXTENSIONS, + IGNORED_FILES, + IMPORTANT_FILE_CHANGE_THRESHOLD, + MAX_COMMENTS_PER_FILE +) + +from scripts.review_prompt import ( + ...
Python
## .github/scripts/ai_code_review.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ GitHub Actions์˜ ์ผ๋ถ€๋กœ ๋™์ž‘ํ•˜๋Š” ํŒŒ์ด์ฌ ์Šคํฌ๋ฆฝํŠธ์ž…๋‹ˆ๋‹ค. ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” PR(ํŽ„ ๋ฆฌํ€˜์ŠคํŠธ)์—์„œ ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ์„ ๊ฐ€์ ธ์™€์„œ, ๊ฐ ํŒŒ์ผ์˜ ์ค‘์š”๋„๋ฅผ ํ‰๊ฐ€ํ•œ ํ›„ ์ค‘์š” ํŒŒ์ผ์— ๋Œ€ํ•œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ˆ˜ํ–‰ํ•ฉ๋‹ˆ๋‹ค. ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋Š” Groq API๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ ์ž๋™์œผ๋กœ ์ˆ˜ํ–‰๋˜๋ฉฐ, ๋ฆฌ๋ทฐ ๊ฒฐ๊ณผ๋Š” PR์— ์ฝ”๋ฉ˜ํŠธ๋กœ ๊ฒŒ์‹œ๋ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ์ด ์Šคํฌ๋ฆฝํŠธ๋Š” PR์—์„œ ๋ณ€๊ฒฝ๋œ ํŒŒ์ผ์„ ์ž๋™์œผ๋กœ ๊ฐ€์ ธ์™€์„œ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. ์ด๊ฒƒ์€ ๊ฐœ๋ฐœ์ž๋“ค์ด ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์ˆ˜ํ–‰ํ•˜๋Š” ๋ฐ ...
@@ -0,0 +1,27 @@ +# ๋ฆฌ๋ทฐ์—์„œ ์ œ์™ธํ•  ํŒŒ์ผ ๋ชฉ๋ก +IGNORED_FILES = [ + '.gitignore', + 'requirements.txt', + 'docker-compose.yml', + 'Dockerfile', + 'setup.cfg', + 'pyproject.toml', + '.env.example', + 'README.md', + 'LICENSE', +] + +# ๋ฆฌ๋ทฐ์—์„œ ์ œ์™ธํ•  ํŒŒ์ผ ํ™•์žฅ์ž +IGNORED_EXTENSIONS = [ + '.md', + '.txt', + ...
Python
## .github/scripts/review_config.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ Git ๋ฆฌ๋ทฐ์™€ ๊ด€๋ จ๋œ ์„ค์ •์„ ์ •์˜ํ•ฉ๋‹ˆ๋‹ค. ๋ฆฌ๋ทฐ์—์„œ ์ œ์™ธํ•  ํŒŒ์ผ ๋ชฉ๋ก, ํŒŒ์ผ ํ™•์žฅ์ž, ์ค‘์š” ํŒŒ์ผ ํŒ๋‹จ ๊ธฐ์ค€, ํŒŒ์ผ๋‹น ์ตœ๋Œ€ ์ฝ”๋ฉ˜ํŠธ ์ˆ˜ ๋“ฑ์„ ์„ค์ •ํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ํŒŒ์ผ์ด ๊ฐ„๋‹จํ•˜๊ณ  ์ดํ•ดํ•˜๊ธฐ ์‰ฝ์Šต๋‹ˆ๋‹ค. * ๋ณ€์ˆ˜๋ช…์ด ๋ช…ํ™•ํ•˜๊ณ  ์ผ๊ด€์ ์ž…๋‹ˆ๋‹ค. * ์ฃผ์š” ์„ค์ • ํ•ญ๋ชฉ์ด ์ž˜ ์ •๋ฆฌ๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  * ํŒŒ์ผ์— ๋Œ€ํ•œ ์„ค๋ช…์ด ์—†์Šต๋‹ˆ๋‹ค. ํŒŒ์ผ์˜ ๋ชฉ์ ๊ณผ ์‚ฌ์šฉ ๋ฐฉ๋ฒ•์— ๋Œ€ํ•œ ์ฃผ์„์„ ์ถ”๊ฐ€ํ•  ํ•„์š”๊ฐ€ ์žˆ์Šต๋‹ˆ๋‹ค. * ๋ณ€์ˆ˜์˜ ์˜๋ฏธ์™€ ์‚ฌ์šฉ ์˜ˆ์‹œ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๊ฐ ๋ณ€์ˆ˜์— ๋Œ€ํ•œ ์ฃผ์„์„...
@@ -2,7 +2,7 @@ from dotenv import load_dotenv # load .env file -load_dotenv() +load_dotenv('app/backend/.env') from pydantic import ( PostgresDsn, @@ -73,6 +73,9 @@ class Settings(BaseSettings): # ALGORITHM : str # ACCESS_TOKEN_EXPIRE_MINUTES : int + # Groq API + GROQ_API_KEY: str + ...
Python
## app/backend/src/main/core/config.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ ๋ฐฑ์—”๋“œ ์• ํ”Œ๋ฆฌ์ผ€์ด์…˜์˜ ์„ค์ •์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋ฉ๋‹ˆ๋‹ค. ์„ค์ •์€ ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ๋กœ๋“œ๋˜๋ฉฐ, ์„ค์ • ํ•ญ๋ชฉ์€ `Settings` ํด๋ž˜์Šค์— ์ •์˜๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ์ด ํŒŒ์ผ์€ ์„ค์ •์„ ๊ด€๋ฆฌํ•˜๋Š” ๋ฐ ์‚ฌ์šฉ๋˜๋Š” `Settings` ํด๋ž˜์Šค๋ฅผ ์ œ๊ณตํ•˜๋ฉฐ, ํ™˜๊ฒฝ ๋ณ€์ˆ˜์—์„œ ์„ค์ • ๊ฐ’์„ ๋กœ๋“œํ•˜๋Š” ๊ธฐ๋Šฅ์„ ์ œ๊ณตํ•ฉ๋‹ˆ๋‹ค. * ์„ค์ • ํ•ญ๋ชฉ์€ ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜๋˜์–ด ์žˆ์œผ๋ฉฐ, ์„ค์ • ํ•ญ๋ชฉ์˜ ํƒ€์ž…์ด ๋ช…ํ™•ํ•˜๊ฒŒ ์ง€์ •๋˜์–ด ์žˆ์Šต๋‹ˆ๋‹ค. * `parse_cors` ํ•จ์ˆ˜๋ฅผ ์‚ฌ์šฉํ•˜์—ฌ CORS ์„ค์ • ๊ฐ’์„ ํŒŒ์‹ฑํ•˜๋Š”...
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
## scripts/review_prompt.py ํŒŒ์ผ ๋ฆฌ๋ทฐ ### ์ฃผ์š” ๊ธฐ๋Šฅ ์ด ํŒŒ์ผ์€ ์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์œ„ํ•œ ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ œ๊ณตํ•˜๋Š” ํ•จ์ˆ˜๋“ค์„ ์ •์˜ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ์ด ํŒŒ์ผ์€ ์ฝ”๋“œ ๋ฆฌ๋ทฐ์— ์‚ฌ์šฉ๋  ํ”„๋กฌํ”„ํŠธ๋ฅผ ์ƒ์„ฑํ•˜์—ฌ ๋ฐ˜ํ™˜ํ•˜๋Š” ์—ญํ• ์„ ํ•ฉ๋‹ˆ๋‹ค. ### ์ข‹์€ ์  * ์ฝ”๋“œ๊ฐ€ ๊ฐ„๊ฒฐํ•˜๊ณ  ์ดํ•ดํ•˜๊ธฐ ์‰ฝ์Šต๋‹ˆ๋‹ค. * ํ•จ์ˆ˜๋ช…์ด ๋ช…ํ™•ํ•˜๊ณ , ํ•จ์ˆ˜์˜ ์—ญํ• ์ด ๋ถ„๋ช…ํ•ฉ๋‹ˆ๋‹ค. * ํ”„๋กฌํ”„ํŠธ์˜ ํ˜•์‹์„ ์ •์˜ํ•˜์—ฌ ์ผ๊ด€์„ฑ์„ ์œ ์ง€ํ•˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. ### ๊ฐœ์„ ํ•  ์  * ํ•จ์ˆ˜์˜ ๊ฐ ๋งค๊ฐœ๋ณ€์ˆ˜์— ๋Œ€ํ•œ ์„ค๋ช…์ด ์—†์Šต๋‹ˆ๋‹ค. * ํ”„๋กฌํ”„ํŠธ์˜ ํ˜•์‹์ด ๋ณ€๊ฒฝ๋  ๊ฒฝ์šฐ, ๋ชจ๋“  ํ•จ์ˆ˜์—์„œ ๋ณ€๊ฒฝํ•ด์•ผ ํ•ฉ๋‹ˆ๋‹ค. * ์—๋Ÿฌ ํ•ธ๋“ค๋ง์ด ์—†์Šต๋‹ˆ๋‹ค. ์˜ˆ๋ฅผ ๋“ค์–ด...
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
REVIEW_PROMPT ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ๊ธธ๊ณ  ๋ชจํ˜ธํ•ฉ๋‹ˆ๋‹ค. ๋” ์งง๊ณ  ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
get_review_prompt ํ•จ์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ๊ธธ๊ณ  ๋ชจํ˜ธํ•ฉ๋‹ˆ๋‹ค. ๋” ์งง๊ณ  ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,101 @@ +REVIEW_PROMPT = """ +You have deep knowledge and expertise in Python, FastAPI for the back end, React and Next.js for the front. +Here is the new PR information. +- title: {title} +- description: {description} +- commit messages: {commit_messages} +- changed files: {changed_files} + +Please understan...
Python
FILE_REVIEW_PROMPT ๋ณ€์ˆ˜์˜ ์ด๋ฆ„์ด ๋„ˆ๋ฌด ๊ธธ๊ณ  ๋ชจํ˜ธํ•ฉ๋‹ˆ๋‹ค. ๋” ์งง๊ณ  ๋ช…ํ™•ํ•˜๊ฒŒ ์ •์˜ํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
@@ -3,83 +3,63 @@ import homeTry.chatting.dto.request.ChattingMessageRequest; import homeTry.chatting.dto.response.ChattingMessageResponse; import homeTry.chatting.exception.badRequestException.InvalidTeamIdException; -import homeTry.chatting.model.entity.Chatting; import homeTry.chatting.repository.ChattingReposit...
Java
Chatting์€ TeamMember์™€ ์—ฐ๊ด€๊ด€๊ณ„๋ฅผ ๋งบ๊ณ  ์žˆ์œผ๋‹ˆ, TeamMember์— ๋Œ€ํ•œ ์ •๋ณด๋งŒ์„ ์•Œ๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค. Chatting์—์„œ Team ๋˜๋Š” Member์— ๋Œ€ํ•œ ์ •๋ณด๋ฅผ ์–ป๊ณ ์ž ํ•œ๋‹ค๋ฉด,, TeamMemberService๋ฅผ ๋‹จ์ผ ์ง„์ž…์ ์œผ๋กœ ํ™œ์šฉํ•˜๋ฉด ์–ด๋–จ๊นŒ์š”? ๐Ÿ˜ฒ
@@ -1,8 +1,12 @@ package homeTry.chatting.interceptor; +import homeTry.chatting.exception.badRequestException.InactivatedMemberWithValidTokenException; import homeTry.chatting.exception.badRequestException.InvalidChattingTokenException; -import homeTry.common.auth.JwtAuth; +import homeTry.chatting.exception.badRequ...
Java
StompInterceptor๋Š” ํ† ํฐ ์ •๋ณด๋ฅผ ๋ณด๊ณ , ๋ฉค๋ฒ„๊ฐ€ ์กด์žฌํ•˜์ง€ ์•Š์œผ๋ฉด,, Exception์„ ๋ฑ‰๋„๋ก ํ•˜๋Š” ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค. ๊ทธ๋ ‡๋‹ค๋ฉด, stompInterceptor๋Š” ํ† ํฐ์ด bearerToken์ธ์ง€, ๋‹ค๋ฅธ ํ† ํฐ์˜ ์ข…๋ฅ˜์ธ์ง€? ์— ๋Œ€ํ•ด์„œ๋Š” ์•„๋ฌด๋Ÿฐ ๊ด€์‹ฌ์‚ฌ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. BearerToken์ด ์œ ํšจํ•œ์ง€? ๋„ ๊ด€์‹ฌ์‚ฌ๊ฐ€ ์—†์Šต๋‹ˆ๋‹ค. ๋‹จ์ˆœํžˆ ํ˜„์žฌ interceptor์— ๋„˜์–ด์˜จ ํ† ํฐ ์ •๋ณด๋ฅผ ๋ณด๊ณ , ์šฐ๋ฆฌ ์‚ฌ์šฉ์ž๋ผ๋ฉด ์„ธ์…˜์— ๊ทธ ๊ฐ’์„ ๋„ฃ๋Š” ๊ฒƒ์— ๊ด€์‹ฌ์ด ์žˆ์Šต๋‹ˆ๋‹ค. ์ด๋ ‡๊ฒŒ ๊ฐ ํด๋ž˜์Šค์˜ ๊ด€์‹ฌ์‚ฌ๋“ค์„ ์ƒ๊ฐํ•˜๋ฉฐ ์ ์ ˆํ•˜๊ฒŒ ๋ถ„๋ฆฌํ•˜๊ณ , ์บก์Аํ™” ํ•ด๋ณด์‹œ๋ฉด ์žฌ๋ฏธ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ˜„
@@ -8,51 +8,65 @@ public class Game { public static final String DELIMETER = "-"; + + public static final String CAR_NAME_DELIMETER = ","; + private int gameCount; + private Car[] cars; public void start() { - cars = createCar(); + + cars = createCar(); + gameCount ...
Java
![image](https://github.com/next-step/java-racingcar/assets/27044096/d221b9bf-2cb7-4dcb-bafa-016f49e445a2) d, e ๊ฐ€ ์šฐ์Šนํ–ˆ๋Š”๋ฐ ์ œ๋Œ€๋กœ ์ถœ๋ ฅ๋˜๊ณ ์žˆ์ง€ ์•Š๋„ค์š” ๐Ÿ˜…
@@ -0,0 +1,25 @@ +import java.util.List; + +/** + * @author jeongheekim + * @date 3/27/24 + */ +public class FormattingUtil { + private FormattingUtil() {} + + public static String formattingResult(List<String> list) { + StringBuilder sb = new StringBuilder(); + int size = list.size(); + for ...
Java
> ๊ทœ์น™ 1: ํ•œ ๋ฉ”์„œ๋“œ์— ์˜ค์ง ํ•œ ๋‹จ๊ณ„์˜ ๋“ค์—ฌ์“ฐ๊ธฐ(indent)๋งŒ ํ•œ๋‹ค. indent๊ฐ€ 2์ด์ƒ์ธ ๋ฉ”์†Œ๋“œ์˜ ๊ฒฝ์šฐ ๋ฉ”์†Œ๋“œ๋ฅผ ๋ถ„๋ฆฌํ•˜๋ฉด indent๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ๋‹ค. else๋ฅผ ์‚ฌ์šฉํ•˜์ง€ ์•Š์•„ indent๋ฅผ ์ค„์ผ ์ˆ˜ ์žˆ๋‹ค. ์ธ๋ดํŠธ๊ฐ€ 2์ด์ƒ์ด๊ตฐ์š” ๐Ÿค”
@@ -0,0 +1,47 @@ +import java.util.ArrayList; +import java.util.List; + +/** + * @author jeongheekim + * @date 3/26/24 + */ +public class Winner { + private List<String> winners = new ArrayList<>(); + private int maxLength; + + public void addWinner(String name) { + this.winners.add(name); + } + + ...
Java
๋กœ์ง์— ๋ฌธ์ œ๊ฐ€ ์žˆ๋Š”๊ฒƒ ๊ฐ™์•„์š” ๐Ÿ˜… ์šฐ์Šน์ž๊ฐ€ ๋‘๋ฒˆ ์ถœ๋ ฅ๋˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค ![image](https://github.com/next-step/java-racingcar/assets/27044096/b9f03caf-3eb4-4243-b500-48b046458145)
@@ -0,0 +1,47 @@ +import java.util.ArrayList; +import java.util.List; + +/** + * @author jeongheekim + * @date 3/26/24 + */ +public class Winner { + private List<String> winners = new ArrayList<>(); + private int maxLength; + + public void addWinner(String name) { + this.winners.add(name); + } + + ...
Java
์ž๋™์ฐจ์˜ ๊ธธ์ด๋ฅผ ๊บผ๋‚ด์–ด ์ฒ˜๋ฆฌํ•˜๊ณ  ์žˆ๋„ค์š”! ๋””๋ฏธํ„ฐ ๋ฒ•์น™์— ์–ด๊ธ‹๋‚˜๊ณ  ์žˆ์Šต๋‹ˆ๋‹ค ๋ฉ”์„ธ์ง€๋ฅผ ๋ณด๋‚ด์–ด ์ฒ˜๋ฆฌํ•ด๋ณด๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”? ๐Ÿค” https://mangkyu.tistory.com/147
@@ -1,7 +1,20 @@ package lotto; +import lotto.config.Configuration; +import lotto.controller.BuyLottoController; +import lotto.controller.LottoController; +import lotto.dto.BuyLottoDto; + public class Application { public static void main(String[] args) { - // TODO: ํ”„๋กœ๊ทธ๋žจ ๊ตฌํ˜„ + Configuration config...
Java
ํ˜„์žฌ ์ž‘์„ฑํ•˜์‹  controller์™€ service๋ฅผ ๋ชจ๋‘ applicationํด๋ž˜์Šค์—์„œ ์ƒ์„ฑํ•˜๋„๋ก ๊ตฌํ˜„ํ•˜์‹ ๊ฒƒ๊ฐ™์€๋ฐ ์šฐ์•„ํ•œํ…Œํฌ์ฝ”์Šค 3์ฃผ์ฐจ ๊ณตํ†ต ํ”ผ๋“œ๋ฐฑ์„ ๋ณด์‹œ๋ฉด, > ํ•จ์ˆ˜(๋ฉ”์„œ๋“œ) ๋ผ์ธ์— ๋Œ€ํ•œ ๊ธฐ์ค€ ํ”„๋กœ๊ทธ๋ž˜๋ฐ ์š”๊ตฌ์‚ฌํ•ญ์„ ๋ณด๋ฉด ํ•จ์ˆ˜ 15๋ผ์ธ์œผ๋กœ ์ œํ•œํ•˜๋Š” ์š”๊ตฌ์‚ฌํ•ญ์ด ์žˆ๋‹ค. ์ด ๊ธฐ์ค€์€ main() ํ•จ์ˆ˜์—๋„ ํ•ด๋‹น๋œ๋‹ค. ๊ณต๋ฐฑ ๋ผ์ธ๋„ ํ•œ ๋ผ์ธ์— ํ•ด๋‹นํ•œ๋‹ค. 15๋ผ์ธ์ด ๋„˜์–ด๊ฐ„๋‹ค๋ฉด ํ•จ์ˆ˜ ๋ถ„๋ฆฌ๋ฅผ ์œ„ํ•œ ๊ณ ๋ฏผ์„ ํ•œ๋‹ค. ๋ผ๊ณ  ์ œ์‹œ๋˜์–ด์žˆ์–ด์š”. ๋งŒ์•ฝ ์ดํ›„ controller์™€ service, repository๊นŒ์ง€ ๋งŽ์•„์ง€๊ฒŒ ๋˜๋Š” ํ”„๋กœ๊ทธ๋žจ์ด๋ผ๋ฉด ์œ„ ์š”๊ตฌ์‚ฌํ•ญ์„ ์–ด๊ธฐ๊ฒŒ ๋ ๊ฒƒ๊ฐ™์€๋ฐ ์–ด...
@@ -0,0 +1,34 @@ +package lotto.model; + +import static lotto.constant.Constant.THOUSAND; +import static lotto.constant.Constant.ZERO; +import static lotto.exception.ErrorInputException.ErrorMessage.PURCHASE_PRICE_CAN_DIVIDE_BY_THOUSAND; + +import lotto.exception.ErrorInputException; + +public class PurchasePrice { + ...
Java
calculateLottoCount๋ฅผ ํ˜ธ์ถœํ• ๋•Œ๋งˆ๋‹ค ๊ตฌ์ž…๊ฐ€๊ฒฉ์—์„œ 1000์„ ๋‚˜๋ˆŒํ…๋ฐ ์ด๋ ‡๊ฒŒ ํ•˜์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!!
@@ -0,0 +1,57 @@ +package lotto.model; + +import static lotto.constant.Constant.ZERO; + +import java.util.Collections; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import lotto.constant.Rank; + +public class Statistics { + private final Map<Rank, Integer> result; + + private Statisti...
Java
int๋กœ ์„ ์–ธํ•˜์…”๋„ ๋์„ํ…๋ฐ long์œผ๋กœ ์„ ์–ธํ•˜์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,40 @@ +package lotto.dto; + +import lotto.model.BonusNumber; +import lotto.model.LottoNumbers; +import lotto.model.PurchasePrice; +import lotto.model.Statistics; +import lotto.model.WinnerNumber; + +public class BuyLottoDto { + private PurchasePrice purchasePrice; + private LottoNumbers lottoNumbers; +...
Java
ํ˜„์žฌ calculateMatching๋ฉ”์†Œ๋“œ๋Š” statics๋„๋ฉ”์ธ์— ์ ‘๊ทผํ•˜๊ธฐ ์œ„ํ•œ ๋ฉ”์†Œ๋“œ๋กœ ๋ณด์—ฌ์ง‘๋‹ˆ๋‹ค! service๊ณ„์ธต์ด ์žˆ๋Š” ์ด์œ ๋Š”, ํ”„๋ ˆ์  ํ…Œ์ด์…˜ ๊ณ„์ธต๊ณผ ๋ฐ์ดํ„ฐ ์—‘์„ธ์Šค ๊ณ„์ธต ์‚ฌ์ด๋ฅผ ์—ฐ๊ฒฐํ•˜๊ธฐ ์œ„ํ•จ์ด์ฃ !! ๋”ฐ๋ผ์„œ ์ด ๋ถ€๋ถ„์€ service์ชฝ์—์„œ ๊ตฌํ˜„๋˜์–ด์•ผํ•œ๋‹ค๊ณ  ์ƒ๊ฐํ•ด์š”!
@@ -0,0 +1,57 @@ +package lotto.model; + +import static lotto.constant.Constant.ZERO; + +import java.util.Collections; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import lotto.constant.Rank; + +public class Statistics { + private final Map<Rank, Integer> result; + + private Statisti...
Java
์žฌํ˜„๋‹˜ ๋•๋ถ„์— EnumMap์— ๋Œ€ํ•ด์„œ ์ฒ˜์Œ์œผ๋กœ ๋ฐฐ์› ๋„ค์š”!! ใ…Žใ…ŽEnumMap์ด ํ•ด์‹œ์ถฉ๋Œ์„ ์•ˆ์ผ์œผํ‚จ๋‹ค๋Š”๋ฐ ๋•๋ถ„์— ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค!!
@@ -1,7 +1,20 @@ package lotto; +import lotto.config.Configuration; +import lotto.controller.BuyLottoController; +import lotto.controller.LottoController; +import lotto.dto.BuyLottoDto; + public class Application { public static void main(String[] args) { - // TODO: ํ”„๋กœ๊ทธ๋žจ ๊ตฌํ˜„ + Configuration config...
Java
์Œ.. ๋งž์•„์š” ์ €๋„ ์ด ๋ถ€๋ถ„์ด ๋งŽ์ด ๊ฑธ๋ ธ์–ด์š”. ํ•˜์ง€๋งŒ ๋ชจ๋“ˆํ™” ํ•˜๋ฉด ํ•  ์ˆ˜๋ก Application์—์„œ ์ƒ์„ฑํ•ด์ค˜์•ผ ํ•˜๋Š”๊ฒŒ ๋งŽ์•„์ ธ์„œ ๊ณ ๋ฏผ์ด ๋์–ด์š”... ๋‹ค์Œ์—๋Š” controller๋งŒ ์˜์กดํ•˜๊ฒŒ๋” ์ˆ˜์ •ํ•ด๋ด์•ผ๊ฒ ์–ด์š”!!
@@ -0,0 +1,34 @@ +package lotto.model; + +import static lotto.constant.Constant.THOUSAND; +import static lotto.constant.Constant.ZERO; +import static lotto.exception.ErrorInputException.ErrorMessage.PURCHASE_PRICE_CAN_DIVIDE_BY_THOUSAND; + +import lotto.exception.ErrorInputException; + +public class PurchasePrice { + ...
Java
๋กœ๋˜์˜ ๊ฐœ์ˆ˜๋ฅผ ๊ตฌํ•˜๋Š” ํ•จ์ˆ˜(calculateLottoCount)๋กœ ๋งŒ๋“ค์—ˆ์Šต๋‹ˆ๋‹ค! ๋“ฃ๊ณ ๋ณด๋‹ˆ ๋งŒ์•ฝ ๋กœ๋˜ ๊ฐ€๊ฒฉ์ด ๋ฐ”๋€Œ๊ฒŒ ๋œ๋‹ค๋ฉด ๋‚˜๋ˆ„๋Š” ๊ฐ€๊ฒฉ์„ ์ˆ˜์ •ํ•ด์•ผ ํ•˜๋‹ˆ `THOSAND` ๋Œ€์‹  `LOTTOPRICE`๋กœ ๋ฐ”๋€Œ๋Š”๊ฒŒ ์ข‹๊ฒ ๊ตฐ์š”!
@@ -0,0 +1,57 @@ +package lotto.model; + +import static lotto.constant.Constant.ZERO; + +import java.util.Collections; +import java.util.EnumMap; +import java.util.List; +import java.util.Map; +import lotto.constant.Rank; + +public class Statistics { + private final Map<Rank, Integer> result; + + private Statisti...
Java
`countMatchingWinnerNumber()` ํ•จ์ˆ˜์—์„œ stream์„ ์“ฐ๋‹ค๋ณด๋‹ˆ return ๊ฐ’์ด long์ด ๋˜์—ˆ์–ด์š”! long์ด๋“  int๋“  ํฌ๊ฒŒ ์˜ํ–ฅ์„ ์ฃผ์ง€ ์•Š์„ ๊ฒƒ์ด๋ผ๊ณ  ์ƒ๊ฐํ•˜์—ฌ long์œผ๋กœ ์„ ์–ธํ–ˆ์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,40 @@ +package lotto.dto; + +import lotto.model.BonusNumber; +import lotto.model.LottoNumbers; +import lotto.model.PurchasePrice; +import lotto.model.Statistics; +import lotto.model.WinnerNumber; + +public class BuyLottoDto { + private PurchasePrice purchasePrice; + private LottoNumbers lottoNumbers; +...
Java
๋งž์•„์š”! ์ด ๋กœ์ง์€ service์— ๋ฐฐ์น˜ํ•˜๋Š”๊ฒŒ ๋” ์ ์ ˆํ•  ๊ฒƒ ๊ฐ™๊ตฐ์š”! ๐Ÿ‘
@@ -0,0 +1,109 @@ +package christmas.controller; + +import christmas.domain.Date; +import christmas.domain.EventBadge; +import christmas.domain.Orders; +import christmas.domain.discount.DDayStrategy; +import christmas.domain.discount.Discount; +import christmas.domain.discount.GiftStrategy; +import christmas.domain.dis...
Java
์ปจํŠธ๋กค๋Ÿฌ๋‹จ์—์„œ ํ•˜๋Š”๊ฒƒ๋„ ๊ดœ์ฐฎ์ง€๋งŒ ํ•ด๋‹น ๋„๋ฉ”์ธ ๋กœ์ง์œผ๋กœ ๊ฐ€์ ธ๊ฐ€๋Š” ๊ฒƒ๋„ ์ข‹์•„๋ณด์—ฌ์š”!
@@ -0,0 +1,48 @@ +package christmas.domain; + +public enum Event { + NONE("์—†์Œ", 0), + CHRISTMAS_D_DAY_DISCOUNT("ํฌ๋ฆฌ์Šค๋งˆ์Šค ๋””๋ฐ์ด ํ• ์ธ", 1_000), + WEEKDAY_DISCOUNT("ํ‰์ผ ํ• ์ธ", 2_023), + WEEKEND_DISCOUNT("์ฃผ๋ง ํ• ์ธ", 2_023), + SPECIAL_DISCOUNT("ํŠน๋ณ„ ํ• ์ธ", 1_000), + GIFT("์ฆ์ • ์ด๋ฒคํŠธ", 25_000); + + private static final int B...
Java
์ฝ”๋“œ๊ฐ€ ์ฝ๊ธฐ ํŽธํ•ด์š”!
@@ -0,0 +1,57 @@ +package christmas.domain; + +import christmas.exception.ExceptionMessage; +import christmas.exception.InputException; +import java.util.Arrays; + +public enum Menu { + MUSHROOM_CREAM_SOUP("์–‘์†ก์ด์ˆ˜ํ”„", 6_000, FoodType.APPETIZER), + TAPAS("ํƒ€ํŒŒ์Šค", 5_500, FoodType.APPETIZER), + CAESAR_SALAD("์‹œ์ €์ƒ๋Ÿฌ๋“œ", 8...
Java
Menu Enum์— FoodType Enum ์„ ๊ฐ€์ ธ์™€์„œ ์“ฐ์‹œ๋Š” ์˜๋„๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,19 @@ +package christmas.domain.discount; + +import christmas.domain.Date; +import christmas.domain.Event; +import christmas.domain.Orders; +import java.util.List; + +public class GiftStrategy implements DiscountStrategy { + private static final int GIFT_BASE_AMOUNT = 120_000; + + @Override + public...
Java
์ธํ„ฐํŽ˜์ด์Šค ํ™œ์šฉ ์ข‹๋„ค์š”!
@@ -0,0 +1,4 @@ +package christmas.dto; + +public record OrderParam(String name, int count) { +}
Java
ํ•ด๋‹น record ๊ฐ์ฒด์˜ ์˜๋„๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค!
@@ -0,0 +1,9 @@ +package christmas.exception; + +public class InputException extends IllegalArgumentException { + public static final String PREFIX = "[ERROR] "; + + public InputException(String message) { + super(PREFIX + message); + } +}
Java
์ €๋Š” ํ”„๋กœ๊ทธ๋žจ์—์„œ ๋ฐœ์ƒํ•˜๋Š” ์˜ˆ์™ธ ์ฒ˜๋ฆฌ ๋ฉ”์†Œ๋“œ๋ฅผ ํ•œ ํŒจํ‚ค์ง€์— ๋ชจ์•„์„œ ๊ด€๋ฆฌํ•˜๊ณ  ์žˆ๋Š”๋ฐ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹ค๊นŒ์š”?
@@ -0,0 +1,72 @@ +package christmas.view; + +public class OutputView { + private static final String GREETING = "์•ˆ๋…•ํ•˜์„ธ์š”! ์šฐํ…Œ์ฝ” ์‹๋‹น 12์›” ์ด๋ฒคํŠธ ํ”Œ๋ž˜๋„ˆ์ž…๋‹ˆ๋‹ค."; + private static final String PREVIEW_TITLE = "12์›” %d์ผ์— ์šฐํ…Œ์ฝ” ์‹๋‹น์—์„œ ๋ฐ›์„ ์ด๋ฒคํŠธ ํ˜œํƒ ๋ฏธ๋ฆฌ ๋ณด๊ธฐ!"; + private static final String ORDERED_MENU = "<์ฃผ๋ฌธ ๋ฉ”๋‰ด>"; + private static final ...
Java
ํ•ด๋‹น ๋กœ์ง์„ ๊ตณ์ด Enum์œผ๋กœ ๊ด€๋ฆฌํ•˜์ง€ ์•Š์•˜๋Š”๋ฐ๋„ ๊ฐ€๋…์„ฑ์ด ์ •๋ง ์ข‹๋„ค์š”! ์ธ์‚ฌ์ดํŠธ ์–ป์–ด๊ฐ‘๋‹ˆ๋‹ค!
@@ -0,0 +1,171 @@ +package christmas.domain; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.assertj.core.api.Assertions.assertThatNoException; +import static org.assertj.core.api.Assertions.assertThatThrownBy; + +import christmas.exception.ExceptionMessage; +import java.util.ArrayList; ...
Java
ํ•ด๋‹น ๋กœ์ง์„ @BeforEach ์–ด๋…ธํ…Œ์ด์…˜์„ ํ™œ์šฉํ•˜๋Š”๊ฑด ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹ค๊นŒ์š”?
@@ -0,0 +1,109 @@ +package christmas.controller; + +import christmas.domain.Date; +import christmas.domain.EventBadge; +import christmas.domain.Orders; +import christmas.domain.discount.DDayStrategy; +import christmas.domain.discount.Discount; +import christmas.domain.discount.GiftStrategy; +import christmas.domain.dis...
Java
๊ณต๊ฐํ•ฉ๋‹ˆ๋‹ค!!
@@ -0,0 +1,58 @@ +package christmas.domain; + +import christmas.exception.ExceptionMessage; +import christmas.exception.InputException; +import java.time.LocalDate; +import java.time.format.TextStyle; +import java.util.List; +import java.util.Locale; + +public class Date { + private static final int MIN_DATE = 1; + ...
Java
"SUNDAY" ๋ฅผ "์ผ" ๋กœ ํ•˜์ง€ ์•Š์œผ์‹  ์ด์œ ๊ฐ€ ์žˆ๋‚˜์š”??
@@ -0,0 +1,61 @@ +package christmas.domain; + +import static christmas.Constants.BASE_COUNT; +import static christmas.Constants.BLANK; +import static christmas.Constants.COUNT; +import static christmas.Constants.LINE_FEED; +import static christmas.Constants.NONE; + +import christmas.exception.ExceptionMessage; +import ...
Java
์ด๊ฑด OutputView ์—์„œ ํ•ด๋„ ์ข‹์„๊ฒƒ ๊ฐ™์€๋ฐ ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”??
@@ -0,0 +1,36 @@ +package christmas.domain; + +import java.util.Arrays; +import java.util.Comparator; + +public enum EventBadge { + NONE("์—†์Œ", 0), + STAR("๋ณ„", 5_000), + TREE("ํŠธ๋ฆฌ", 10_000), + SANTA("์‚ฐํƒ€", 20_000); + + private final String name; + private final int price; + + EventBadge(String name, i...
Java
์ •๋ง ๊น”๋”ํ•˜๋„ค์š”!!
@@ -0,0 +1,17 @@ +package christmas.domain.discount; + +import christmas.domain.Date; +import christmas.domain.Event; +import christmas.domain.Orders; +import java.util.List; + +public class DDayStrategy implements DiscountStrategy { + @Override + public List<Event> getShouldApplyEvents(Orders orders, Date date) ...
Java
์ „๋žต ํŒจํ„ด ์‚ฌ์šฉํ•˜์…จ๋„ค์š”! ๐Ÿ‘๐Ÿ‘
@@ -21,6 +21,7 @@ package { if (_instance) { + // NOTE throw ์‹œ์ผœ๋†“๊ณ  catch ์•ˆํ•ด์ฃผ๋ฉด ์–ด๋–ป๊ฒŒ ๋ ๊นŒ์š”? throw new Error("Use getInstance()."); } _instance = this;
Unknown
์‚ฌ์‹ค ์—ฌ๊ธฐ์„œ throw๊ฐ€ ๋‚  ๊ฐ€๋Šฅ์„ฑ์€ ๊ฑฐ์˜ ์—†์–ด๋ณด์ž…๋‹ˆ๋‹ค๋งŒ... ๋ฐ”๊นฅ์— try catch ์ฒ˜๋ฆฌ๋ฅผ ํ•˜์ง€ ์•Š์€ ์ฑ„๋กœ throw๊ฐ€ ๋ฐœ์ƒํ•ด๋ฒ„๋ฆฌ๋ฉด ์–ด๋–ป๊ฒŒ ๋ ๊นŒ์š”?
@@ -1,10 +1,113 @@ package subway; import java.util.Scanner; +import subway.controller.InitController; +import subway.controller.InputController; +import subway.controller.SubwayController; +import subway.domain.Station; +import subway.repository.LineRepository; +import subway.repository.StationRepository; +import ...
Java
์›€ ์—ฌ๊ธฐ๋„ ๋กœ๋˜์™€ ๊ฐ™๊ตฐ์š”! ๋งŒ์•ฝ controller์™€ service์— ๋Œ€ํ•œ ๊ฐ์ฒด ์ƒ์„ฑํ•˜๋Š” ๊ด€์‹ฌ์‚ฌ๋ฅผ ํŠน์ • ํด๋ž˜์Šค์—์„œ ํ•˜๊ณ ์‹ถ๋‹ค๋ฉด Configurationํด๋ž˜์Šค๋ฅผ ๋งŒ๋“œ๋Š”๊ฑด ์–ด๋–จ๊นŒ์š”? ์Šคํ”„๋ง๋ถ€ํŠธ์—์„œ @Configuration์ด Bean์„ ๋“ฑ๋กํ•ด์ฃผ๋Š” ์–ด๋…ธํ…Œ์ด์…˜์ด๋‹ˆ๊นŒ์š”!
@@ -1,10 +1,113 @@ package subway; import java.util.Scanner; +import subway.controller.InitController; +import subway.controller.InputController; +import subway.controller.SubwayController; +import subway.domain.Station; +import subway.repository.LineRepository; +import subway.repository.StationRepository; +import ...
Java
Q๋‚˜ 1๊ฐ™์€ ๊ฐ’์€ Function enumํด๋ž˜์Šค๋กœ ์ ‘๊ทผํ•ด์„œ ์ž‘์„ฑํ•˜์…จ์„ ์ˆ˜ ์žˆ์„ ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,44 @@ +package subway.service; + +import static subway.domain.RouteInfo.calculateTotalDistance; +import static subway.domain.RouteInfo.calculateTotalTime; +import static subway.domain.RouteInfo.values; + +import java.util.List; +import org.jgrapht.GraphPath; +import org.jgrapht.alg.shortestpath.DijkstraShort...
Java
์˜คํ˜ธ!! ๊ฐ์ฒด ์ƒ์„ฑํ•˜๋Š” ์ฝ”๋“œ๋ฅผ ๋ถ„๋ฆฌ์‹œ์ผฐ๊ตฐ์š”!! ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค..!!
@@ -0,0 +1,59 @@ +package subway.view.Input; + +import subway.validation.EndStationValidation; +import subway.validation.MainFunctionValidation; +import subway.validation.SelectRouteValidation; +import subway.validation.StartStationValidation; + +public class InputView { + private final MainFunctionValidation mainFu...
Java
์ด๋ฏธ isBlank๋ฉ”์†Œ๋“œ๊ฐ€ static์œผ๋กœ ํ• ๋‹น๋˜์–ด์žˆ๊ธฐ๋•Œ๋ฌธ์— mainFunctionValidation.isBlank๊ฐ€ ์•„๋‹Œ, MainFunctionValidation.isBlank๋กœ ํ•˜๋Š”๊ฒŒ ๋” ์ ํ•ฉํ•  ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -1,10 +1,113 @@ package subway; import java.util.Scanner; +import subway.controller.InitController; +import subway.controller.InputController; +import subway.controller.SubwayController; +import subway.domain.Station; +import subway.repository.LineRepository; +import subway.repository.StationRepository; +import ...
Java
์ตœ์ข… ์ฝ”ํ…Œ์—์„œ ์‚ฌ์šฉํ•  ํ…œํ”Œ๋ฆฟ์„ ๋งŒ๋“ค๋‹ค๋ณด๋‹ˆ ๊ฐ™์€ ํ˜•์‹์œผ๋กœ ๋งŒ๋“ค์–ด์กŒ๊ตฐ์š” ใ…œใ…œ ๋‹ค์‹œ ๊ณ ๋ฏผํ•ด๋ด์•ผ๊ฒ ์Šต๋‹ˆ๋‹ค!!
@@ -0,0 +1,30 @@ +package store.contant; + +public enum Constant { + PRODUCTS_FILE_PATH("./src/main/resources/products.md"), + PROMOTIONS_FILE_PATH("./src/main/resources/promotions.md"), + + Y("Y"), + N("N"), + + YEAR("year"), + MONTH("month"), + DAY("day"), + + DEFAULT_DELIMITER("-...
Java
์ €๋Š” ๋ชฐ๋ž๋˜ ์ •๊ทœํ‘œํ˜„์‹ ๋ฌธ๋ฒ•์ด๋ผ ์ฐพ์•„๋ณด๋‹ˆ๊นŒ named capturing group ์ด๋ผ๊ณ  ํ•˜๋Š”๊ตฐ์š”.. ์ƒˆ๋กœ์šด๊ฑฐ ๋ฐฐ์›Œ๊ฐ‘๋‹ˆ๋‹ค!
@@ -0,0 +1,126 @@ +package store.view; + +import java.text.NumberFormat; +import store.domain.Product; +import store.domain.Products; +import store.dto.PurchaseDTO; +import store.dto.ReceiptDTO; + +public class OutputView { + private static final NumberFormat format = NumberFormat.getNumberInstance(); + +...
Java
์ด๋Ÿฐ ๋ถ€๋ถ„์—๋„ DTO๋ฅผ ๋ฐ›์•„์„œ ์ฒ˜๋ฆฌํ•˜๋Š”๊ฑด ์–ด๋–ป๊ฒŒ ์ƒ๊ฐํ•˜์‹œ๋‚˜์š”?
@@ -0,0 +1,14 @@ +package store.exception; + +public class CustomException extends IllegalArgumentException { + private final String errorMessage; + + public CustomException(String errorMessage) { + super(errorMessage); + this.errorMessage = errorMessage; + } + + public String getErr...
Java
CustomException ํด๋ž˜์Šค๋ฅผ ๋”ฐ๋กœ ๋งŒ๋“œ์‹  ์ด์œ ๊ฐ€ ๊ถ๊ธˆํ•ฉ๋‹ˆ๋‹ค (์ด ๋ถ€๋ถ„์€ ์ž˜ ๋ชฐ๋ผ์„œ).
@@ -0,0 +1,57 @@ +package store.view; + +import java.time.LocalDate; +import java.time.LocalDateTime; +import java.util.List; +import java.util.regex.Matcher; +import java.util.regex.Pattern; +import store.contant.Constant; +import store.dto.BuyDTO; +import store.exception.CustomException; +import store.excep...
Java
Matcher.results()๋กœ ๋‚˜๋ˆ„๋Š”๊ฑด ๊น”๋”ํ•˜์ง€๋งŒ ํ’ˆ๋ชฉ์„ ๋‚˜๋ˆ„๋Š” ๊ตฌ๋ถ„์ž๋กœ ์‰ผํ‘œ๊ฐ€ ์•„๋‹ˆ์–ด๋„ ์ž‘๋™ํ•ด์„œ, ์š”๊ตฌ์‚ฌํ•ญ์— ๋งž์ถ”๋ ค๋ฉด ์ˆ˜์ •ํ•ด์•ผ ํ•  ๊ฒƒ ๊ฐ™์•„์š”.
@@ -0,0 +1,83 @@ +package store.view; + +import camp.nextstep.edu.missionutils.Console; +import java.util.List; +import store.contant.Constant; +import store.dto.BuyDTO; +import store.exception.CustomException; +import store.exception.ErrorMessage; + +public class InputView { + public static List<BuyDTO> r...
Java
validate() ๋„ค์ด๋ฐ์ด ์กฐ๊ธˆ ๋” ๊ตฌ์ฒด์ ์ด๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,108 @@ +package store.controller; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.LocalDateTime; +import java.util.List; +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import sto...
Java
์ปจํŠธ๋กค๋Ÿฌ์˜ ์ƒ์„ฑ์ž๋ž‘ run ๋ถ€๋ถ„์ด ์ •๋ง ๊น”๋”ํ•˜๊ณ  ์ข‹์€ ๊ฒƒ ๊ฐ™์•„์š”!
@@ -0,0 +1,206 @@ +package store.domain; + +import camp.nextstep.edu.missionutils.DateTimes; +import java.util.ArrayList; +import java.util.List; +import java.util.Map; +import java.util.Set; +import store.contant.Constant; +import store.dto.BuyDTO; +import store.dto.ProductsDTO; +import store.dto.PurchaseDTO...
Java
InputView๋ฅผ ํ˜ธ์ถœํ•˜๋Š” ๋ถ€๋ถ„์„ ์ปจํŠธ๋กค๋Ÿฌ๋ฅผ ๊ฑฐ์น˜๋Š”๊ฒŒ ์ข‹์ง€ ์•Š์„๊นŒ ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
@@ -0,0 +1,35 @@ +package store.dto; + +import java.util.List; + +public record ReceiptDTO( + List<PurchaseDTO> cart, + List<PurchaseDTO> free +) { + public int getTotalQuantity() { + return cart.stream() + .mapToInt(PurchaseDTO::quantity) + .sum(); + ...
Java
0.3์€ ์ค‘์š”ํ•œ ์ˆซ์ž๋ผ ์ƒ์ˆ˜๋กœ ๋ฐ”๊พธ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค!
@@ -0,0 +1,126 @@ +package store.view; + +import java.text.NumberFormat; +import store.domain.Product; +import store.domain.Products; +import store.dto.PurchaseDTO; +import store.dto.ReceiptDTO; + +public class OutputView { + private static final NumberFormat format = NumberFormat.getNumberInstance(); + +...
Java
๊ฐœ์ˆ˜๊ฐ€ 0์ด์–ด๋„ ์ถœ๋ ฅ์ด ๋˜๋˜๋ฐ, 0์ผ๋•Œ ์ถœ๋ ฅ์—์„œ ์ œ์™ธ์‹œํ‚ค๋Š” ๊ฒƒ๋„ ์ข‹์„ ๊ฒƒ ๊ฐ™์Šต๋‹ˆ๋‹ค.
@@ -0,0 +1,108 @@ +package store.controller; + +import java.io.IOException; +import java.nio.file.Files; +import java.nio.file.Paths; +import java.time.LocalDateTime; +import java.util.List; +import org.junit.platform.commons.logging.Logger; +import org.junit.platform.commons.logging.LoggerFactory; +import sto...
Java
์ด๋ ‡๊ฒŒ ๋˜๋ฉด ํ”„๋กœ๋ชจ์…˜ ๊ธฐ๊ฐ„์— ์ข…๋ฃŒ๋‚ ์งœ๊ฐ€ ์‚ฌ์‹ค ํฌํ•จ์ด ์•ˆ๋˜์–ด์„œ (์ข…๋ฃŒ๋‚ ์งœ๋กœ ๋„˜์–ด๊ฐ€๋Š” 00์‹œ 00๋ถ„ 00์ดˆ ๊นŒ์ง€๋งŒ ํฌํ•จ๋˜๋”๋ผ๊ตฌ์š”), endDate.plusDays(1) ์˜ .atStartOfDay() ๋ฅผ ์‚ฌ์šฉํ•˜๋Š”๊ฒŒ ๋” ๋งž๋‹ค๊ณ  ์ƒ๊ฐํ•ฉ๋‹ˆ๋‹ค.
@@ -0,0 +1,141 @@ +package com.example.firstproject.controller; + +import com.example.firstproject.dto.ArticleDto; +import com.example.firstproject.dto.BoardDto; +import com.example.firstproject.entity.Article; +import com.example.firstproject.entity.Board; +import com.example.firstproject.service.ArticleService; +impo...
Java
delete ๋ฉ”์„œ๋“œ์™€ articleId๋ฅผ ์‚ฌ์šฉํ•˜๋Š” ๋ฉ”์„œ๋“œ์˜ ์‹œ์ ์„ ๊ณ ๋ คํ•ด๋ณด์‹œ๋ฉด ์ข‹์„ ๊ฒƒ ๊ฐ™์•„์š”
@@ -0,0 +1,41 @@ +package com.example.firstproject.controller; + +import com.example.firstproject.service.ArticleService; +import com.example.firstproject.service.BoardService; +import lombok.RequiredArgsConstructor; +import org.springframework.stereotype.Controller; +import org.springframework.ui.Model; +import org.sp...
Java
/ ์Šฌ๋ž˜์‹œ์˜ ์œ ๋ฌด์— ๋”ฐ๋ฅธ ์ฐจ์ด์ ์„ ํ•จ๊ป˜ ๊ณต๋ถ€ํ•ด๋ด…์‹œ๋‹ค