Skip to content

Commit 1633f7a

Browse files
authored
Merge branch 'dev' into feat/#150
2 parents 420ab80 + 3b51986 commit 1633f7a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+696
-157
lines changed

.DS_Store

-6 KB
Binary file not shown.
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Gemini Code Review
2+
3+
on:
4+
push:
5+
branches: [ feat/gemini ]
6+
paths:
7+
- 'backend/**'
8+
pull_request:
9+
types: [opened, synchronize]
10+
11+
jobs:
12+
code-review:
13+
runs-on: ubuntu-latest
14+
permissions:
15+
contents: read
16+
pull-requests: write
17+
steps:
18+
- name: Checkout repository
19+
uses: actions/checkout@v3
20+
with:
21+
fetch-depth: 0
22+
23+
- name: Set up Node
24+
uses: actions/setup-node@v3
25+
26+
- name: Install GoogleGenerativeAI
27+
run: |
28+
npm install @google/generative-ai
29+
30+
# PR 이벤트에서의 변경사항 처리
31+
- name: Get git diff for PR
32+
if: github.event_name == 'pull_request'
33+
run: |
34+
git fetch origin "${{ github.event.pull_request.base.ref }}"
35+
git fetch origin "${{ github.event.pull_request.head.ref }}"
36+
git diff --unified=0 "origin/${{ github.event.pull_request.base.ref }}" > "diff.txt"
37+
echo "EVENT_TYPE=pull_request" >> $GITHUB_ENV
38+
39+
# Push 이벤트에서의 변경사항 처리
40+
- name: Get git diff for Push
41+
if: github.event_name == 'push'
42+
run: |
43+
git diff --unified=0 HEAD^ HEAD > "diff.txt"
44+
echo "EVENT_TYPE=push" >> $GITHUB_ENV
45+
46+
# Gemini를 사용한 코드 분석
47+
- name: Run Gemini-1.5-flash
48+
id: gemini_review
49+
uses: actions/github-script@v7
50+
with:
51+
script: |
52+
const fs = require("fs");
53+
const diff_output = fs.readFileSync("diff.txt",'utf8');
54+
55+
const { GoogleGenerativeAI } = require("@google/generative-ai");
56+
const genAI = new GoogleGenerativeAI("${{ secrets.GEMINI_API_KEY }}");
57+
const model = genAI.getGenerativeModel({ model: "gemini-1.5-flash"});
58+
59+
// PR과 Push에 따라 다른 프롬프트 사용
60+
let prompt;
61+
if (process.env.EVENT_TYPE === 'pull_request') {
62+
prompt = `Explain in korean. You are a senior software engineer and need to perform a code review based on the results of a given git diff. Review the changed code from different perspectives and let us know if there are any changes that need to be made. If you see any code that needs to be fixed in the result of the git diff, you need to calculate the exact line number by referring to the "@@ -0,0 +0,0 @@" part. The output format is \[{"path":"{ filepath }", "line": { line }, "text": { review comment }, "side": "RIGHT"}\] format must be respected.\n<git diff>${diff_output}</git diff>`;
63+
} else {
64+
prompt = `Explain in korean. You are a senior software engineer and need to perform a code review based on the results of a given git diff. Provide a detailed review of the code changes, focusing on code quality, readability, performance, and security. Format your response in Markdown with clear headings for each file reviewed.\n<git diff>${diff_output}</git diff>`;
65+
}
66+
67+
const result = await model.generateContent(prompt);
68+
const response = await result.response;
69+
const text = response.text();
70+
71+
fs.writeFileSync('review_result.txt', text);
72+
console.log('Review results saved!');
73+
74+
# PR 이벤트: 라인별 리뷰 코멘트 추가
75+
- name: Format and add PR review comments
76+
if: env.EVENT_TYPE == 'pull_request'
77+
id: store
78+
run: |
79+
COMMENT=$(sed '/^```/d' review_result.txt | jq -c .)
80+
echo "comment=$COMMENT" >> $GITHUB_OUTPUT
81+
82+
- name: Add Pull Request Review Comment
83+
if: env.EVENT_TYPE == 'pull_request'
84+
uses: nbaztec/[email protected]
85+
with:
86+
comments: ${{ steps.store.outputs.comment }}
87+
repo-token: ${{ secrets.GITHUB_TOKEN }}
88+
repo-token-user-login: 'github-actions[bot]'
89+
allow-repeats: false
90+
91+
# Push 이벤트: 액션 로그에 리뷰 결과 출력 및 아티팩트 업로드
92+
- name: Display review results in workflow log
93+
if: env.EVENT_TYPE == 'push'
94+
run: |
95+
echo "===== Gemini Code Review Results ====="
96+
cat review_result.txt
97+
echo "======================================"
98+
99+
- name: Upload review results as artifact
100+
if: env.EVENT_TYPE == 'push'
101+
uses: actions/upload-artifact@v4
102+
with:
103+
name: gemini-code-review
104+
path: review_result.txt

