-
Notifications
You must be signed in to change notification settings - Fork 31
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
[Team02] 깃허브 로그인 구현, 라벨 수정/이슈 필터링 카운트 기능 수정 #91
Open
zzawang
wants to merge
22
commits into
codesquad-members-2024:team-02
Choose a base branch
from
codesquad-masters2024-team02:be/v1.1.0
base: team-02
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 all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
287bc50
Update server-cd.yml
zzawang cfa8de6
fix: 사용하지 않는 메소드 삭제
zzawang 9883d5e
refactor: 필요없는 어노테이션 삭제
zzawang d136d90
feat: WebClient를 빈으로 등록하는 설정파일 생성
zzawang 7148daa
feat: 깃허브 로그인을 통해 사용자 정보를 가져오는 기능 구현
zzawang 4795b00
feat: 이미지 URL을 MultipartFile로 변환하는 기능 구현
zzawang cea8877
feat: 깃허브 로그인 사용자를 MemberCreateDto로 매핑하는 기능 추가
zzawang 7a6a65e
feat: 깃허브 로그인을 통해 사용자에게 유저 정보와 JWT 토큰을 전달하는 기능 구현
zzawang c739f6f
fix: 메소드의 재사용을 위해 매개변수를 변경
zzawang 3c5d377
feat: 사용자의 프로필 이미지를 저장하는 기능 추가
zzawang 9676c5b
setting: 필요한 의존성 추가
zzawang e92a48e
setting: FE의 배포된 url 추가
zzawang 5b8ee2d
Update server-cd.yml
zzawang c35530c
Update Dockerfile
zzawang a469603
Update server-cd.yml
zzawang a208852
fix: 필요없는 값 삭제
zzawang 7b8ce68
feat: 라벨 개수와 마일스톤 개수를 묶어서 보내는 API 구현
zzawang fa722db
setting: 도커 파일 수정
zzawang ce31817
fix: 필터링된 이슈의 열림/닫힘 개수를 구하는 기능 수정
zzawang 283d0fb
fix: 라벨 수정 기능 오류 해결
zzawang 721d029
Update server-cd.yml
zzawang 7a7f8cc
test: 메소드 이름 변경에 따른 테스트 수정
zzawang 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
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
13 changes: 13 additions & 0 deletions
13
be/issue-tracker/src/main/java/com/issuetracker/WebClientConfig.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,13 @@ | ||
package com.issuetracker; | ||
|
||
import org.springframework.context.annotation.Bean; | ||
import org.springframework.context.annotation.Configuration; | ||
import org.springframework.web.reactive.function.client.WebClient; | ||
|
||
@Configuration | ||
public class WebClientConfig { | ||
@Bean | ||
public WebClient webClient() { | ||
return WebClient.builder().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
70 changes: 70 additions & 0 deletions
70
be/issue-tracker/src/main/java/com/issuetracker/file/util/CustomMultipartFile.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,70 @@ | ||
package com.issuetracker.file.util; | ||
|
||
import java.io.ByteArrayInputStream; | ||
import java.io.File; | ||
import java.io.FileOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import org.apache.tika.Tika; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
/** | ||
* byte 배열을 MultipartFile 객체로 변환하기 위한 클래스 | ||
*/ | ||
public class CustomMultipartFile implements MultipartFile { | ||
private final Tika tika = new Tika(); | ||
|
||
private byte[] input; | ||
private String filename; | ||
|
||
public CustomMultipartFile(byte[] input, String filename) { | ||
this.input = input; | ||
this.filename = filename; | ||
} | ||
|
||
@Override | ||
public String getName() { | ||
return filename; | ||
} | ||
|
||
@Override | ||
public String getOriginalFilename() { | ||
return filename; | ||
} | ||
|
||
@Override | ||
public String getContentType() { | ||
try { | ||
return tika.detect(getInputStream()); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
return input == null || input.length == 0; | ||
} | ||
|
||
@Override | ||
public long getSize() { | ||
return input.length; | ||
} | ||
|
||
@Override | ||
public byte[] getBytes() { | ||
return input; | ||
} | ||
|
||
@Override | ||
public InputStream getInputStream() { | ||
return new ByteArrayInputStream(input); | ||
} | ||
|
||
@Override | ||
public void transferTo(File dest) throws IOException, IllegalStateException { | ||
try (FileOutputStream fos = new FileOutputStream(dest)) { | ||
fos.write(input); | ||
} | ||
} | ||
} |
24 changes: 24 additions & 0 deletions
24
be/issue-tracker/src/main/java/com/issuetracker/file/util/ImgUrlConverter.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,24 @@ | ||
package com.issuetracker.file.util; | ||
|
||
import java.awt.image.BufferedImage; | ||
import java.io.ByteArrayOutputStream; | ||
import java.io.IOException; | ||
import java.io.InputStream; | ||
import java.net.MalformedURLException; | ||
import java.net.URL; | ||
import javax.imageio.ImageIO; | ||
import org.springframework.web.multipart.MultipartFile; | ||
|
||
public class ImgUrlConverter { | ||
public static MultipartFile toMultipartFile(String imgUrl) throws MalformedURLException { | ||
URL url = new URL(imgUrl); | ||
try (InputStream inputStream = url.openStream(); ByteArrayOutputStream bos = new ByteArrayOutputStream()) { | ||
BufferedImage urlImage = ImageIO.read(inputStream); | ||
ImageIO.write(urlImage, "jpg", bos); | ||
byte[] byteArray = bos.toByteArray(); | ||
return new CustomMultipartFile(byteArray, imgUrl); | ||
} catch (IOException e) { | ||
throw new RuntimeException(e); | ||
} | ||
} | ||
} |
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
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
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
22 changes: 22 additions & 0 deletions
22
be/issue-tracker/src/main/java/com/issuetracker/issue/dto/IssueFilterResult.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,22 @@ | ||
package com.issuetracker.issue.dto; | ||
|
||
import java.time.LocalDateTime; | ||
import lombok.Builder; | ||
import lombok.EqualsAndHashCode; | ||
import lombok.Getter; | ||
import lombok.ToString; | ||
|
||
@Getter | ||
@ToString | ||
@Builder | ||
@EqualsAndHashCode | ||
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. 동일성 vs 동등성 개념의 차이를 확인해보시면 좋을 것 같습니다! |
||
public class IssueFilterResult { | ||
private final Long id; | ||
private final String title; | ||
private final LocalDateTime createDate; | ||
private final Boolean isClosed; | ||
private final String authorId; | ||
private final String milestoneName; | ||
private final String closedCount; | ||
private final String openCount; | ||
} |
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.
제가 Tika를 잘 모르긴하지만, 유틸성 느낌이 강하다고 한다면 static하게 설정해주는 것도 좋을 것 같습니다!
인스턴스 별로 (1) 다르게 가지고 있어야하는 필드와 (2) 모든 인스턴스들이 공유해도 괜찮은 필드를 구분해서 생각해주시면 좋습니다😃