-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into STMT-268-get_studies_joined
- Loading branch information
Showing
41 changed files
with
920 additions
and
47 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
34 changes: 34 additions & 0 deletions
34
src/main/java/com/stumeet/server/activity/adapter/in/ActivityQueryApi.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,34 @@ | ||
package com.stumeet.server.activity.adapter.in; | ||
|
||
import com.stumeet.server.activity.adapter.in.response.ActivityDetailResponse; | ||
import com.stumeet.server.activity.application.port.in.ActivityQueryUseCase; | ||
import com.stumeet.server.common.annotation.WebAdapter; | ||
import com.stumeet.server.common.auth.model.LoginMember; | ||
import com.stumeet.server.common.model.ApiResponse; | ||
import com.stumeet.server.common.response.SuccessCode; | ||
import lombok.RequiredArgsConstructor; | ||
import org.springframework.http.HttpStatus; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.security.core.annotation.AuthenticationPrincipal; | ||
import org.springframework.web.bind.annotation.GetMapping; | ||
import org.springframework.web.bind.annotation.PathVariable; | ||
import org.springframework.web.bind.annotation.RequestMapping; | ||
|
||
@WebAdapter | ||
@RequestMapping("/api/v1") | ||
@RequiredArgsConstructor | ||
public class ActivityQueryApi { | ||
|
||
private final ActivityQueryUseCase activityQueryUseCase; | ||
|
||
@GetMapping("/studies/{studyId}/activities/{activityId}") | ||
public ResponseEntity<ApiResponse<ActivityDetailResponse>> getById( | ||
@PathVariable Long studyId, | ||
@PathVariable Long activityId, | ||
@AuthenticationPrincipal LoginMember member | ||
) { | ||
ActivityDetailResponse response = activityQueryUseCase.getById(studyId, activityId, member.getId()); | ||
return ResponseEntity.status(HttpStatus.OK) | ||
.body(ApiResponse.success(SuccessCode.GET_SUCCESS, response)); | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
src/main/java/com/stumeet/server/activity/adapter/in/response/ActivityDetailResponse.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,27 @@ | ||
package com.stumeet.server.activity.adapter.in.response; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.Builder; | ||
|
||
import java.time.LocalDateTime; | ||
import java.util.List; | ||
|
||
public record ActivityDetailResponse( | ||
Long id, | ||
String title, | ||
String content, | ||
List<ActivityImageResponse> imageUrl, | ||
ActivityParticipantSimpleResponse author, | ||
List<ActivityParticipantSimpleResponse> participants, | ||
String status, | ||
LocalDateTime startDate, | ||
LocalDateTime endDate, | ||
LocalDateTime createdAt | ||
|
||
) { | ||
|
||
@QueryProjection | ||
@Builder | ||
public ActivityDetailResponse { | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
src/main/java/com/stumeet/server/activity/adapter/in/response/ActivityImageResponse.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,12 @@ | ||
package com.stumeet.server.activity.adapter.in.response; | ||
|
||
import lombok.Builder; | ||
|
||
public record ActivityImageResponse( | ||
Long id, | ||
String imageUrl | ||
) { | ||
@Builder | ||
public ActivityImageResponse { | ||
} | ||
} |
16 changes: 16 additions & 0 deletions
16
...va/com/stumeet/server/activity/adapter/in/response/ActivityParticipantSimpleResponse.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,16 @@ | ||
package com.stumeet.server.activity.adapter.in.response; | ||
|
||
import com.querydsl.core.annotations.QueryProjection; | ||
import lombok.Builder; | ||
|
||
public record ActivityParticipantSimpleResponse( | ||
Long memberId, | ||
String name, | ||
String profileImageUrl | ||
) { | ||
|
||
@QueryProjection | ||
@Builder | ||
public ActivityParticipantSimpleResponse { | ||
} | ||
} |
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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/stumeet/server/activity/application/port/in/ActivityImageQuery.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,9 @@ | ||
package com.stumeet.server.activity.application.port.in; | ||
|
||
import com.stumeet.server.activity.domain.model.ActivityImage; | ||
|
||
import java.util.List; | ||
|
||
public interface ActivityImageQuery { | ||
List<ActivityImage> findAllByActivityId(Long activityId); | ||
} |
9 changes: 9 additions & 0 deletions
9
src/main/java/com/stumeet/server/activity/application/port/in/ActivityParticipantQuery.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,9 @@ | ||
package com.stumeet.server.activity.application.port.in; | ||
|
||
import com.stumeet.server.activity.domain.model.ActivityParticipant; | ||
|
||
import java.util.List; | ||
|
||
public interface ActivityParticipantQuery { | ||
List<ActivityParticipant> findAllByActivityId(Long activityId); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/stumeet/server/activity/application/port/in/ActivityQueryUseCase.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,7 @@ | ||
package com.stumeet.server.activity.application.port.in; | ||
|
||
import com.stumeet.server.activity.adapter.in.response.ActivityDetailResponse; | ||
|
||
public interface ActivityQueryUseCase { | ||
ActivityDetailResponse getById(Long studyId, Long activityId, Long memberId); | ||
} |
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
9 changes: 9 additions & 0 deletions
9
src/main/java/com/stumeet/server/activity/application/port/out/ActivityImageQueryPort.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,9 @@ | ||
package com.stumeet.server.activity.application.port.out; | ||
|
||
import com.stumeet.server.activity.domain.model.ActivityImage; | ||
|
||
import java.util.List; | ||
|
||
public interface ActivityImageQueryPort { | ||
List<ActivityImage> findAllByActivityId(Long activityId); | ||
} |
9 changes: 9 additions & 0 deletions
9
...n/java/com/stumeet/server/activity/application/port/out/ActivityParticipantQueryPort.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,9 @@ | ||
package com.stumeet.server.activity.application.port.out; | ||
|
||
import com.stumeet.server.activity.domain.model.ActivityParticipant; | ||
|
||
import java.util.List; | ||
|
||
public interface ActivityParticipantQueryPort { | ||
List<ActivityParticipant> findAllByActivityId(Long activityId); | ||
} |
7 changes: 7 additions & 0 deletions
7
src/main/java/com/stumeet/server/activity/application/port/out/ActivityQueryPort.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,7 @@ | ||
package com.stumeet.server.activity.application.port.out; | ||
|
||
import com.stumeet.server.activity.domain.model.Activity; | ||
|
||
public interface ActivityQueryPort { | ||
Activity getById(Long studyId, Long activityId); | ||
} |
Oops, something went wrong.