README.md

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
# 🌱 CommitField_BE
2+
> 커밋필드 (사용자의 깃허브 기록을 활용해 펫 육성 및 업적 달성을 지원하며, 채팅 등 지속적인 동기 부여를 돕는 서비스)
3+
4+
총 개발기간 : `2025.2.18` ~ `2025.03.13` (22일)
5+
</br>
6+
개발인원: 5명
7+
8+
</br>
9+
<img width="1629" alt="스크린샷 2025-02-13 오후 5 17 27" src="https://github.com/user-attachments/assets/5b9be8f8-f524-4bd6-bee5-99dbd2d4f591" />
10+
11+
# 🌴 팀원 소개
12+
<table>
13+
<tr>
14+
<td><img src="https://avatars.githubusercontent.com/u/15629036?v=4" width="200" height="200"></td>
15+
<td><img src="https://avatars.githubusercontent.com/u/181931584?v=4" width="200" height="200"></td>
16+
<td><img src="https://avatars.githubusercontent.com/u/93702730?v=4" width="200" height="200"></td>
17+
<td><img src="https://avatars.githubusercontent.com/u/82190411?v=4" width="200" height="200"></td>
18+
<td><img src="https://avatars.githubusercontent.com/u/55117130?v=4" width="200" height="200"></td>
19+
</tr>
20+
<tr>
21+
<td><a href="https://github.com/whale22">김소영</a></td>
22+
<td><a href="https://github.com/skyeong42">성수경</a></td>
23+
<td><a href="https://github.com/seoyeonson">손서연</a></td>
24+
<td><a href="https://github.com/ces0135-hub">백성현</a></td>
25+
<td><a href="https://github.com/ces0135-hub">윤현승</a></td>
26+
</tr>
27+
</table>
28+
29+
## 💐 기술 스택
30+
31+
<img width="1046" alt="스크린샷 2025-03-14 오후 1 18 14" src="https://github.com/user-attachments/assets/48a7e53b-08c6-41bb-8fae-88fc9be322d3" />
32+
</br>
33+
34+
## 🌼 시스템 아키텍쳐
35+
36+
<img width="1545" alt="스크린샷 2025-02-13 오후 1 18 55" src="https://github.com/user-attachments/assets/cc121c13-be01-47fd-a44a-64bf3a6433c7" />
37+
</br>
38+
39+
## 🌳 ERD
40+
41+
<img width="1502" alt="스크린샷 2025-03-14 오후 1 19 59" src="https://github.com/user-attachments/assets/4c50079c-240c-47d3-9c87-e09e13f4d9b5" />
42+
</br>
43+
44+
45+
# 🍀 페이지 별 기능
46+
47+
## 🌺 메인 페이지
48+
49+
<img width="1600" alt="메인 페이지" src="https://github.com/user-attachments/assets/824e6caa-6a15-4b1b-a747-a5da09d29892" />
50+
</br>
51+
52+
### 🍃 기능
53+
#### 🔹 펫/랭킹
54+
- 계절 별 랭킹 설계로 총 커밋 수와 계절 별 커밋 수.
55+
- 현재 시즌에 맞는 커밋 수에 따라 랭킹을 부여.
56+
#### 🔹 커밋 개수 자동 갱신
57+
- 유저 커밋 수 주기적 갱신.
58+
- 스프링 이벤트를 통한 데이터 일괄 갱신.
59+
#### 🔹 실시간 알림
60+
- 시즌 알림
61+
- 랭킹 알림
62+
- 연속 커밋 축하 알림
63+
- 커밋 부재 알림
64+
65+
## 🌹 펫
66+
67+
<img width="1600" alt="" src="https://github.com/user-attachments/assets/766fc5cf-11a4-43ad-bd58-1aa7f8908efa" />
68+
</br>
69+
70+
### 🍃 기능
71+
#### 🔹 펫
72+
- 사용자 별 펫 확인 가능.
73+
74+
## 🌻 로그인
75+
76+
<img width="1600" alt="로그인" src="https://github.com/user-attachments/assets/a3842c23-023c-4eda-965f-4767768cb5cf" />
77+
</br>
78+
79+
### 🍃 기능
80+
#### 🔹 로그인
81+
- Github API를 이용한 로그인 구현.
82+
- 세션 방식 사용.
83+
84+
85+
## 🌷 채팅
86+
<img width="1600" alt="로그인" src="https://github.com/user-attachments/assets/f29670ac-4dbe-4af0-87d5-3e9360a9246e" />
87+
</br>
88+
<img width="1600" alt="로그인" src="https://github.com/user-attachments/assets/a09a257f-9ebf-43ec-89f3-7399678e17b2" />
89+
</br>
90+
91+
92+
### 🍃 기능
93+
#### 🔹 채팅 방 관리
94+
- 반장이 채팅 방을 생성 및 삭제 가능.
95+
- 마지막 사용자가 나가면 채팅 방 자동 삭제.
96+
- 채팅 방 목록 조회 (전체, 내가 생성한 방, 참여 중인 방, 좋아요 순, 내가 좋아요한 방).
97+
- 중복 참여 불가.
98+
- 키워드 기반 채팅 방 검색.
99+
- 반장만 채팅 방 이름 수정 가능.
100+
- 비밀번호 설정 가능.
101+
102+
#### 🔹 채팅 기능
103+
- 실시간 양방향 통신 사용자 메시지 전송.
104+
- 채팅 방 내 메시지 조회 (사용자가 들어온 시점부터 확인 가능).
105+
106+
#### 🔹 사용자 관리
107+
- 온라인/오프라인 상태 확인 (로그인, 로그아웃).
108+
- 채팅 방 참여자 목록 조회 가능.
109+
- 채팅 방 좋아요 기능 제공 (좋아요 순 정렬 가능).
110+
111+
112+
113+

src/.DS_Store

-6 KB
Binary file not shown.

src/main/.DS_Store

-6 KB
Binary file not shown.

src/main/java/.DS_Store

-6 KB
Binary file not shown.

src/main/java/cmf/.DS_Store

-6 KB
Binary file not shown.
-6 KB
Binary file not shown.
-6 KB
Binary file not shown.

src/main/java/cmf/commitField/domain/admin/controller/ApiV1PetImgController.java renamed to src/main/java/cmf/commitField/domain/admin/admin/controller/ApiV1PetImgController.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package cmf.commitField.domain.admin.controller;
1+
package cmf.commitField.domain.admin.admin.controller;
22

33
import cmf.commitField.global.aws.s3.S3Service;
44
import lombok.RequiredArgsConstructor;

0 commit comments

Comments
 (0)