-
Notifications
You must be signed in to change notification settings - Fork 0
[FEAT] 내 모임 목록 조회 구현 #72
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| package team.wego.wegobackend.group.domain.entity; | ||
|
|
||
| import lombok.AccessLevel; | ||
| import lombok.Getter; | ||
| import team.wego.wegobackend.group.domain.exception.GroupErrorCode; | ||
| import team.wego.wegobackend.group.domain.exception.GroupException; | ||
|
|
||
| @Getter(AccessLevel.PUBLIC) | ||
| public enum MyGroupType { | ||
| CURRENT("current"), | ||
| MY_POST("myPost"), | ||
| PAST("past"); | ||
|
|
||
| private final String value; | ||
|
|
||
| MyGroupType(String value) { | ||
| this.value = value; | ||
| } | ||
|
|
||
| public static MyGroupType from(String value) { | ||
| if (value == null) { | ||
| throw new GroupException(GroupErrorCode.MY_GROUP_TYPE_NOT_NULL); | ||
| } | ||
| return switch (value) { | ||
| case "current" -> CURRENT; | ||
| case "myPost" -> MY_POST; | ||
| case "past" -> PAST; | ||
| default -> throw new GroupException(GroupErrorCode.INVALID_MY_GROUP_TYPE, value); | ||
|
|
||
|
|
||
| }; | ||
| } | ||
| } | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -123,6 +123,20 @@ public ResponseEntity<ApiResponse<Void>> deleteGroup( | |
| .body(ApiResponse.success(HttpStatus.NO_CONTENT.value(), null)); | ||
| } | ||
|
|
||
| // 나의 모임 목록 조회 | ||
|
|
||
| @GetMapping("/me") | ||
| public ResponseEntity<ApiResponse<GetGroupListResponse>> getMyGroups( | ||
| @RequestParam Long userId, // TODO: 나중에 인증 정보에서 꺼내기 | ||
| @RequestParam String type, | ||
|
||
| @RequestParam(required = false) Long cursor, | ||
| @RequestParam int size | ||
|
||
| ) { | ||
| GetGroupListResponse response = | ||
| groupService.getMyGroups(userId, type, cursor, size); | ||
|
|
||
| return ResponseEntity | ||
| .status(HttpStatus.OK) | ||
| .body(ApiResponse.success(HttpStatus.OK.value(), response)); | ||
| } | ||
|
|
||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using
@Getter(AccessLevel.PUBLIC)is redundant sincePUBLICis the default access level for@Getter. Simply use@Getterinstead.