Skip to content

Commit

Permalink
[Test] 테스트 코드 수정 param 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
AreSain committed Aug 2, 2024
1 parent edb822e commit 7c0cf8c
Show file tree
Hide file tree
Showing 9 changed files with 113 additions and 153 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
Expand Down Expand Up @@ -69,7 +70,8 @@ public ResponseEntity<AgendaKeyResDto> agendaAdd(@Login @Parameter(hidden = true
}

@GetMapping("/history")
public ResponseEntity<List<AgendaSimpleResDto>> agendaListHistory(@RequestParam @Valid PageRequestDto pageRequest) {
public ResponseEntity<List<AgendaSimpleResDto>> agendaListHistory(
@ModelAttribute @Valid PageRequestDto pageRequest) {
int page = pageRequest.getPage();
int size = pageRequest.getSize();
Pageable pageable = PageRequest.of(page - 1, size, Sort.by("startTime").descending());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
Expand Down Expand Up @@ -48,7 +49,7 @@ public ResponseEntity<Void> agendaAnnouncementAdd(@Login UserDto user, @RequestP

@GetMapping
public ResponseEntity<List<AgendaAnnouncementResDto>> agendaAnnouncementList(
@RequestParam("agenda_key") UUID agendaKey, @RequestParam @Valid PageRequestDto pageRequest) {
@RequestParam("agenda_key") UUID agendaKey, @ModelAttribute @Valid PageRequestDto pageRequest) {
Agenda agenda = agendaService.findAgendaByAgendaKey(agendaKey);
int page = pageRequest.getPage();
int size = pageRequest.getSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PatchMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
Expand Down Expand Up @@ -64,7 +65,7 @@ public ResponseEntity<Optional<MyTeamSimpleResDto>> myTeamSimpleDetails(
*/
@GetMapping
public ResponseEntity<TeamDetailsResDto> agendaTeamDetails(@Parameter(hidden = true) @Login UserDto user,
@RequestParam @Valid TeamKeyReqDto teamKeyReqDto, @RequestParam("agenda_key") UUID agendaKey) {
@RequestBody @Valid TeamKeyReqDto teamKeyReqDto, @RequestParam("agenda_key") UUID agendaKey) {
TeamDetailsResDto teamDetailsResDto = agendaTeamService.detailsAgendaTeam(user, agendaKey, teamKeyReqDto);
return ResponseEntity.ok(teamDetailsResDto);
}
Expand Down Expand Up @@ -116,7 +117,7 @@ public ResponseEntity<Void> leaveAgendaTeam(@Parameter(hidden = true) @Login Use
* @param pageRequest 페이지네이션 요청 정보, agendaId 아젠다 아이디
*/
@GetMapping("/open/list")
public ResponseEntity<List<OpenTeamResDto>> openTeamList(@RequestParam @Valid PageRequestDto pageRequest,
public ResponseEntity<List<OpenTeamResDto>> openTeamList(@ModelAttribute @Valid PageRequestDto pageRequest,
@RequestParam("agenda_key") UUID agendaKey) {
int page = pageRequest.getPage();
int size = pageRequest.getSize();
Expand All @@ -130,7 +131,7 @@ public ResponseEntity<List<OpenTeamResDto>> openTeamList(@RequestParam @Valid Pa
* @param pageRequest 페이지네이션 요청 정보, agendaId 아젠다 아이디
*/
@GetMapping("/confirm/list")
public ResponseEntity<List<ConfirmTeamResDto>> confirmTeamList(@RequestParam @Valid PageRequestDto pageRequest,
public ResponseEntity<List<ConfirmTeamResDto>> confirmTeamList(@ModelAttribute @Valid PageRequestDto pageRequest,
@RequestParam("agenda_key") UUID agendaKey) {
int page = pageRequest.getPage();
int size = pageRequest.getSize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ public void leaveTeamMate(AgendaTeam agendaTeam, UserDto user) {
.orElseThrow(() -> new NotExistException(AGENDA_PROFILE_NOT_FOUND));
AgendaTeamProfile agendaTeamProfile = agendaTeamProfileRepository
.findByAgendaAndProfileAndIsExistTrue(agendaTeam.getAgenda(), agendaProfile)
.orElseThrow(() -> new NotExistException(NOT_TEAM_MATE));
.orElseThrow(() -> new ForbiddenException(NOT_TEAM_MATE));
leaveTeam(agendaTeamProfile);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import gg.agenda.api.user.ticket.controller.response.TicketCountResDto;
Expand Down Expand Up @@ -52,7 +52,7 @@ public ResponseEntity<TicketCountResDto> ticketCountFind(@Parameter(hidden = tru

@GetMapping("/history")
public ResponseEntity<List<TicketHistoryResDto>> ticketHistoryList(@Parameter(hidden = true) @Login UserDto user,
@RequestParam @Valid PageRequestDto pageRequest) {
@ModelAttribute @Valid PageRequestDto pageRequest) {
int page = pageRequest.getPage();
int size = pageRequest.getSize();
Pageable pageable = PageRequest.of(page - 1, size, Sort.by("id").descending());
Expand Down
Loading

0 comments on commit 7c0cf8c

Please sign in to comment.