-
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.
Merge pull request #185 from Team-Tiki/feat-#182-workspace-setting
[FEAT] 워크스페이스 설정 기능들 추가
- Loading branch information
Showing
20 changed files
with
351 additions
and
148 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
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
src/main/java/com/tiki/server/external/service/S3Service.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.tiki.server.external.service; | ||
|
||
import com.tiki.server.external.dto.request.S3DeleteRequest; | ||
import com.tiki.server.external.dto.response.PreSignedUrlResponse; | ||
import com.tiki.server.external.util.S3Handler; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.stereotype.Service; | ||
|
||
@Service | ||
@RequiredArgsConstructor | ||
public class S3Service { | ||
|
||
private final S3Handler s3Handler; | ||
|
||
public PreSignedUrlResponse getUploadPreSignedUrl(String fileFormat) { | ||
return s3Handler.getUploadPreSignedUrl(fileFormat); | ||
} | ||
|
||
public void deleteFile(S3DeleteRequest request) { | ||
s3Handler.deleteFile(request.fileName()); | ||
} | ||
} |
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
45 changes: 45 additions & 0 deletions
45
src/main/java/com/tiki/server/memberteammanager/controller/MemberTeamController.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,45 @@ | ||
package com.tiki.server.memberteammanager.controller; | ||
|
||
import com.tiki.server.common.dto.BaseResponse; | ||
import com.tiki.server.common.dto.SuccessResponse; | ||
import com.tiki.server.memberteammanager.controller.dto.request.UpdateTeamMemberNameRequest; | ||
import com.tiki.server.memberteammanager.service.MemberTeamManagerService; | ||
import com.tiki.server.memberteammanager.service.dto.response.MemberTeamPositionGetResponse; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
import java.security.Principal; | ||
|
||
import static com.tiki.server.common.dto.SuccessResponse.success; | ||
import static com.tiki.server.memberteammanager.message.SuccessMessage.GET_POSITION; | ||
import static com.tiki.server.memberteammanager.message.SuccessMessage.UPDATE_NAME; | ||
|
||
@RestController | ||
@RequiredArgsConstructor | ||
@RequestMapping("/api/v1/team-member") | ||
public class MemberTeamController { | ||
|
||
private final MemberTeamManagerService memberTeamManagerService; | ||
|
||
@GetMapping("/teams/{teamId}/members/position") | ||
public ResponseEntity<SuccessResponse<MemberTeamPositionGetResponse>> getMemberTeamPosition( | ||
final Principal principal, | ||
@PathVariable final long teamId | ||
) { | ||
long memberId = Long.parseLong(principal.getName()); | ||
MemberTeamPositionGetResponse response = memberTeamManagerService.getPosition(memberId, teamId); | ||
return ResponseEntity.ok().body(success(GET_POSITION.getMessage(), response)); | ||
} | ||
|
||
@PatchMapping("/teams/{teamId}/members/name") | ||
public ResponseEntity<BaseResponse> updateTeamMemberName( | ||
final Principal principal, | ||
@PathVariable final long teamId, | ||
@RequestBody final UpdateTeamMemberNameRequest request | ||
) { | ||
long memberId = Long.parseLong(principal.getName()); | ||
memberTeamManagerService.updateTeamMemberName(memberId, teamId, request.newName()); | ||
return ResponseEntity.ok(success(UPDATE_NAME.getMessage())); | ||
} | ||
} |
8 changes: 8 additions & 0 deletions
8
...com/tiki/server/memberteammanager/controller/dto/request/UpdateTeamMemberNameRequest.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.tiki.server.memberteammanager.controller.dto.request; | ||
|
||
import jakarta.validation.constraints.NotNull; | ||
|
||
public record UpdateTeamMemberNameRequest( | ||
@NotNull String newName | ||
) { | ||
} |
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
11 changes: 11 additions & 0 deletions
11
...com/tiki/server/memberteammanager/service/dto/response/MemberTeamPositionGetResponse.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 com.tiki.server.memberteammanager.service.dto.response; | ||
|
||
import com.tiki.server.common.entity.Position; | ||
|
||
public record MemberTeamPositionGetResponse( | ||
Position position | ||
) { | ||
public static MemberTeamPositionGetResponse from(Position position) { | ||
return new MemberTeamPositionGetResponse(position); | ||
} | ||
} |
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
Oops, something went wrong.