-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8beeb9c
commit 8cd298c
Showing
1 changed file
with
25 additions
and
0 deletions.
There are no files selected for viewing
25 changes: 25 additions & 0 deletions
25
doorip-api/src/main/java/org/doorip/user/api/UserApiController.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
package org.doorip.user.api; | ||
|
||
import lombok.RequiredArgsConstructor; | ||
import org.doorip.common.ApiResponse; | ||
import org.doorip.common.ApiResponseUtil; | ||
import org.doorip.message.SuccessMessage; | ||
import org.doorip.user.dto.request.UserSignInRequest; | ||
import org.doorip.user.dto.response.UserResponse; | ||
import org.doorip.user.service.UserService; | ||
import org.springframework.http.ResponseEntity; | ||
import org.springframework.web.bind.annotation.*; | ||
|
||
@RequiredArgsConstructor | ||
@RequestMapping("/api/users") | ||
@RestController | ||
public class UserApiController { | ||
private final UserService userService; | ||
|
||
@PostMapping("/signin") | ||
public ResponseEntity<ApiResponse<?>> signIn(@RequestHeader("Authorization") final String token, | ||
@RequestParam final UserSignInRequest request) { | ||
final UserResponse response = userService.signIn(token, request); | ||
return ApiResponseUtil.success(SuccessMessage.OK, response); | ||
} | ||
} |