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 | 
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 | ๋ก์ง์ ๋ฌธ์ ๊ฐ ์๋๊ฒ ๊ฐ์์ ๐
์ฐ์น์๊ฐ ๋๋ฒ ์ถ๋ ฅ๋๊ณ ์์ต๋๋ค
 |
@@ -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 | / ์ฌ๋์์ ์ ๋ฌด์ ๋ฐ๋ฅธ ์ฐจ์ด์ ์ ํจ๊ป ๊ณต๋ถํด๋ด
์๋ค |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.