Skip to content

Commit

Permalink
feat: 메인 컨트롤러 기능 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
urinaner committed Nov 5, 2024
1 parent 17832af commit 8a53824
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions src/main/java/org/yj/sejongauth/controller/Sj.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package org.yj.sejongauth.controller;

import org.yj.sejongauth.domain.AuthService;
import org.yj.sejongauth.domain.LoginReq;
import org.yj.sejongauth.domain.ProfileRes;
import org.yj.sejongauth.domain.ProfileService;

public class Sj {

private static final AuthService authService = new AuthService();
private static final ProfileService PROFILE_SERVICE = new ProfileService();

public static ProfileRes login(LoginReq loginReq) {
if (authService.authenticate(loginReq)) {
String jsessionId = authService.getJsessionId();
return PROFILE_SERVICE.fetchUserProfile(jsessionId);
} else {
throw new RuntimeException("인증에 실패하였습니다.");
}
}
}

0 comments on commit 8a53824

Please sign in to comment.