-
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.
- Loading branch information
Showing
19 changed files
with
203 additions
and
103 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
4 changes: 1 addition & 3 deletions
4
...main/java/org/depromeet/spot/application/media/dto/request/CreatePresignedUrlRequest.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 |
---|---|---|
@@ -1,5 +1,3 @@ | ||
package org.depromeet.spot.application.media.dto.request; | ||
|
||
import org.depromeet.spot.domain.media.MediaProperty; | ||
|
||
public record CreatePresignedUrlRequest(String fileExtension, MediaProperty property) {} | ||
public record CreatePresignedUrlRequest(String fileExtension) {} |
40 changes: 40 additions & 0 deletions
40
...rc/main/java/org/depromeet/spot/application/member/controller/UpdateMemberController.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,40 @@ | ||
package org.depromeet.spot.application.member.controller; | ||
|
||
import jakarta.validation.Valid; | ||
import jakarta.validation.constraints.NotNull; | ||
import jakarta.validation.constraints.Positive; | ||
|
||
import org.depromeet.spot.application.member.dto.request.UpdateProfileRequest; | ||
import org.depromeet.spot.application.member.dto.response.MemberProfileResponse; | ||
import org.depromeet.spot.domain.member.Member; | ||
import org.depromeet.spot.usecase.port.in.member.UpdateMemberUsecase; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.PutMapping; | ||
import org.springframework.web.bind.annotation.RequestBody; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
import org.springframework.web.bind.annotation.ResponseStatus; | ||
import org.springframework.web.bind.annotation.RestController; | ||
|
||
import io.swagger.v3.oas.annotations.Operation; | ||
import io.swagger.v3.oas.annotations.tags.Tag; | ||
import lombok.RequiredArgsConstructor; | ||
|
||
@RestController | ||
@Tag(name = "멤버") | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/members") | ||
public class UpdateMemberController { | ||
|
||
private final UpdateMemberUsecase updateMemberUsecase; | ||
|
||
@PutMapping("/{memberId}") | ||
@ResponseStatus(HttpStatus.OK) | ||
@Operation(summary = "Member 프로필 수정 API") | ||
public MemberProfileResponse updateProfile( | ||
@PathVariable @NotNull @Positive final Long memberId, | ||
@RequestBody @Valid @NotNull UpdateProfileRequest request) { | ||
Member member = updateMemberUsecase.updateProfile(memberId, request.toCommand()); | ||
return MemberProfileResponse.from(member); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
...src/main/java/org/depromeet/spot/application/member/dto/request/UpdateProfileRequest.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,14 @@ | ||
package org.depromeet.spot.application.member.dto.request; | ||
|
||
import org.depromeet.spot.usecase.port.in.member.UpdateMemberUsecase.UpdateProfileCommand; | ||
|
||
public record UpdateProfileRequest(String profileImage, String nickname, Long teamId) { | ||
|
||
public UpdateProfileCommand toCommand() { | ||
return UpdateProfileCommand.builder() | ||
.nickname(nickname) | ||
.profileImage(profileImage) | ||
.teamId(teamId) | ||
.build(); | ||
} | ||
} |
10 changes: 10 additions & 0 deletions
10
...c/main/java/org/depromeet/spot/application/member/dto/response/MemberProfileResponse.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,10 @@ | ||
package org.depromeet.spot.application.member.dto.response; | ||
|
||
import org.depromeet.spot.domain.member.Member; | ||
|
||
public record MemberProfileResponse(Long id, String nickname, Long teamId) { | ||
|
||
public static MemberProfileResponse from(Member member) { | ||
return new MemberProfileResponse(member.getId(), member.getNickname(), member.getTeamId()); | ||
} | ||
} |
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
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
8 changes: 8 additions & 0 deletions
8
usecase/src/main/java/org/depromeet/spot/usecase/port/in/member/ReadMemberUsecase.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 org.depromeet.spot.usecase.port.in.member; | ||
|
||
import org.depromeet.spot.domain.member.Member; | ||
|
||
public interface ReadMemberUsecase { | ||
|
||
Member findById(Long memberId); | ||
} |
13 changes: 13 additions & 0 deletions
13
usecase/src/main/java/org/depromeet/spot/usecase/port/in/member/UpdateMemberUsecase.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 org.depromeet.spot.usecase.port.in.member; | ||
|
||
import org.depromeet.spot.domain.member.Member; | ||
|
||
import lombok.Builder; | ||
|
||
public interface UpdateMemberUsecase { | ||
|
||
Member updateProfile(Long memberId, UpdateProfileCommand command); | ||
|
||
@Builder | ||
record UpdateProfileCommand(String profileImage, String nickname, Long teamId) {} | ||
} |
Oops, something went wrong.