Skip to content

Commit

Permalink
refactor: createGameRoom 응답코드 변경 201 > 200
Browse files Browse the repository at this point in the history
  • Loading branch information
kimday0326 committed Feb 22, 2024
1 parent 71bb33d commit 7d65c31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,13 @@

import static com.pgms.coredomain.response.ResponseCode.*;

import java.net.URI;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PatchMapping;
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.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.servlet.support.ServletUriComponentsBuilder;

import com.pgms.api.domain.game.dto.request.GameRoomCreateRequest;
import com.pgms.api.domain.game.dto.request.GameRoomEnterRequest;
Expand Down Expand Up @@ -40,12 +37,8 @@ public class GameRoomController {
public ResponseEntity<ApiResponse<Long>> createGameRoom(
@CurrentAccount Long memberId,
@RequestBody @Valid GameRoomCreateRequest request) {
final Long roomId = gameRoomService.createRoom(memberId, request);
URI location = ServletUriComponentsBuilder.fromCurrentRequest()
.path("/{id}")
.buildAndExpand(roomId)
.toUri();
return ResponseEntity.created(location).body(ApiResponse.of(CREATE, roomId));
final Long roomId = gameRoomService.createGameRoom(memberId, request);
return ResponseEntity.ok(ApiResponse.of(CREATE, roomId));
}

@Operation(summary = "게임 방 설정 변경")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class GameRoomService {
private final Producer producer;

// ============================== 게임방 생성 ==============================
public Long createRoom(Long memberId, GameRoomCreateRequest request) {
public Long createGameRoom(Long memberId, GameRoomCreateRequest request) {
// 유저 있는지 확인
Member member = getMember(memberId);

Expand Down

0 comments on commit 7d65c31

Please sign in to comment.