-
Notifications
You must be signed in to change notification settings - Fork 70
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Team-21][BE][루이1세] 2주차 세번째 PR #215
Open
rkolx
wants to merge
62
commits into
codesquad-members-2022:team-21
Choose a base branch
from
Louie-03:dev-BE
base: team-21
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 52 commits
Commits
Show all changes
62 commits
Select commit
Hold shift + click to select a range
24b65be
build: Backend workflow 작성
Louie-03 bada3f9
Merge pull request #40 from Louie-03/BE-deploy
Louie-03 f7879f4
refactor: 패키지 변경
rkolx 093cd55
chore: client_id 환경변수 처리
rkolx 78aba46
feat: 이슈 등록 기능 구현
rkolx 3b0cdb0
refactor: 생성자가 아닌 필드에서 값을 초기화하도록 변경
rkolx d213622
Merge pull request #47 from Louie-03/BE-feature-46
rkolx cd5ca0b
feat : Issue 등록 기능 사용자 추가
Louie-03 3bee614
Merge pull request #49 from Louie-03/BE-feature-48
Louie-03 714de81
refactor : UploadFile과 Comment 엔티티의 연관관계 제거
Louie-03 9697a76
feat : S3 관련 환경 설정 추가
Louie-03 42a5cc0
feat : 파일 업로드 기능 구현
Louie-03 8c3470e
Merge pull request #50 from Louie-03/BE-feature-42
Louie-03 6b49372
init : Querydsl 환경 설정
Louie-03 7112736
feat : 로그인 성공 시 avatarImageUrl Response 기능 추가
Louie-03 c5000f3
fix : CORS 문제 설정 추가
Louie-03 944ea80
Update gradle.yml
Louie-03 19de7ac
feat: 필터 검색 동적 쿼리 구현
rkolx 1053173
refactor: 엔티티 @Gatter 추가
rkolx 0a940f0
feat : 이슈 리스트 구현 1단계
rkolx 3c48b39
refactor: Label 엔티티에 IssueLabel 연관관계 제거
rkolx e20c259
feat : 이슈 리스트 구현
rkolx 70f68f2
Merge pull request #55 from Louie-03/BE-feature-51
rkolx 5706e03
refactor : Getter 생성 및 Response 이름 변경
rkolx 3f9d28b
feat : 이슈 상세 조회 기능 구현
rkolx ea33276
Merge pull request #58 from Louie-03/BE-feature-56
rkolx df832f3
feat : 샘플 데이터 추가
Louie-03 9638e09
fix : 필터 검색 오류 로직 및 메서드명 수정
Louie-03 a740ab8
fix : 필터 검색 API 결과가 반환되지 않는 오류 수정
Louie-03 142b675
refactor : TextColor Enum 클래스 생성, Milestone 엔티티 status 필드 제거
Louie-03 4c98712
refactor: 토큰 헤더-> 바디
rkolx 749ed0b
refactor : cascade 옵션을 통해 최대한 적은 repository를 사용하도록 변경
Louie-03 9c27c51
Merge pull request #60 from Louie-03/BE-feature-57
Louie-03 8fad4b2
refactor: DTO 패키지 분리
rkolx 4a31a0c
Merge pull request #61 from Louie-03/BE-feature-59
rkolx 6d474a0
Revert "refactor: DTO 패키지 분리"
rkolx eb2cb3c
Merge pull request #62 from Louie-03/revert-61-BE-feature-59
rkolx eb9a582
refactor : DTO 패키지 구조변경
rkolx ac9b616
Merge pull request #63 from Louie-03/BE-feature-59
rkolx 337405c
refactor: 패키지 구조 변경
rkolx 1a1e782
feat: 이슈 제목 편집 및 삭제 구현
rkolx cbdf32b
Merge pull request #65 from Louie-03/BE-feature-64
rkolx af67f7e
feat: 이슈 상태 변경 기능 구현
rkolx 39b34bb
refactor: controller에서 enum을 바로 받을 수 있게 구현 및 Querydsl 상태개수 중복 수정
rkolx 3d4a817
refactor: EnableWebMvc 어노테이션 제거
rkolx 38c6449
Merge pull request #67 from Louie-03/BE-feature-66
rkolx 21a14ed
feat : 코멘트 작성 기능 구현
Louie-03 912a8e9
Merge pull request #69 from Louie-03/BE-feature-68
Louie-03 7c0fed5
feat : 코멘트 편집 기능 구현
Louie-03 8562cef
Merge pull request #71 from Louie-03/BE-feature-70
Louie-03 0dce6c1
feat: 로그아웃 기능 구현
rkolx fd69187
Merge pull request #73 from Louie-03/BE-feature-72
rkolx b196c6c
feat : 라벨 등록 기능 구현
Louie-03 f488fe5
feat : 라벨 조회 기능 구현
Louie-03 5e2bd12
feat : 라벨 수정 기능 구현
Louie-03 2ea43ec
feat : 라벨 삭제 기능 구현
Louie-03 0e80f58
Merge pull request #76 from Louie-03/BE-feature-75
Louie-03 66ecb64
feat: 마일스톤 등록기능 구현
rkolx 84b852b
feat: 마일스톤 조회기능 구현
rkolx 343df5b
feat: 마일스톤 수정기능 구현
rkolx 6f15c5d
feat: 마일스톤 삭제기능 구현
rkolx b5ef834
Merge pull request #77 from Louie-03/BE-feature-74
rkolx File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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,83 @@ | ||
# This workflow uses actions that are not certified by GitHub. | ||
# They are provided by a third-party and are governed by | ||
# separate terms of service, privacy policy, and support | ||
# documentation. | ||
# This workflow will build a package using Gradle and then publish it to GitHub packages when a release is created | ||
# For more information see: https://github.com/actions/setup-java/blob/main/docs/advanced-usage.md#Publishing-using-gradle | ||
|
||
name: Java CI with Gradle | ||
|
||
on: | ||
push: | ||
branches: [ BE-deploy ] | ||
pull_request: | ||
branches: [ BE-deploy ] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
defaults: | ||
run: | ||
working-directory: ./BE | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
|
||
# JDK11로 gradle 빌드 | ||
- name: Set up JDK 11 | ||
uses: actions/setup-java@v2 | ||
with: | ||
java-version: '11' | ||
distribution: 'temurin' | ||
|
||
- name: Insert data source information into application.yml | ||
run: | | ||
sed -i "s|\${DATASOURCE_URL}|$DATASOURCE_URL|g" ./src/main/resources/application.yml | ||
sed -i "s|\${DATASOURCE_USERNAME}|$DATASOURCE_USERNAME|g" ./src/main/resources/application.yml | ||
sed -i "s|\${DATASOURCE_PASSWORD}|$DATASOURCE_PASSWORD|g" ./src/main/resources/application.yml | ||
|
||
sed -i "s|\${OAUTH_CLIENT_ID}|$OAUTH_CLIENT_ID|g" ./src/main/resources/oauth.yml | ||
sed -i "s|\${OAUTH_CLIENT_SECRET}|$OAUTH_CLIENT_SECRET|g" ./src/main/resources/oauth.yml | ||
sed -i "s|\${OAUTH_ACCESS_SCOPE}|$OAUTH_ACCESS_SCOPE|g" ./src/main/resources/oauth.yml | ||
sed -i "s|\${OAUTH_LOGIN_FORM_URL}|$OAUTH_LOGIN_FORM_URL|g" ./src/main/resources/oauth.yml | ||
sed -i "s|\${JWT_ISSUER}|$JWT_ISSUER|g" ./src/main/resources/oauth.yml | ||
sed -i "s|\${JWT_SECRET_KEY}|$JWT_SECRET_KEY|g" ./src/main/resources/oauth.yml | ||
|
||
env: | ||
DATASOURCE_URL: ${{ secrets.DATASOURCE_URL }} | ||
DATASOURCE_USERNAME: ${{ secrets.DATASOURCE_USERNAME }} | ||
DATASOURCE_PASSWORD: ${{ secrets.DATASOURCE_PASSWORD }} | ||
OAUTH_CLIENT_ID: ${{ secrets.OAUTH_CLIENT_ID }} | ||
OAUTH_CLIENT_SECRET: ${{ secrets.OAUTH_CLIENT_SECRET }} | ||
OAUTH_ACCESS_SCOPE: ${{ secrets.OAUTH_ACCESS_SCOPE }} | ||
OAUTH_LOGIN_FORM_URL: ${{ secrets.OAUTH_LOGIN_FORM_URL }} | ||
JWT_ISSUER: ${{ secrets.JWT_ISSUER }} | ||
JWT_SECRET_KEY: ${{ secrets.JWT_SECRET_KEY }} | ||
|
||
- name: Grant execute permission for gradlew | ||
run: chmod +x gradlew | ||
- name: Build with Gradle | ||
run: ./gradlew build | ||
|
||
# 도커 빌드(도커 이미지 생성) | ||
- name: Docker build | ||
run: | | ||
docker login -u ${{ secrets.DOCKER_USERNAME }} -p ${{ secrets.DOCKER_PASSWORD }} | ||
docker build -t ${{ secrets.DOCKER_USERNAME }}/issue-tracker:1.0 . | ||
docker push ${{ secrets.DOCKER_USERNAME }}/issue-tracker:1.0 | ||
docker rmi ${{ secrets.DOCKER_USERNAME }}/issue-tracker:1.0 | ||
|
||
# 도커 이미지 배포 및 실행(EC2 ubuntu20.04로 배포) | ||
- name: Deploy | ||
uses: appleboy/ssh-action@master | ||
with: | ||
host: ${{ secrets.AWS_HOST_DNS }} #(생성한 인스턴스의 DNS주소) | ||
username: ubuntu | ||
key: ${{ secrets.SSH_PRIVATE_KEY }} #(인스턴스를 생성할 때 다운받은 pem키안에 값을 모두 복사해서 붙여넣기) | ||
envs: GITHUB_SHA | ||
script: | | ||
sudo docker ps -a -q --filter "name=issue-tracker" | grep -q . && docker stop issue-tracker && docker rm issue-tracker | true | ||
sudo docker rmi ${{ secrets.DOCKER_USERNAME }}/issue-tracker:1.0 | ||
sudo docker pull ${{ secrets.DOCKER_USERNAME }}/issue-tracker:1.0 | ||
sudo docker run -d -p 80:8080 --name issue-tracker -e FILE_UPLOAD_S3_ACCESS_KEY=${{ secrets.FILE_UPLOAD_S3_ACCESS_KEY }} -e FILE_UPLOAD_S3_SECRET_KEY=${{ secrets.FILE_UPLOAD_S3_SECRET_KEY }} ${{ secrets.DOCKER_USERNAME }}/issue-tracker:1.0 | ||
sudo docker rmi -f $(docker images -f "dangling=true" -q) || true |
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 @@ | ||
.idea |
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,4 +1,3 @@ | ||
oauth.yml | ||
HELP.md | ||
.gradle | ||
build/ | ||
|
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,17 @@ | ||
# JDK11 이미지 사용 | ||
FROM openjdk:11-jdk | ||
|
||
#마운트에 /tmp를 사용하는 이유 | ||
#spring boot의 Tomcat의 default 저장소가 /tmp인데 | ||
#위와 같이 볼륨 마운트를 해주면 호스트의 /var/lib/docker에 임시파일을 만들고 | ||
#컨테이너 안의 /tmp 와 연결할 수 있다는 뜻입니다. | ||
VOLUME /tmp | ||
|
||
# JAR_FILE 변수에 값을 저장 | ||
ARG JAR_FILE=./build/libs/*.jar | ||
|
||
# 변수에 저장된 것을 컨테이너 실행시 이름을 app.jar파일로 변경하여 컨테이너에 저장 | ||
COPY ${JAR_FILE} app.jar | ||
|
||
# 빌드된 이미지가 run 될 때 실행할 명령어 | ||
ENTRYPOINT ["java","-jar","/app.jar"] |
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,38 @@ | ||
|
||
- OneTab | ||
|
||
- 학습한 내용은 간단하게라도 마크다운 또는 노션으로 정리해서 깃헙에 올리자 | ||
|
||
- 매일 회고를 작성하자 | ||
|
||
- 프로젝트를 꼭 진행하자 | ||
|
||
- 사람들과 연락 & 공유하면서 서로 자극받고 도움이 될 수 있는 좋은 관계를 유지하자 | ||
|
||
- 잘 설명하지 못하는 내용에 대한 부분을 천천히 채워나가자 | ||
|
||
- 해당 기술을 사용하는 이유 & 비슷한 기능을 하는 다른 기술과 비교해보자 | ||
|
||
- 테스트코드도 공부해보자 | ||
|
||
- 현재까지 진행했던 코쿼 커리큘럼을 다시 진행해보자 | ||
|
||
- 다른 사람들의 코드와 리뷰를 참고해보자 | ||
|
||
- 이력서, 코테, 면접을 어떻게 준비할지 고민해보자 | ||
|
||
- 운동도 하자 | ||
|
||
- 여유롭지만 오랫동안 지속 가능한 하루 일정을 새워보자 | ||
|
||
- 슬랙, 카톡, 디코 보면서 사진 저장하기 | ||
|
||
- 코쿼 사람들 호칭 어떻게 할지 고민하기 | ||
|
||
- 옷 쇼핑하기 | ||
|
||
- 카카오페이 엄마한테 물어보고 해지했다가 다시 가입하기 | ||
|
||
- 리액트 간단하게 써보기 | ||
|
||
- 채용 담당자가 자소서를 쓸 때 어떤 부분을 볼지 생각해보기 |
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
Empty file.
19 changes: 19 additions & 0 deletions
19
BE/src/main/java/louie/hanse/issuetracker/config/QuerydslConfig.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,19 @@ | ||
package louie.hanse.issuetracker.config; | ||
|
||
import com.querydsl.jpa.impl.JPAQueryFactory; | ||
import javax.persistence.EntityManager; | ||
import javax.persistence.PersistenceContext; | ||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
|
||
@Configuration | ||
public class QuerydslConfig { | ||
|
||
@PersistenceContext | ||
EntityManager entityManager; | ||
|
||
@Bean | ||
public JPAQueryFactory jpaQueryFactory() { | ||
return new JPAQueryFactory(entityManager); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
BE/src/main/java/louie/hanse/issuetracker/config/WebConfig.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,25 @@ | ||
package louie.hanse.issuetracker.config; | ||
|
||
import louie.hanse.issuetracker.converter.StringToStatusConverter; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.format.FormatterRegistry; | ||
import org.springframework.web.servlet.config.annotation.CorsRegistry; | ||
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; | ||
|
||
@Configuration | ||
//@EnableWebMvc | ||
public class WebConfig implements WebMvcConfigurer { | ||
|
||
@Override | ||
public void addCorsMappings(CorsRegistry registry) { | ||
registry.addMapping("/**") | ||
.allowedOrigins("*") | ||
.allowedMethods("GET", "POST", "PUT", "PATCH", "OPTIONS") | ||
.allowedHeaders("headers"); | ||
} | ||
|
||
@Override | ||
public void addFormatters(FormatterRegistry registry) { | ||
registry.addConverter(new StringToStatusConverter()); | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
BE/src/main/java/louie/hanse/issuetracker/converter/StringToStatusConverter.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,11 @@ | ||
package louie.hanse.issuetracker.converter; | ||
|
||
import louie.hanse.issuetracker.domain.Status; | ||
import org.springframework.core.convert.converter.Converter; | ||
|
||
public class StringToStatusConverter implements Converter<String, Status> { | ||
@Override | ||
public Status convert(String source) { | ||
return Status.valueOfWithCaseInsensitive(source); | ||
} | ||
} |
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,24 +1,28 @@ | ||
package louie.hanse.issuetracker.domain; | ||
|
||
import javax.persistence.*; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
import static javax.persistence.FetchType.LAZY; | ||
import static javax.persistence.GenerationType.*; | ||
import static javax.persistence.GenerationType.IDENTITY; | ||
|
||
import java.time.LocalDateTime; | ||
import javax.persistence.Entity; | ||
import javax.persistence.GeneratedValue; | ||
import javax.persistence.Id; | ||
import javax.persistence.JoinColumn; | ||
import javax.persistence.ManyToOne; | ||
import javax.persistence.Table; | ||
import lombok.AccessLevel; | ||
import lombok.Getter; | ||
import lombok.NoArgsConstructor; | ||
|
||
@Getter | ||
@Entity | ||
@Table(name = "comments") | ||
@NoArgsConstructor(access = AccessLevel.PROTECTED) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 막아두신 것 좋네요. |
||
public class Comment { | ||
|
||
@Id @GeneratedValue(strategy = IDENTITY) | ||
private Long id; | ||
|
||
@OneToMany(mappedBy = "comment") | ||
private List<UploadFile> uploadFiles = new ArrayList<>(); | ||
|
||
@ManyToOne(fetch = LAZY) | ||
@JoinColumn | ||
private Issue issue; | ||
|
@@ -27,8 +31,18 @@ public class Comment { | |
@JoinColumn | ||
private Member writer; | ||
|
||
private String content; | ||
private LocalDateTime createdDateTime; | ||
private LocalDateTime updatedDateTime; | ||
private String contents; | ||
private LocalDateTime createdDateTime = LocalDateTime.now(); | ||
private LocalDateTime updatedDateTime = LocalDateTime.now(); | ||
|
||
public Comment(Issue issue, String contents) { | ||
this.issue = issue; | ||
issue.addComment(this); | ||
this.contents = contents; | ||
} | ||
|
||
public void updateContents(String contents) { | ||
this.contents = contents; | ||
updatedDateTime = LocalDateTime.now(); | ||
} | ||
} |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
정리가 꼼꼼해서 좋네요.