Skip to content

Commit

Permalink
feat: #37 본인인증코드 발송 API 응답에 성공 여부 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
Wo-ogie committed Mar 31, 2024
1 parent ac2b97a commit 0107b32
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import com.ajou.hertz.common.auth.dto.request.LoginRequest;
import com.ajou.hertz.common.auth.dto.request.SendUserAuthCodeRequest;
import com.ajou.hertz.common.auth.dto.response.JwtTokenInfoResponse;
import com.ajou.hertz.common.auth.dto.response.SendUserAuthCodeResponse;
import com.ajou.hertz.common.auth.service.AuthService;
import com.ajou.hertz.common.auth.service.UserAuthCodeService;
import com.ajou.hertz.common.kakao.service.KakaoService;
Expand Down Expand Up @@ -77,12 +78,12 @@ public JwtTokenInfoResponse kakaoLoginV1(@RequestBody @Valid KakaoLoginRequest k
"""
)
@ApiResponses({
@ApiResponse(responseCode = "204"),
@ApiResponse(responseCode = "200"),
@ApiResponse(responseCode = "Any", description = "[1002] 인증 코드 문자 발송 과정 중 오류가 발생한 경우", content = @Content)
})
@PostMapping(value = "/codes/send", headers = API_VERSION_HEADER_NAME + "=" + 1)
public ResponseEntity<Void> sendUserAuthCodeV1(@RequestBody @Valid SendUserAuthCodeRequest sendCodeRequest) {
public SendUserAuthCodeResponse sendUserAuthCodeV1(@RequestBody @Valid SendUserAuthCodeRequest sendCodeRequest) {
userAuthCodeService.sendUserAuthCodeViaSms(sendCodeRequest.getPhoneNumber());
return ResponseEntity.noContent().build();
return new SendUserAuthCodeResponse(true);
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.ajou.hertz.common.auth.dto.response;

import lombok.AccessLevel;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;

@AllArgsConstructor
@NoArgsConstructor(access = AccessLevel.PRIVATE)
@Getter
public class SendUserAuthCodeResponse {

private Boolean isSuccess;
}
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ public AuthControllerTest(MockMvc mvc, ObjectMapper objectMapper) {
.contentType(MediaType.APPLICATION_JSON)
.content(objectMapper.writeValueAsString(sendCodeRequest))
)
.andExpect(status().isNoContent());
.andExpect(status().isOk());
then(userAuthCodeService).should().sendUserAuthCodeViaSms(phoneNumber);
verifyEveryMocksShouldHaveNoMoreInteractions();
}
Expand Down

0 comments on commit 0107b32

Please sign in to comment.