Skip to content

Commit

Permalink
Merge pull request #88 from Nook-Book/feat/#87-default-image-setting
Browse files Browse the repository at this point in the history
[FEAT] ๊ธฐ๋ณธ ์ด๋ฏธ์ง€ ๊ฒฝ๋กœ ์„ค์ •
  • Loading branch information
jisujeong0 authored Jan 21, 2025
2 parents da3b209 + 1be8c3d commit 057276f
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ public ResponseEntity<ApiResponse> getMyInfo(UserPrincipal userPrincipal) {
MyInfoRes myInfoRes = MyInfoRes.builder()
.nicknameId(user.getNicknameId())
.nickname(user.getNickname())
.imageUrl(user.getImageUrl())
.friendsNum(num)
.build();

Expand All @@ -193,7 +194,7 @@ public ResponseEntity<?> updateImage(UserPrincipal userPrincipal, Boolean isDefa
String imageUrl;
if (isDefaultImage && image.isEmpty()) {
imageName = "default.png";
imageUrl = "https://"; // ์ถ”ํ›„ ์ˆ˜์ •
imageUrl = "https://nookbook-image-bucket.s3.amazonaws.com/default.png";
} else {
imageName = s3Uploader.uploadImage(image.get());
imageUrl = s3Uploader.getFullPath(imageName);
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/com/nookbook/domain/user/domain/User.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,7 @@ public class User extends BaseEntity {

private String providerId;

// ์ด๋ฏธ์ง€๋Š” ๊ธฐ๋ณธ ๊ณ ์ • ํ•„์š”
private String imageUrl = "https://";
private String imageUrl = "https://nookbook-image-bucket.s3.amazonaws.com/default.png";

private String imageName = "default.png";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ public class MyInfoRes {
@Schema(type = "String", example = "๊ธฐ๋ฌด๋ผํƒ€์ฟ ์•ผ๊ฐ€๋˜", description = "์‚ฌ์šฉ์ž์˜ ๋‹‰๋„ค์ž„์ž…๋‹ˆ๋‹ค.")
private String nickname;

@Schema(type = "String", example = "https://nookbook-s3-bucket.amazons.com/akfjvndij0e3.png", description = "์‚ฌ์šฉ์ž์˜ ํ”„๋กœํ•„ ์‚ฌ์ง„ URL์ž…๋‹ˆ๋‹ค.")
private String imageUrl;

@Schema(type = "int", example = "12", description = "ํŠน์ • ์‚ฌ์šฉ์ž์˜ ์นœ๊ตฌ ์ˆ˜ ์ž…๋‹ˆ๋‹ค.")
private int friendsNum;
}
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ public ResponseEntity<?> findReadingReportByYear(
return bookService.countReadBooksByYear(userPrincipal, year);
}

@Operation(summary = "[๋งˆ์ดํŽ˜์ด์ง€] ๋‚ด ์ •๋ณด ์กฐํšŒ", description = "๋งˆ์ดํŽ˜์ด์ง€์˜ ๋‚ด ์ •๋ณด(์•„์ด๋””, ๋‹‰๋„ค์ž„, ์นœ๊ตฌ ์ˆ˜)๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.")
@Operation(summary = "[๋งˆ์ดํŽ˜์ด์ง€] ๋‚ด ์ •๋ณด ์กฐํšŒ", description = "๋งˆ์ดํŽ˜์ด์ง€์˜ ๋‚ด ์ •๋ณด(์•„์ด๋””, ๋‹‰๋„ค์ž„, ํ”„๋กœํ•„ ์ด๋ฏธ์ง€, ์นœ๊ตฌ ์ˆ˜)๋ฅผ ์กฐํšŒํ•ฉ๋‹ˆ๋‹ค.")
@ApiResponses(value = {
@ApiResponse(responseCode = "200", description = "์กฐํšŒ ์„ฑ๊ณต", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = MyInfoRes.class) ) } ),
@ApiResponse(responseCode = "400", description = "์กฐํšŒ ์‹คํŒจ", content = { @Content(mediaType = "application/json", schema = @Schema(implementation = ErrorResponse.class) ) } ),
Expand Down

0 comments on commit 057276f

Please sign in to comment.