Skip to content

Commit 8d0e41c

Browse files
authored
Merge pull request #313 from HaRu-Developers/feat/#311-get-instagram-account-name
feat/#311: 워크스페이스에 연동된 인스타그램 계정 조회하는 API 구현
2 parents f803594 + 55ec80c commit 8d0e41c

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

src/main/java/com/haru/api/domain/snsEvent/controller/SnsEventController.java

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,4 +166,22 @@ public ApiResponse<SnsEventResponseDTO.ListDownLoadLinkResponse> downloadList(
166166
);
167167
}
168168

169+
@Operation(
170+
summary = "워크스페이스에 연동된 인스타그램 계정 조회 API [v1.0 (2025-08-20)]",
171+
description = "# [v1.0 (2025-08-20)](https://www.notion.so/API-21e5da7802c581cca23dff937ac3f155?p=2545da7802c5801299c9f47578ba7d75&pm=s)" +
172+
" 워크스페이스에 연동된 인스타그램 계정을 조회하는 API입니다. Path Variable에 workspaceId를 넣어 요청해주세요."
173+
)
174+
@GetMapping("/{workspaceId}/instagram")
175+
public ApiResponse<SnsEventResponseDTO.getInstagramAccountName> getInstagramAccountName(
176+
@PathVariable String workspaceId,
177+
@Parameter(hidden = true) @AuthUser User user,
178+
@Parameter(hidden = true) @AuthWorkspace Workspace workspace
179+
) {
180+
return ApiResponse.onSuccess(
181+
snsEventQueryService.getInstagramAccountName(
182+
user,
183+
workspace
184+
)
185+
);
186+
}
169187
}

src/main/java/com/haru/api/domain/snsEvent/converter/SnsEventConverter.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,4 +99,12 @@ public static SnsEventResponseDTO.WinnerResponse toWinnerResponse(Winner winner)
9999
.account(winner.getNickname())
100100
.build();
101101
}
102+
103+
public static SnsEventResponseDTO.getInstagramAccountName toGetInstagramAccountName(
104+
String instagramAccountName
105+
) {
106+
return SnsEventResponseDTO.getInstagramAccountName.builder()
107+
.instagramAccountName(instagramAccountName)
108+
.build();
109+
}
102110
}

src/main/java/com/haru/api/domain/snsEvent/dto/SnsEventResponseDTO.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,4 +117,12 @@ public static class WinnerResponse {
117117
public static class ListDownLoadLinkResponse {
118118
private String downloadLink;
119119
}
120+
121+
@Getter
122+
@Builder
123+
@NoArgsConstructor
124+
@AllArgsConstructor
125+
public static class getInstagramAccountName {
126+
private String instagramAccountName;
127+
}
120128
}

src/main/java/com/haru/api/domain/snsEvent/service/SnsEventQueryService.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,4 +10,6 @@ public interface SnsEventQueryService {
1010
SnsEventResponseDTO.GetSnsEventListRequest getSnsEventList(User user, Workspace workspace);
1111

1212
SnsEventResponseDTO.GetSnsEventRequest getSnsEvent(User user, SnsEvent snsEvent);
13+
14+
SnsEventResponseDTO.getInstagramAccountName getInstagramAccountName(User user, Workspace workspace);
1315
}

src/main/java/com/haru/api/domain/snsEvent/service/SnsEventQueryServiceImpl.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,4 +48,16 @@ public SnsEventResponseDTO.GetSnsEventRequest getSnsEvent(User user, SnsEvent sn
4848
);
4949

5050
}
51+
52+
@Override
53+
public SnsEventResponseDTO.getInstagramAccountName getInstagramAccountName(User user, Workspace workspace) {
54+
if (workspace.getInstagramAccountName() == null) {
55+
return SnsEventConverter.toGetInstagramAccountName(
56+
""
57+
);
58+
}
59+
return SnsEventConverter.toGetInstagramAccountName(
60+
workspace.getInstagramAccountName()
61+
);
62+
}
5163
}

0 commit comments

Comments
 (0)