Skip to content

Commit 4a2bcd7

Browse files
[Fix] "@Nickname" 형식의 데이터 추가해서 응답하는 코드 추가
1 parent 1e5b289 commit 4a2bcd7

File tree

3 files changed

+5
-3
lines changed

3 files changed

+5
-3
lines changed

src/main/java/org/dfbf/soundlink/domain/blocklist/controller/BlockListController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public ResponseResult blockUser(
2424
@AuthenticationPrincipal Long userId,
2525
@RequestBody String tag
2626
) {
27-
return blockListService.blockUser(1L, tag);
27+
return blockListService.blockUser(userId, tag);
2828
}
2929

3030
@DeleteMapping
@@ -36,7 +36,7 @@ public ResponseResult unblockUser(
3636
@AuthenticationPrincipal Long userId,
3737
@RequestBody Long blocklistId
3838
) {
39-
return blockListService.unblockUser(1L, blocklistId);
39+
return blockListService.unblockUser(userId, blocklistId);
4040
}
4141

4242
@GetMapping("/mypage/blackListSearch")
@@ -45,6 +45,6 @@ public ResponseResult unblockUser(
4545
description = "해당 유저의 차단 목록을 가져옵니다."
4646
)
4747
public ResponseResult getBlockList(@AuthenticationPrincipal Long userId) {
48-
return blockListService.getBlockListByUserId(1L);
48+
return blockListService.getBlockListByUserId(userId);
4949
}
5050
}

src/main/java/org/dfbf/soundlink/domain/blocklist/dto/BlockRes.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
public record BlockRes(
66
Long userId,
77
Long blockedUserId,
8+
String nickname,
89
Timestamp createdAt,
910
Timestamp updatedAt
1011
) {

src/main/java/org/dfbf/soundlink/domain/blocklist/service/BlockListService.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ public ResponseResult getBlockListByUserId(Long userId) {
9898
.map(block -> new BlockRes(
9999
block.getUser().getUserId(),
100100
block.getBlockedUser().getUserId(),
101+
"@" + block.getBlockedUser().getNickname(),
101102
block.getCreatedAt(),
102103
block.getUpdatedAt()
103104
)).collect(Collectors.toList())

0 commit comments

Comments
 (0)