Skip to content

Commit

Permalink
NABI-101--refactor : 응답 클래스 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
BeommoKoo-dev committed Nov 2, 2023
1 parent bb37b9b commit 2c2c4db
Showing 1 changed file with 4 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@

import org.prgrms.nabimarketbe.domain.user.dto.UserLoginResponseDTO;
import org.prgrms.nabimarketbe.domain.user.service.SignService;
import org.prgrms.nabimarketbe.global.util.ResponseFactory;
import org.prgrms.nabimarketbe.global.util.model.MyCommonResult;
import org.prgrms.nabimarketbe.global.util.model.SingleResult;
import org.prgrms.nabimarketbe.oauth2.google.dto.GoogleUserInfoDTO;
import org.prgrms.nabimarketbe.oauth2.google.service.GoogleOAuth2Service;
import org.springframework.http.ResponseEntity;
Expand Down Expand Up @@ -39,18 +41,14 @@ public void socialLogin(
}

@GetMapping("/redirect")
public ResponseEntity<MyCommonResult<UserLoginResponseDTO>> callback(
public ResponseEntity<SingleResult<UserLoginResponseDTO>> callback(
@RequestParam(name = "code") String code
) throws JsonProcessingException {
GoogleUserInfoDTO googleUserInfoDTO = oauthService.OAuth2Login(code);

UserLoginResponseDTO loginResponseDTO = signService.signIn(googleUserInfoDTO);

MyCommonResult<UserLoginResponseDTO> response = new MyCommonResult<>(
"C001",
"성공했습니다.",
loginResponseDTO
);
SingleResult<UserLoginResponseDTO> response = ResponseFactory.getSingleResult(loginResponseDTO);

return ResponseEntity.ok(response);
}
Expand Down

0 comments on commit 2c2c4db

Please sign in to comment.