260212_01_DOC: 프로젝트 전체에 구글 java 스타일 적용
This commit is contained in:
@@ -9,40 +9,44 @@ import com.kri.contact.server.service.SystemEventLogService;
|
||||
import io.swagger.v3.oas.annotations.Operation;
|
||||
import io.swagger.v3.oas.annotations.tags.Tag;
|
||||
import jakarta.validation.Valid;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
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;
|
||||
|
||||
@RestController
|
||||
@RequestMapping("/api/v1/auth")
|
||||
@RequiredArgsConstructor
|
||||
@Tag(name = "Auth", description = "인증 API")
|
||||
public class AuthController {
|
||||
private final AuthService authService;
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
|
||||
@Operation(summary = "로그인 요청")
|
||||
@PostMapping("/login")
|
||||
public LoginResponseDto tryLogin(
|
||||
@Valid @RequestBody LoginRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
private final AuthService authService;
|
||||
private final SystemEventLogService systemEventLogService;
|
||||
|
||||
LoginResponseDto response = authService.tryLogin(request);
|
||||
systemEventLogService.writeLoginLog(response.getUser().getUserId(), now, ctx.getClientIp());
|
||||
@Operation(summary = "로그인 요청")
|
||||
@PostMapping("/login")
|
||||
public LoginResponseDto tryLogin(
|
||||
@Valid @RequestBody LoginRequestDto request,
|
||||
RequestUserContext ctx
|
||||
) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
|
||||
return response;
|
||||
}
|
||||
LoginResponseDto response = authService.tryLogin(request);
|
||||
systemEventLogService.writeLoginLog(response.getUser().getUserId(), now, ctx.getClientIp());
|
||||
|
||||
@Operation(summary = "로그아웃 요청")
|
||||
@PostMapping("/logout/{userId}")
|
||||
public boolean logout(@PathVariable String userId, RequestUserContext ctx) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
return response;
|
||||
}
|
||||
|
||||
systemEventLogService.writeLogoutLog(userId, now, ctx.getClientIp());
|
||||
@Operation(summary = "로그아웃 요청")
|
||||
@PostMapping("/logout/{userId}")
|
||||
public boolean logout(@PathVariable String userId, RequestUserContext ctx) {
|
||||
final LocalDateTime now = DateTimeUtil.nowKstLocalDateTime();
|
||||
|
||||
return true;
|
||||
}
|
||||
systemEventLogService.writeLogoutLog(userId, now, ctx.getClientIp());
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user