Skip to content

Commit 2cf1be6

Browse files
author
EpicFn
committed
refactor : dto 이름 일부 변경
1 parent 7fb05c1 commit 2cf1be6

File tree

7 files changed

+14
-19
lines changed

7 files changed

+14
-19
lines changed

src/main/java/org/tuna/zoopzoop/backend/domain/space/membership/controller/ApiV1InviteController.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
import org.tuna.zoopzoop.backend.domain.space.membership.service.MembershipService;
1111
import org.tuna.zoopzoop.backend.domain.space.space.dto.res.ResBodyForSpaceInviteList;
1212
import org.tuna.zoopzoop.backend.domain.space.space.dto.res.ResBodyForSpaceSave;
13-
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceMembershipInfoWithoutAuthority;
13+
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceInfoWithoutAuthority;
1414
import org.tuna.zoopzoop.backend.domain.space.space.service.SpaceService;
1515
import org.tuna.zoopzoop.backend.global.rsData.RsData;
1616
import org.tuna.zoopzoop.backend.global.security.jwt.CustomUserDetails;
@@ -81,8 +81,8 @@ public RsData<ResBodyForSpaceInviteList> getMyInvites(
8181

8282
// 멤버십(초대) 목록 조회
8383
List<Membership> invitations = membershipService.findByMember(member, "PENDING");
84-
List<SpaceMembershipInfoWithoutAuthority> invitationInfos = invitations.stream()
85-
.map(membership -> new SpaceMembershipInfoWithoutAuthority(
84+
List<SpaceInfoWithoutAuthority> invitationInfos = invitations.stream()
85+
.map(membership -> new SpaceInfoWithoutAuthority(
8686
membership.getSpace().getId(),
8787
membership.getSpace().getName(),
8888
membership.getSpace().getThumbnailUrl()

src/main/java/org/tuna/zoopzoop/backend/domain/space/space/controller/ApiV1SpaceController.java

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import org.springframework.data.domain.Sort;
1010
import org.springframework.data.web.PageableDefault;
1111
import org.springframework.security.core.annotation.AuthenticationPrincipal;
12-
import org.springframework.transaction.annotation.Transactional;
1312
import org.springframework.web.bind.annotation.*;
1413
import org.springframework.web.multipart.MultipartFile;
1514
import org.tuna.zoopzoop.backend.domain.member.entity.Member;
@@ -19,8 +18,7 @@
1918
import org.tuna.zoopzoop.backend.domain.space.membership.service.MembershipService;
2019
import org.tuna.zoopzoop.backend.domain.space.space.dto.req.ReqBodyForSpaceSave;
2120
import org.tuna.zoopzoop.backend.domain.space.space.dto.res.ResBodyForSpaceInfo;
22-
import org.tuna.zoopzoop.backend.domain.space.space.dto.res.ResBodyForSpaceList;
23-
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceMembershipInfo;
21+
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceInfo;
2422
import org.tuna.zoopzoop.backend.domain.space.space.dto.res.ResBodyForSpaceListPage;
2523
import org.tuna.zoopzoop.backend.domain.space.space.dto.res.ResBodyForSpaceSave;
2624
import org.tuna.zoopzoop.backend.domain.space.space.entity.Space;
@@ -29,9 +27,6 @@
2927
import org.tuna.zoopzoop.backend.global.security.jwt.CustomUserDetails;
3028

3129
import java.nio.file.AccessDeniedException;
32-
import java.util.List;
33-
import java.util.Map;
34-
import java.util.stream.Collectors;
3530

3631
@RestController
3732
@RequestMapping("/api/v1/space")
@@ -142,7 +137,7 @@ public RsData<ResBodyForSpaceListPage> getAllSpaces(
142137

143138
// Page<Membership>를 Page<SpaceMembershipInfo>로 변환
144139
// Page 객체의 map() 메서드를 사용하면 페이징 정보는 그대로 유지하면서 내용물만 쉽게 바꿀 수 있습니다.
145-
Page<SpaceMembershipInfo> spaceInfosPage = membershipsPage.map(membership -> new SpaceMembershipInfo(
140+
Page<SpaceInfo> spaceInfosPage = membershipsPage.map(membership -> new SpaceInfo(
146141
membership.getSpace().getId(),
147142
membership.getSpace().getName(),
148143
membership.getSpace().getThumbnailUrl(),
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import org.tuna.zoopzoop.backend.domain.space.membership.enums.Authority;
44

5-
public record SpaceMembershipInfo(
5+
public record SpaceInfo(
66
Integer id,
77
String name,
88
String thumbnailUrl,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
package org.tuna.zoopzoop.backend.domain.space.space.dto.etc;
22

3-
public record SpaceMembershipInfoWithoutAuthority(
3+
public record SpaceInfoWithoutAuthority(
44
Integer id,
55
String name,
66
String thumbnailUrl
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.tuna.zoopzoop.backend.domain.space.space.dto.res;
22

3-
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceMembershipInfoWithoutAuthority;
3+
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceInfoWithoutAuthority;
44

55
import java.util.List;
66

77
public record ResBodyForSpaceInviteList(
8-
List<SpaceMembershipInfoWithoutAuthority> spaces
8+
List<SpaceInfoWithoutAuthority> spaces
99
) {
1010
}
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
package org.tuna.zoopzoop.backend.domain.space.space.dto.res;
22

3-
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceMembershipInfo;
3+
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceInfo;
44

55
import java.util.List;
66

77
public record ResBodyForSpaceList(
8-
List<SpaceMembershipInfo> spaces
8+
List<SpaceInfo> spaces
99
) {
1010
}

src/main/java/org/tuna/zoopzoop/backend/domain/space/space/dto/res/ResBodyForSpaceListPage.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,20 @@
22

33
import lombok.Getter;
44
import org.springframework.data.domain.Page;
5-
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceMembershipInfo;
5+
import org.tuna.zoopzoop.backend.domain.space.space.dto.etc.SpaceInfo;
66

77
import java.util.List;
88

99
@Getter
1010
public class ResBodyForSpaceListPage {
11-
private final List<SpaceMembershipInfo> spaces; // 현재 페이지의 데이터
11+
private final List<SpaceInfo> spaces; // 현재 페이지의 데이터
1212
private final int page; // 현재 페이지 번호 (0부터 시작)
1313
private final int size; // 페이지 크기
1414
private final long totalElements; // 전체 요소 수
1515
private final int totalPages; // 전체 페이지 수
1616
private final boolean isLast; // 마지막 페이지 여부
1717

18-
public ResBodyForSpaceListPage(Page<SpaceMembershipInfo> page) {
18+
public ResBodyForSpaceListPage(Page<SpaceInfo> page) {
1919
this.spaces = page.getContent();
2020
this.page = page.getNumber();
2121
this.size = page.getSize();

0 commit comments

Comments
 (0)