Skip to content

Commit

Permalink
🎨 refactor: 가입한 그룹 조회 API 명세에 맞게 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
woosung1223 committed Aug 17, 2024
1 parent 57fbe06 commit eed48d3
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import slvtwn.khu.toyouserver.application.GroupService;
import slvtwn.khu.toyouserver.common.UserAuthentication;
Expand All @@ -25,18 +26,18 @@ public GroupResponse createGroup(@RequestBody GroupCreateRequest request) {
return groupService.createGroup(request.name());
}

@GetMapping("/groups")
public List<GroupResponse> findRegisteredGroups(@RequestParam Long memberId) {
return groupService.findRegisteredGroups(memberId);
}

@PostMapping("/groups/{groupId}/members")
public void registerMember(@PathVariable long groupId) {
public void registerMember(@PathVariable Long groupId) {
groupService.registerMember(groupId, 1L); // TODO: user -> argumentResolver 등록 필요
}

@GetMapping("/groups/{groupId}/members")
public List<GroupMemberResponse> findMembers(@PathVariable long groupId) {
public List<GroupMemberResponse> findMembers(@PathVariable Long groupId) {
return groupService.findMembers(groupId);
}

@GetMapping("/groups")
public List<GroupResponse> findRegisteredGroups(@UserAuthentication User user) {
return groupService.findRegisteredGroups(user.getId());
}
}

0 comments on commit eed48d3

Please sign in to comment.