-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chore] default 브랜치를 dev -> main으로 변경
- Loading branch information
Showing
130 changed files
with
7,934 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: BugFix | ||
about: 오류 해결 과정 기록 | ||
title: '' | ||
labels: ":hammer_and_wrench: fix" | ||
assignees: '' | ||
|
||
--- | ||
|
||
## 💡Description | ||
> description | ||
## ✅ To Do List | ||
- [ ] todo1 | ||
- [ ] todo2 | ||
- [ ] todo3 | ||
|
||
## Etc | ||
> etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
--- | ||
name: Feature | ||
about: 기능구현, 리팩토링, 환경설정 등을 포함한 기본 템플릿 | ||
title: '' | ||
labels: '' | ||
assignees: '' | ||
|
||
--- | ||
|
||
## 💡Description | ||
> description | ||
## ✅ To Do List | ||
- [ ] todo1 | ||
- [ ] todo2 | ||
- [ ] todo3 | ||
|
||
## Etc | ||
> etc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
## 개요 | ||
<!---- 변경 사항 및 관련 이슈에 대해 간단하게 작성해주세요. 어떻게보다 무엇을 왜 수정했는지 설명해주세요. --> | ||
|
||
## PR | ||
어떤 변경 사항이 있나요? | ||
|
||
- [ ] 새로운 기능 추가 | ||
- [ ] 버그 수정 | ||
- [ ] 문서 수정 | ||
- [ ] 코드 포맷 변경, 세미콜론 누락, 코드 수정이 없는경우 | ||
- [ ] 코드 리팩토링 | ||
- [ ] 테스트 추가, 테스트 리팩토링 | ||
- [ ] 빌드 수정, 패키지 매니저 수정 | ||
- [ ] 파일, 폴더명 수정 | ||
- [ ] 파일, 폴더 삭제 | ||
|
||
## Checklist | ||
|
||
- [ ] 커밋 메시지 컨벤션에 맞게 작성했습니다. | ||
- [ ] 변경 사항에 대한 테스트를 했습니다. | ||
- [ ] 필요 없는 import문이나 setter 등을 삭제했습니다. | ||
- [ ] 기존의 코드에 영향이 없는 것을 확인했습니다. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
name: server | ||
|
||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
- name: Set up JDK 17 | ||
uses: actions/setup-java@v3 | ||
with: | ||
distribution: temurin | ||
java-version: 17 | ||
|
||
- name: Ensure resource directory exists | ||
run: mkdir -p ./src/main/resources | ||
|
||
- name : injection-yml | ||
run : echo -E "${{ secrets.YML }}" > ./src/main/resources/application.yml | ||
|
||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Execute Gradle build and analyze | ||
run: ./gradlew jib | ||
|
||
- name: Run scripts in server | ||
uses: appleboy/ssh-action@master | ||
with: | ||
key: ${{ secrets.PRIVATE_KEY }} | ||
host: ${{ secrets.HOST_DEV }} | ||
username: ${{ secrets.USERNAME }} | ||
script: ${{ secrets.SCRIPT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,3 +35,6 @@ out/ | |
|
||
### VS Code ### | ||
.vscode/ | ||
|
||
### Setting File ### | ||
src/main/resources/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,14 @@ | ||
# BackEnd | ||
<div align="center"> | ||
|
||
# 빈주머니즈_Spring | ||
![빈주머니즈_커버_대지 1 사본](https://github.com/user-attachments/assets/744ef4c6-87cd-4db9-9c0b-f848231a203c) | ||
|
||
|
||
<img src="https://img.shields.io/badge/Spring-6DB33F?style=for-the-badge&logo=Spring&logoColor=white"> ![Java](https://img.shields.io/badge/java-%23ED8B00.svg?style=for-the-badge&logo=openjdk&logoColor=white) ![MySQL](https://img.shields.io/badge/mysql-4479A1.svg?style=for-the-badge&logo=mysql&logoColor=white) ![IntelliJ IDEA](https://img.shields.io/badge/IntelliJIDEA-000000.svg?style=for-the-badge&logo=intellij-idea&logoColor=white) ![Postman](https://img.shields.io/badge/Postman-FF6C37?style=for-the-badge&logo=postman&logoColor=white) | ||
|
||
<img src="https://github.com/user-attachments/assets/98dd17ec-9019-48f0-b5cb-00a9d0af8e9c" width="100" height="100"/> | ||
|
||
## Team | ||
|<img src="https://avatars.githubusercontent.com/u/41982054?v=4" width="150" height="150"/>|<img src="https://avatars.githubusercontent.com/u/54972879?v=4" width="150" height="150"/>|<img src="https://avatars.githubusercontent.com/u/96693842?v=4" width="150" height="150"/>|<img src="https://avatars.githubusercontent.com/u/106878778?v=4" width="150" height="150"/>|<img src="https://avatars.githubusercontent.com/u/107318116?v=4" width="150" height="150"/>|<img src="https://avatars.githubusercontent.com/u/162525176?v=4" width="150" height="150"/>| | ||
|:-:|:-:|:-:|:-:|:-:|:-:| | ||
|JeongJun Min<br/>[@m3k0813](https://github.com/m3k0813)|SeungMin Kang<br/>[@SoulTree-Lovers](https://github.com/SoulTree-Lovers)|류효경<br/>[@ryogaeng](https://github.com/ryogaeng)|강재혁<br/>[@ggamD00](https://github.com/ggamD00)|[@JunRain2](https://github.com/JunRain2)|이창준<br/>[@wnd01jun](https://github.com/wnd01jun)| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
37 changes: 37 additions & 0 deletions
37
src/main/java/com/bbteam/budgetbuddies/apiPayload/ApiResponse.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
package com.bbteam.budgetbuddies.apiPayload; | ||
|
||
|
||
import com.bbteam.budgetbuddies.apiPayload.code.BaseCode; | ||
import com.bbteam.budgetbuddies.apiPayload.code.status.SuccessStatus; | ||
import com.fasterxml.jackson.annotation.JsonInclude; | ||
import com.fasterxml.jackson.annotation.JsonProperty; | ||
import com.fasterxml.jackson.annotation.JsonPropertyOrder; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
@JsonPropertyOrder({"isSuccess", "code", "message", "result"}) | ||
public class ApiResponse<T> { | ||
@JsonProperty("isSuccess") | ||
private final Boolean isSuccess; | ||
private final String code; | ||
private final String message; | ||
@JsonInclude(JsonInclude.Include.NON_NULL) | ||
private T result; | ||
|
||
public static <T> ApiResponse<T> onSuccess(T result){ | ||
return new ApiResponse<>(true, SuccessStatus._OK.getCode(), SuccessStatus._OK.getMessage(), result); | ||
|
||
} | ||
|
||
public static <T> ApiResponse<T> of(BaseCode code, T result){ | ||
return new ApiResponse<>(true, code.getReasonHttpStatus().getCode(), | ||
code.getReasonHttpStatus().getMessage(), result); | ||
} | ||
|
||
|
||
public static <T> ApiResponse<T> onFailure(String code, String message, T data){ | ||
return new ApiResponse<>(false, code,message, data); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/BaseCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code; | ||
|
||
public interface BaseCode { | ||
|
||
ReasonDto getReason(); | ||
|
||
ReasonDto getReasonHttpStatus(); | ||
} |
8 changes: 8 additions & 0 deletions
8
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/BaseErrorCode.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code; | ||
|
||
public interface BaseErrorCode { | ||
|
||
ErrorReasonDto getReason(); | ||
|
||
ErrorReasonDto getReasonHttpStatus(); | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/ErrorReasonDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Builder | ||
@Getter | ||
@AllArgsConstructor | ||
public class ErrorReasonDto { | ||
String message; | ||
String code; | ||
Boolean isSuccess; | ||
HttpStatus httpStatus; | ||
} |
16 changes: 16 additions & 0 deletions
16
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/ReasonDto.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Builder; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Builder | ||
@AllArgsConstructor | ||
@Getter | ||
public class ReasonDto { | ||
String message; | ||
String code; | ||
Boolean isSuccess; | ||
HttpStatus httpStatus; | ||
} |
41 changes: 41 additions & 0 deletions
41
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/status/CommonErrorStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code.status; | ||
|
||
import com.bbteam.budgetbuddies.apiPayload.code.BaseErrorCode; | ||
import com.bbteam.budgetbuddies.apiPayload.code.ErrorReasonDto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum CommonErrorStatus implements BaseErrorCode { | ||
|
||
_INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "COMMON500", "서버에러"), | ||
_BAD_REQUEST(HttpStatus.BAD_REQUEST, "COMMON400", "잘못된 요청입니다."), | ||
_UNAUTHORIZED(HttpStatus.UNAUTHORIZED, "COMMON401", "인증이 필요합니다"), | ||
_FORBIDDEN(HttpStatus.FORBIDDEN, "COMMON403", "금지된 요청입니다."),; | ||
|
||
private final HttpStatus httpStatus; | ||
private final String code; | ||
private final String message; | ||
|
||
|
||
@Override | ||
public ErrorReasonDto getReason() { | ||
return ErrorReasonDto.builder() | ||
.message(message) | ||
.code(code) | ||
.isSuccess(false) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ErrorReasonDto getReasonHttpStatus() { | ||
return ErrorReasonDto.builder() | ||
.message(message) | ||
.code(code) | ||
.isSuccess(false) | ||
.httpStatus(httpStatus) | ||
.build(); | ||
} | ||
} |
55 changes: 55 additions & 0 deletions
55
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/status/ErrorStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code.status; | ||
|
||
import com.bbteam.budgetbuddies.apiPayload.code.BaseErrorCode; | ||
import com.bbteam.budgetbuddies.apiPayload.code.ErrorReasonDto; | ||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum ErrorStatus implements BaseErrorCode { | ||
|
||
|
||
_INTERNAL_SERVER_ERROR(HttpStatus.INTERNAL_SERVER_ERROR, "COMMON500", "서버에러"), | ||
_BAD_REQUEST(HttpStatus.BAD_REQUEST, "COMMON400", "잘못된 요청입니다."), | ||
_UNAUTHORIZED(HttpStatus.UNAUTHORIZED, "COMMON401", "인증이 필요합니다"), | ||
_FORBIDDEN(HttpStatus.FORBIDDEN, "COMMON403", "금지된 요청입니다."), | ||
USER_NOT_FOUND(HttpStatus.BAD_REQUEST, "USER4001", "사용자가 없습니다."), | ||
NICKNAME_NOT_EXIST(HttpStatus.BAD_REQUEST, "MEMBER4002", "닉네임은 필수입니다."), | ||
COMMENT_NOT_FOUND(HttpStatus.BAD_REQUEST, "COMMENT4001", "해당 댓글이 없습니다.") , | ||
ARTICLE_NOT_FOUND(HttpStatus.NOT_FOUND, "ARTICLE4002", "게시글이 없습니다."), | ||
TEMP_EXCEPTION(HttpStatus.BAD_REQUEST, "TEMP4001", "test"), | ||
FOOD_CATEGORY_NOT_FOUND(HttpStatus.NOT_FOUND, "FOOD_CATEGORY4004", "해당하는 음식 카테고리가 없습니다."), | ||
STORE_NOT_FOUND(HttpStatus.NOT_FOUND, "STORE4004", "해당하는 가게는 존재하지 않습니다."), | ||
MISSION_ALREADY_ACCEPT(HttpStatus.BAD_REQUEST, "MISSION4001", "해당 미션은 이미 수주되었습니다."), | ||
REVIEW_ALREADY_EXIST(HttpStatus.BAD_REQUEST, "REVIEW4001","해당 가게에 리뷰를 이미 작성하셨습니다."), | ||
PAGE_LOWER_ZERO(HttpStatus.BAD_REQUEST, "PAGE4001", "요청된 페이지가 0보다 작습니다."), | ||
MISSION_NOT_FOUND(HttpStatus.NOT_FOUND, "MISSION4004", "해당 미션이 존재하지 않습니다."), | ||
MISSION_ALREADY_COMPLETE(HttpStatus.BAD_REQUEST, "MISSION4001", "해당 미션은 이미 완료된 미션입니다."); | ||
|
||
|
||
private HttpStatus httpStatus; | ||
private String code; | ||
private String message; | ||
|
||
|
||
@Override | ||
public ErrorReasonDto getReason() { | ||
return ErrorReasonDto.builder() | ||
.message(message) | ||
.code(code) | ||
.isSuccess(false) | ||
.build(); | ||
} | ||
|
||
@Override | ||
public ErrorReasonDto getReasonHttpStatus() { | ||
return ErrorReasonDto.builder() | ||
.message(message) | ||
.code(code) | ||
.isSuccess(false) | ||
.httpStatus(httpStatus) | ||
.build(); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
src/main/java/com/bbteam/budgetbuddies/apiPayload/code/status/SuccessStatus.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
package com.bbteam.budgetbuddies.apiPayload.code.status; | ||
|
||
import lombok.AllArgsConstructor; | ||
import lombok.Getter; | ||
import org.springframework.http.HttpStatus; | ||
|
||
@Getter | ||
@AllArgsConstructor | ||
public enum SuccessStatus { | ||
_OK(HttpStatus.OK, "200", "okay"); | ||
|
||
private final HttpStatus httpStatus; | ||
private final String code; | ||
private final String message; | ||
} |
Oops, something went wrong.