diff --git a/src/main/java/org/yj/sejongauth/config/AutoConfig.java b/src/main/java/org/yj/sejongauth/config/AutoConfig.java index a590227..aa09c10 100644 --- a/src/main/java/org/yj/sejongauth/config/AutoConfig.java +++ b/src/main/java/org/yj/sejongauth/config/AutoConfig.java @@ -1,9 +1,17 @@ package org.yj.sejongauth.config; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import org.yj.sejongauth.controller.Sj; +import org.yj.sejongauth.domain.AuthService; +import org.yj.sejongauth.domain.ProfileService; @Configuration @ComponentScan("org.yj.sejongauth") public class AutoConfig { -} + @Bean + public Sj sj(AuthService authService, ProfileService profileService) { + return new Sj(authService, profileService); + } +} \ No newline at end of file diff --git a/src/main/java/org/yj/sejongauth/domain/AuthService.java b/src/main/java/org/yj/sejongauth/domain/AuthService.java index 66db927..d96ebd3 100644 --- a/src/main/java/org/yj/sejongauth/domain/AuthService.java +++ b/src/main/java/org/yj/sejongauth/domain/AuthService.java @@ -9,7 +9,9 @@ import java.net.URISyntaxException; import java.util.List; import java.util.Map; +import org.springframework.stereotype.Service; +@Service public class AuthService { private String jsessionId; private final String SJ_LOGIN_URL = "https://classic.sejong.ac.kr/userLogin.do"; diff --git a/src/main/java/org/yj/sejongauth/domain/ProfileService.java b/src/main/java/org/yj/sejongauth/domain/ProfileService.java index b832ba2..8df35c9 100644 --- a/src/main/java/org/yj/sejongauth/domain/ProfileService.java +++ b/src/main/java/org/yj/sejongauth/domain/ProfileService.java @@ -7,7 +7,9 @@ import java.net.URL; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; +import org.springframework.stereotype.Service; +@Service public class ProfileService { private final String PROFILE_URL = "http://classic.sejong.ac.kr/userCertStatus.do?menuInfoId=MAIN_02_05"; private final String FAIDED_PROFILE = "정보 조회에 실패하였습니다.";