diff --git a/.gitignore b/.gitignore index 6f3f7a21..bdb6a806 100644 --- a/.gitignore +++ b/.gitignore @@ -39,4 +39,5 @@ out/ ### API docs ### **/src/main/resources/static/docs/* -**/ku-stack-firebase-adminsdk-87nwq-5ba04dfc12.json \ No newline at end of file +**/ku-stack-firebase-adminsdk-87nwq-ae6a2df931.json +**/src/main/generated/ \ No newline at end of file diff --git a/build.gradle b/build.gradle index eafaebd3..2f8f0014 100644 --- a/build.gradle +++ b/build.gradle @@ -128,7 +128,7 @@ configurations.all { } } -test.onlyIf { System.getenv('DEPLOY_ENV') == 'dev' } +//test.onlyIf { System.getenv('DEPLOY_ENV') == 'dev' } test { jacoco { diff --git a/src/main/java/com/kustacks/kuring/common/utils/converter/EmailSupporter.java b/src/main/java/com/kustacks/kuring/common/utils/converter/EmailSupporter.java new file mode 100644 index 00000000..7949a1b2 --- /dev/null +++ b/src/main/java/com/kustacks/kuring/common/utils/converter/EmailSupporter.java @@ -0,0 +1,68 @@ +package com.kustacks.kuring.common.utils.converter; + +import java.util.Arrays; +import java.util.regex.Pattern; + +public class EmailSupporter { + private static final Pattern AT_PATTERN = Pattern.compile("\\s+at\\s+"); + private static final Pattern DOT_PATTERN = Pattern.compile("\\s+dot\\s+"); + private static final Pattern EMAIL_PATTERN = Pattern.compile("^[a-zA-Z0-9_!#$%&'\\*+/=?{|}~^.-]+@[a-zA-Z0-9.-]+$"); + + private static final String KONKUK_DOMAIN = "@konkuk.ac.kr"; + private static final String EMPTY_EMAIL = ""; + + public static boolean isNullOrBlank(String email) { + return email == null || email.isBlank(); + } + + public static String convertValidEmail(String email) { + if (isNullOrBlank(email)) { + return EMPTY_EMAIL; + } + + String[] emailGroups = splitEmails(email); + String[] normalizedEmails = normalizeEmails(emailGroups); + + //여러 이메일 중 konkuk을 우선 선택, 없으면 첫번째 내용 + return selectPreferredEmail(normalizedEmails); + } + + private static String[] splitEmails(String email) { + return email.split("[/,]"); + } + + private static String[] normalizeEmails(String[] emailGroups) { + return Arrays.stream(emailGroups) + .map(EmailSupporter::normalizeEmail) + .toArray(String[]::new); + } + + private static String normalizeEmail(String email) { + if (EMAIL_PATTERN.matcher(email).matches()) { + return email; + } + + if (containsSubstitutePatterns(email)) { + return replaceSubstitutePatterns(email); + } + + return EMPTY_EMAIL; + } + + private static String replaceSubstitutePatterns(String email) { + return email.replaceAll(DOT_PATTERN.pattern(), ".") + .replaceAll(AT_PATTERN.pattern(), "@"); + } + + private static boolean containsSubstitutePatterns(String email) { + return DOT_PATTERN.matcher(email).find() && AT_PATTERN.matcher(email).find(); + } + + // Konkuk 도메인 우선 선택 + private static String selectPreferredEmail(String[] emails) { + return Arrays.stream(emails) + .filter(email -> email.endsWith(KONKUK_DOMAIN)) + .findFirst() + .orElseGet(() -> emails.length > 0 ? emails[0] : EMPTY_EMAIL); + } +} diff --git a/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporter.java b/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporter.java new file mode 100644 index 00000000..f5339b0a --- /dev/null +++ b/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporter.java @@ -0,0 +1,42 @@ +package com.kustacks.kuring.common.utils.converter; + +import java.util.regex.Pattern; + +public class PhoneNumberSupporter { + + private static final Pattern LAST_FOUR_NUMBER_PATTERN = Pattern.compile("\\d{4}"); + private static final Pattern FULL_NUMBER_PATTERN = Pattern.compile("02-\\d{3,4}-\\d{4}"); + private static final Pattern FULL_NUMBER_WITH_PARENTHESES_PATTERN = Pattern.compile("02[)]\\d{3,4}-\\d{4}"); + + private static final String EMPTY_PHONE = ""; + + public static boolean isNullOrBlank(String number) { + return number == null || number.isBlank(); + } + + public static String convertFullExtensionNumber(String number) { + if (isNullOrBlank(number)) { + return EMPTY_PHONE; + } + + if (FULL_NUMBER_PATTERN.matcher(number).matches()) { + return number; + } + if (containsLastFourNumber(number)) { + return "02-450-" + number; + } + if (containsParenthesesPattern(number)) { + return number.replace(")", "-"); + } + + return EMPTY_PHONE; + } + + private static boolean containsLastFourNumber(String number) { + return LAST_FOUR_NUMBER_PATTERN.matcher(number).matches(); + } + + private static boolean containsParenthesesPattern(String number) { + return FULL_NUMBER_WITH_PARENTHESES_PATTERN.matcher(number).matches(); + } +} diff --git a/src/main/java/com/kustacks/kuring/staff/adapter/out/persistence/StaffRepository.java b/src/main/java/com/kustacks/kuring/staff/adapter/out/persistence/StaffRepository.java index e0b8f494..9ec06382 100644 --- a/src/main/java/com/kustacks/kuring/staff/adapter/out/persistence/StaffRepository.java +++ b/src/main/java/com/kustacks/kuring/staff/adapter/out/persistence/StaffRepository.java @@ -3,9 +3,6 @@ import com.kustacks.kuring.staff.domain.Staff; import org.springframework.data.jpa.repository.JpaRepository; -import java.util.List; - public interface StaffRepository extends JpaRepository, StaffQueryRepository { - List findByDeptContaining(String deptName); } diff --git a/src/main/java/com/kustacks/kuring/staff/domain/Email.java b/src/main/java/com/kustacks/kuring/staff/domain/Email.java index d17eae63..2c8fcb8d 100644 --- a/src/main/java/com/kustacks/kuring/staff/domain/Email.java +++ b/src/main/java/com/kustacks/kuring/staff/domain/Email.java @@ -30,7 +30,8 @@ public Email(String email) { } private boolean isValidEmail(String email) { - return !Objects.isNull(email) && patternMatches(email); + return Objects.nonNull(email) && + (patternMatches(email) || Objects.equals(email,"")); } private boolean patternMatches(String email) { diff --git a/src/main/java/com/kustacks/kuring/staff/domain/Phone.java b/src/main/java/com/kustacks/kuring/staff/domain/Phone.java index b283fd93..8439e930 100644 --- a/src/main/java/com/kustacks/kuring/staff/domain/Phone.java +++ b/src/main/java/com/kustacks/kuring/staff/domain/Phone.java @@ -22,13 +22,14 @@ public class Phone { = Pattern.compile("(\\d{3,4})[-\\s]*(\\d{4})"); private static final String SEOUL_AREA_CODE = "02"; private static final String DELIMITER = "-"; + private static final String EMPTY_NUMBER = ""; @Column(name = "phone", length = 64) private String value; public Phone(String phone) { if(isEmptyNumbers(phone)) { - this.value = DELIMITER; + this.value = EMPTY_NUMBER; return; } @@ -71,7 +72,7 @@ private boolean isValidNumbersAndSet(String phone) { } private static boolean isEmptyNumbers(String phone) { - return phone == null || phone.isBlank() || phone.equals(DELIMITER); + return phone == null || phone.isBlank(); } public boolean isSameValue(String phone) { diff --git a/src/main/java/com/kustacks/kuring/staff/domain/Staff.java b/src/main/java/com/kustacks/kuring/staff/domain/Staff.java index 36c4c525..8fe7b925 100644 --- a/src/main/java/com/kustacks/kuring/staff/domain/Staff.java +++ b/src/main/java/com/kustacks/kuring/staff/domain/Staff.java @@ -29,6 +29,10 @@ public class Staff { @Column(name = "lab", length = 64) private String lab; + @Getter(AccessLevel.PUBLIC) + @Column(name = "position", length = 64) + private String position; + @Embedded private Phone phone; @@ -45,7 +49,7 @@ public class Staff { private College college; @Builder - private Staff(String name, String major, String lab, String phone, String email, String dept, String college) { + private Staff(String name, String major, String lab, String phone, String email, String dept, String college, String position) { this.name = new Name(name); this.major = major; this.lab = lab; @@ -53,9 +57,10 @@ private Staff(String name, String major, String lab, String phone, String email, this.email = new Email(email); this.dept = dept; this.college = College.valueOf(college); + this.position = position; } - public void updateInformation(String name, String major, String lab, String phone, String email, String deptName, String college) { + public void updateInformation(String name, String major, String lab, String phone, String email, String deptName, String college, String position) { this.name = new Name(name); this.major = major; this.lab = lab; @@ -63,6 +68,7 @@ public void updateInformation(String name, String major, String lab, String phon this.email = new Email(email); this.dept = deptName; this.college = College.valueOf(college); + this.position = position; } public String getEmail() { @@ -105,6 +111,14 @@ public boolean isSameCollege(String collegeName) { return this.college == College.valueOf(collegeName); } + public boolean isSamePosition(String position) { + return this.position.equals(position); + } + + public String identifier() { + return String.join(",", getName(), position, dept); + } + @Override public boolean equals(Object o) { if (this == o) return true; diff --git a/src/main/java/com/kustacks/kuring/worker/parser/staff/EachDeptStaffHtmlParser.java b/src/main/java/com/kustacks/kuring/worker/parser/staff/EachDeptStaffHtmlParser.java index 2afb82ba..52816047 100644 --- a/src/main/java/com/kustacks/kuring/worker/parser/staff/EachDeptStaffHtmlParser.java +++ b/src/main/java/com/kustacks/kuring/worker/parser/staff/EachDeptStaffHtmlParser.java @@ -1,8 +1,6 @@ package com.kustacks.kuring.worker.parser.staff; import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.CommunicationDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.LivingDesignDept; import com.kustacks.kuring.worker.scrap.deptinfo.real_estate.RealEstateDept; import lombok.NoArgsConstructor; import lombok.extern.slf4j.Slf4j; @@ -18,33 +16,22 @@ public class EachDeptStaffHtmlParser extends StaffHtmlParserTemplate { @Override public boolean support(DeptInfo deptInfo) { - return !(deptInfo instanceof RealEstateDept) && - !(deptInfo instanceof LivingDesignDept) && - !(deptInfo instanceof CommunicationDesignDept); + return !(deptInfo instanceof RealEstateDept); } protected Elements selectStaffInfoRows(Document document) { - Element table = document.select(".photo_intro").get(0); - return table.getElementsByTag("dl"); + return document.select(".row"); } protected String[] extractStaffInfoFromRow(Element row) { - Elements infos = row.getElementsByTag("dd"); - - // 교수명, 직위, 세부전공, 연구실, 연락처, 이메일 순으로 파싱 - // 연구실, 연락처 정보는 없는 경우가 종종 있으므로, childNode접근 전 인덱스 체크하는 로직을 넣었음 - String name = infos.get(0).getElementsByTag("span").get(1).text(); - - String jobPosition = String.valueOf(infos.get(1).childNodeSize() < 2 ? "" : infos.get(1).childNode(1)); - if (jobPosition.contains("명예") || jobPosition.contains("대우") || jobPosition.contains("휴직") || !jobPosition.contains("교수")) { - log.info("스크래핑 스킵 -> {} 교수", name); - return new String[]{}; - } - - String major = infos.get(2).childNodeSize() < 2 ? "" : String.valueOf(infos.get(2).childNode(1)); - String lab = infos.get(3).childNodeSize() < 2 ? "" : String.valueOf(infos.get(3).childNode(1)); - String phone = infos.get(4).childNodeSize() < 2 ? "" : String.valueOf(infos.get(4).childNode(1)); - String email = infos.get(5).getElementsByTag("a").get(0).text(); - return new String[]{name, major, lab, phone, email}; + String name = row.select(".info .title .name").text(); + + Elements detailElement = row.select(".detail"); + String jobPosition = detailElement.select(".ico1 dd").text().trim(); + String major = detailElement.select(".ico2 dd").text().trim(); + String lab = detailElement.select(".ico3 dd").text().trim(); + String extensionNumber = detailElement.select(".ico4 dd").text().trim(); + String email = detailElement.select(".ico5 dd").text().trim(); + return new String[]{name, jobPosition, major, lab, extensionNumber, email}; } } diff --git a/src/main/java/com/kustacks/kuring/worker/parser/staff/LivingAndCommunicationDesignStaffHtmlParser.java b/src/main/java/com/kustacks/kuring/worker/parser/staff/LivingAndCommunicationDesignStaffHtmlParser.java deleted file mode 100644 index 7dde7ef1..00000000 --- a/src/main/java/com/kustacks/kuring/worker/parser/staff/LivingAndCommunicationDesignStaffHtmlParser.java +++ /dev/null @@ -1,37 +0,0 @@ -package com.kustacks.kuring.worker.parser.staff; - -import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.CommunicationDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.LivingDesignDept; -import lombok.NoArgsConstructor; -import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; -import org.jsoup.select.Elements; -import org.springframework.stereotype.Component; - -@Component -@NoArgsConstructor -public class LivingAndCommunicationDesignStaffHtmlParser extends StaffHtmlParserTemplate { - - @Override - public boolean support(DeptInfo deptInfo) { - return deptInfo instanceof LivingDesignDept || deptInfo instanceof CommunicationDesignDept; - } - - protected Elements selectStaffInfoRows(Document document) { - Elements table = document.select("div.contents_area table"); - return table.select("tbody tr"); - } - - protected String[] extractStaffInfoFromRow(Element row) { - Elements tds = row.getElementsByTag("td"); - - String name = tds.get(0).getElementsByTag("a").get(0).text().trim(); - String major = tds.get(1).text().trim(); - String lab = tds.get(2).text().trim(); - String phone = tds.get(3).text().trim(); - String email = tds.get(4).text().trim(); - - return new String[]{name, major, lab, phone, email}; - } -} diff --git a/src/main/java/com/kustacks/kuring/worker/parser/staff/RealEstateStaffHtmlParser.java b/src/main/java/com/kustacks/kuring/worker/parser/staff/RealEstateStaffHtmlParser.java index 79215b42..44e82928 100644 --- a/src/main/java/com/kustacks/kuring/worker/parser/staff/RealEstateStaffHtmlParser.java +++ b/src/main/java/com/kustacks/kuring/worker/parser/staff/RealEstateStaffHtmlParser.java @@ -14,23 +14,20 @@ public class RealEstateStaffHtmlParser extends StaffHtmlParserTemplate { public boolean support(DeptInfo deptInfo) { return deptInfo instanceof RealEstateDept; } - protected Elements selectStaffInfoRows(Document document) { - Element table = document.select(".sub0201_list").get(0).getElementsByTag("ul").get(0); - return table.getElementsByTag("li"); + return document.select(".row"); } protected String[] extractStaffInfoFromRow(Element row) { - Element content = row.select(".con").get(0); - - String name = content.select("dl > dt > a > strong").get(0).text(); - String major = String.valueOf(content.select("dl > dd").get(0).childNode(4)).replaceFirst("\\s", "").trim(); - - Element textMore = content.select(".text_more").get(0); - - String lab = String.valueOf(textMore.childNode(4)).split(":")[1].replaceFirst("\\s", "").trim(); - String phone = String.valueOf(textMore.childNode(6)).split(":")[1].replaceFirst("\\s", "").trim(); - String email = textMore.getElementsByTag("a").get(0).text(); - return new String[]{name, major, lab, phone, email}; + String name = row.select(".info .title .name").text(); + + Elements detalTagElement = row.select(".detail"); + String jobPosition = detalTagElement.select("dt:contains(직위) + dd").text(); + String major = detalTagElement.select("dt:contains(연구분야) + dd").text().trim(); + String lab = detalTagElement.select("dt:contains(연구실) + dd").text().trim(); + String extensionNumber = detalTagElement.select("dt:contains(연락처) + dd").text().trim(); + String email = detalTagElement.select("dt:contains(이메일) + dd").text().trim(); + return new String[]{name, jobPosition, major, lab, extensionNumber, email}; } } + diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java index fad95a6e..58df39d9 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -60,10 +60,11 @@ private static List convertStaffDtos(DeptInfo deptInfo, List return parseResult.stream() .map(oneStaffInfo -> StaffDto.builder() .name(oneStaffInfo[0]) - .major(oneStaffInfo[1]) - .lab(oneStaffInfo[2]) - .phone(oneStaffInfo[3]) - .email(oneStaffInfo[4]) + .position(oneStaffInfo[1]) + .major(oneStaffInfo[2]) + .lab(oneStaffInfo[3]) + .phone(oneStaffInfo[4]) + .email(oneStaffInfo[5]) .deptName(deptInfo.getDeptName()) .collegeName(deptInfo.getCollegeName() ).build() diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/EachDeptStaffApiClient.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/EachDeptStaffApiClient.java index 3231f921..ad90af52 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/EachDeptStaffApiClient.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/EachDeptStaffApiClient.java @@ -4,20 +4,13 @@ import com.kustacks.kuring.common.exception.code.ErrorCode; import com.kustacks.kuring.worker.scrap.client.NormalJsoupClient; import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.CommunicationDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.LivingDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.real_estate.RealEstateDept; import org.jsoup.nodes.Document; -import org.jsoup.nodes.Element; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; -import org.springframework.web.util.UriComponentsBuilder; import java.io.IOException; -import java.util.HashMap; import java.util.LinkedList; import java.util.List; -import java.util.Map; @Component public class EachDeptStaffApiClient implements StaffApiClient { @@ -32,49 +25,32 @@ public EachDeptStaffApiClient(NormalJsoupClient normalJsoupClient) { this.jsoupClient = normalJsoupClient; } + /* + 만약, 학과별로 다른 API Client를 구성해야 한다면 support 구현 필요. + 현재는 교직원 스크랩을 위한 모든 API 클래이언트 스펙 동일, 파싱에서 분리 + [2024.11.28 김한주] + */ @Override public boolean support(DeptInfo deptInfo) { - return !(deptInfo instanceof RealEstateDept) && - !(deptInfo instanceof LivingDesignDept) && - !(deptInfo instanceof CommunicationDesignDept); + return true; } @Override public List getHTML(DeptInfo deptInfo) throws InternalLogicException { - return deptInfo.getProfessorForumIds().stream() - .flatMap(professorForumId -> getProfessorHtmlById(professorForumId).stream()) + return deptInfo.getStaffSiteIds().stream() + .flatMap(siteId -> getProfessorHtmlByDeptAndSiteId(deptInfo.getStaffSiteName(), siteId).stream()) .toList(); } - private List getProfessorHtmlById(String professorForumId) { + private List getProfessorHtmlByDeptAndSiteId(String siteName, int siteId) { LinkedList documents = new LinkedList<>(); - String url = buildProfessorInfoUrl(professorForumId); + String url = buildDeptStaffPageUrl(siteName, siteId); Document document = getDocument(url); documents.add(document); - - int totalPageNum = getTotalPageNumber(document); - for (int pageNumber = 2; pageNumber <= totalPageNum; pageNumber++) { - documents.add(parseDocumentByPageNumber(url, pageNumber)); - } - return documents; } - private Document parseDocumentByPageNumber(String url, int pageNumber) { - try { - Map requestBody = new HashMap<>(); - requestBody.put("pageNum", String.valueOf(pageNumber)); - return jsoupClient.post(url, STAFF_SCRAP_TIMEOUT, requestBody); - } catch (IOException e) { - throw new InternalLogicException(ErrorCode.STAFF_SCRAPER_CANNOT_SCRAP, e); - } - } - - private static int getTotalPageNumber(Document document) { - Element pageNumHiddenInput = document.getElementById("totalPageCount"); - return Integer.parseInt(pageNumHiddenInput.val()); - } private Document getDocument(String url) { try { @@ -84,7 +60,8 @@ private Document getDocument(String url) { } } - private String buildProfessorInfoUrl(String pfForumId) { - return UriComponentsBuilder.fromUriString(baseUrl).queryParam("pfForumId", pfForumId).toUriString(); + private String buildDeptStaffPageUrl(String department, int siteId) { + return baseUrl.replace("{department}", department) + .replace("{siteId}", String.valueOf(siteId)); } } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/LivingAndCommunicationDesignStaffApiClient.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/LivingAndCommunicationDesignStaffApiClient.java deleted file mode 100644 index d7c4fe91..00000000 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/LivingAndCommunicationDesignStaffApiClient.java +++ /dev/null @@ -1,61 +0,0 @@ -package com.kustacks.kuring.worker.scrap.client.staff; - -import com.kustacks.kuring.common.exception.InternalLogicException; -import com.kustacks.kuring.common.exception.code.ErrorCode; -import com.kustacks.kuring.notice.domain.DepartmentName; -import com.kustacks.kuring.worker.scrap.client.NormalJsoupClient; -import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.CommunicationDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.LivingDesignDept; -import org.jsoup.nodes.Document; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.web.util.UriComponentsBuilder; - -import java.io.IOException; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -@Component -public class LivingAndCommunicationDesignStaffApiClient implements StaffApiClient { - - private static final int STAFF_SCRAP_TIMEOUT = 30000; - private final Map urlMap; - private final NormalJsoupClient jsoupClient; - - public LivingAndCommunicationDesignStaffApiClient( - @Value("${staff.living-design-url}") String livingDesignUrl, - @Value("${staff.communication-design-url}") String communicationDesignUrl, - NormalJsoupClient normalJsoupClient) - { - this.urlMap = new HashMap<>(); - this.urlMap.put(DepartmentName.COMM_DESIGN.getKorName(), communicationDesignUrl); - this.urlMap.put(DepartmentName.LIVING_DESIGN.getKorName(), livingDesignUrl); - this.jsoupClient = normalJsoupClient; - } - - @Override - public boolean support(DeptInfo deptInfo) { - return deptInfo instanceof LivingDesignDept || deptInfo instanceof CommunicationDesignDept; - } - - @Override - public List getHTML(DeptInfo deptInfo) throws InternalLogicException { - String url = buildProfessorInfoUrl(deptInfo.getDeptName()); - Document document = getDocumentByUrl(url); - return List.of(document); - } - - private Document getDocumentByUrl(String url) { - try { - return jsoupClient.get(url, STAFF_SCRAP_TIMEOUT); - } catch(IOException e) { - throw new InternalLogicException(ErrorCode.STAFF_SCRAPER_CANNOT_SCRAP, e); - } - } - - private String buildProfessorInfoUrl(String deptName) { - return UriComponentsBuilder.fromUriString(urlMap.get(deptName)).toUriString(); - } -} diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/RealEstateStaffApiClient.java b/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/RealEstateStaffApiClient.java deleted file mode 100644 index 7264399a..00000000 --- a/src/main/java/com/kustacks/kuring/worker/scrap/client/staff/RealEstateStaffApiClient.java +++ /dev/null @@ -1,52 +0,0 @@ -package com.kustacks.kuring.worker.scrap.client.staff; - -import com.kustacks.kuring.common.exception.InternalLogicException; -import com.kustacks.kuring.common.exception.code.ErrorCode; -import com.kustacks.kuring.worker.scrap.client.ProxyJsoupClient; -import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; -import com.kustacks.kuring.worker.scrap.deptinfo.real_estate.RealEstateDept; -import org.jsoup.nodes.Document; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.stereotype.Component; -import org.springframework.web.util.UriComponentsBuilder; - -import java.io.IOException; -import java.util.List; - -@Component -public class RealEstateStaffApiClient implements StaffApiClient { - - private static final int STAFF_SCRAP_TIMEOUT = 300000; - private final ProxyJsoupClient jsoupClient; - - @Value("${staff.real-estate-url}") - private String baseUrl; - - public RealEstateStaffApiClient(ProxyJsoupClient proxyJsoupClient) { - this.jsoupClient = proxyJsoupClient; - } - - @Override - public boolean support(DeptInfo deptInfo) { - return deptInfo instanceof RealEstateDept; - } - - @Override - public List getHTML(DeptInfo deptInfo) throws InternalLogicException { - String url = buildProfessorInfoUrl(); - Document document = getDocumentByUrl(url); - return List.of(document); - } - - private Document getDocumentByUrl(String url) { - try { - return jsoupClient.get(url, STAFF_SCRAP_TIMEOUT); - } catch(IOException e) { - throw new InternalLogicException(ErrorCode.STAFF_SCRAPER_CANNOT_SCRAP, e); - } - } - - private String buildProfessorInfoUrl() { - return UriComponentsBuilder.fromUriString(baseUrl).toUriString(); - } -} diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/DeptInfo.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/DeptInfo.java index 726ede9d..4cda32b4 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/DeptInfo.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/DeptInfo.java @@ -43,8 +43,12 @@ public boolean isSameDepartment(DepartmentName departmentName) { return this.departmentName.equals(departmentName); } - public List getProfessorForumIds() { - return this.staffScrapInfo.getProfessorForumId(); + public List getStaffSiteIds() { + return this.staffScrapInfo.getSiteIds(); + } + + public String getStaffSiteName() { + return this.staffScrapInfo.getSiteName(); } public String createRequestUrl(int page, int row) { @@ -65,6 +69,10 @@ public String createViewUrl() { .replace("{siteId}", String.valueOf(noticeScrapInfo.getSiteId())); } + public boolean isSupportStaffScrap() { + return !this.staffScrapInfo.getSiteIds().isEmpty(); + } + @Override public String toString() { return departmentName.getName(); diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/StaffScrapInfo.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/StaffScrapInfo.java index 734c3de4..4de4aa47 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/StaffScrapInfo.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/StaffScrapInfo.java @@ -7,9 +7,11 @@ @Getter public class StaffScrapInfo extends ScrapInfo { - private final List professorForumId; + private final String siteName; + private final List siteIds; - public StaffScrapInfo(List professorForumId) { - this.professorForumId = professorForumId; + public StaffScrapInfo(String siteName, List siteIds) { + this.siteName = siteName; + this.siteIds = siteIds; } } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/architecture/ArchitectureDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/architecture/ArchitectureDept.java index 0b3d74c9..436cfc35 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/architecture/ArchitectureDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/architecture/ArchitectureDept.java @@ -24,8 +24,8 @@ public ArchitectureDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9815"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9824); + this.staffScrapInfo = new StaffScrapInfo(ARCHITECTURE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ARCHITECTURE.getHostPrefix(), 397); this.departmentName = ARCHITECTURE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ApparelDesignDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ApparelDesignDept.java index ab328d2c..b77f7f02 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ApparelDesignDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ApparelDesignDept.java @@ -24,8 +24,8 @@ public ApparelDesignDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11194"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11194); + this.staffScrapInfo = new StaffScrapInfo(APPAREL_DESIGN.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(APPAREL_DESIGN.getHostPrefix(), 956); this.departmentName = APPAREL_DESIGN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/CommunicationDesignDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/CommunicationDesignDept.java index 00b9859a..df5c3176 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/CommunicationDesignDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/CommunicationDesignDept.java @@ -25,8 +25,8 @@ public CommunicationDesignDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = Collections.emptyList(); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11166); + this.staffScrapInfo = new StaffScrapInfo(COMM_DESIGN.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(COMM_DESIGN.getHostPrefix(), 0); this.departmentName = COMM_DESIGN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ContemporaryArtDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ContemporaryArtDept.java index 2b95eba1..6a5a3736 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ContemporaryArtDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/ContemporaryArtDept.java @@ -24,8 +24,8 @@ public ContemporaryArtDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11236"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11250); + this.staffScrapInfo = new StaffScrapInfo(CONT_ART.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CONT_ART.getHostPrefix(), 489); this.departmentName = CONT_ART; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/IndustrialDesignDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/IndustrialDesignDept.java index 029528f3..09b891ff 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/IndustrialDesignDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/IndustrialDesignDept.java @@ -24,8 +24,8 @@ public IndustrialDesignDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("17316"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(17316); + this.staffScrapInfo = new StaffScrapInfo(IND_DESIGN.getHostPrefix(),siteIds); this.noticeScrapInfo = new NoticeScrapInfo(IND_DESIGN.getHostPrefix(), 4017); this.departmentName = IND_DESIGN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/LivingDesignDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/LivingDesignDept.java index 1f06bc9f..3ce395c8 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/LivingDesignDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/LivingDesignDept.java @@ -25,8 +25,8 @@ public LivingDesignDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11209"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11223); + this.staffScrapInfo = new StaffScrapInfo(LIVING_DESIGN.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(LIVING_DESIGN.getHostPrefix(), 962); this.departmentName = LIVING_DESIGN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/MovingImageFilmDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/MovingImageFilmDept.java index 53824a56..0d4f7e99 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/MovingImageFilmDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/art_design/MovingImageFilmDept.java @@ -24,8 +24,8 @@ public MovingImageFilmDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11263"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11276); + this.staffScrapInfo = new StaffScrapInfo(MOV_IMAGE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(MOV_IMAGE.getHostPrefix(), 491); this.departmentName = MOV_IMAGE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/BusinessAdministrationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/BusinessAdministrationDept.java index 70e1a6b1..4c46b09b 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/BusinessAdministrationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/BusinessAdministrationDept.java @@ -24,8 +24,8 @@ public BusinessAdministrationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10499"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10513); + this.staffScrapInfo = new StaffScrapInfo(BUIS_ADMIN.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo("kbs", 437); this.departmentName = BUIS_ADMIN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/TechnologicalBusinessDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/TechnologicalBusinessDept.java index b0fbf253..fd40a1aa 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/TechnologicalBusinessDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/business/TechnologicalBusinessDept.java @@ -24,8 +24,8 @@ public TechnologicalBusinessDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10526"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10540); + this.staffScrapInfo = new StaffScrapInfo(TECH_BUSI.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(TECH_BUSI.getHostPrefix(), 445); this.departmentName = TECH_BUSI; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationDept.java index 21534178..65a77e18 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationDept.java @@ -24,8 +24,8 @@ public EducationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11444"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11444); + this.staffScrapInfo = new StaffScrapInfo(EDUCATION.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(EDUCATION.getHostPrefix(), 507); this.departmentName = EDUCATION; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationalTechnologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationalTechnologyDept.java index a477eef0..0d815d0c 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationalTechnologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EducationalTechnologyDept.java @@ -24,8 +24,8 @@ public EducationalTechnologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("16532"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(16532); + this.staffScrapInfo = new StaffScrapInfo(EDU_TECH.getHostPrefix(),siteIds); this.noticeScrapInfo = new NoticeScrapInfo(EDU_TECH.getHostPrefix(), 4020); this.departmentName = EDU_TECH; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EnglishEducationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EnglishEducationDept.java index 0eac3f2b..6fb6ed25 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EnglishEducationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/EnglishEducationDept.java @@ -24,8 +24,8 @@ public EnglishEducationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11411"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11425); + this.staffScrapInfo = new StaffScrapInfo(ENGLISH_EDU.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ENGLISH_EDU.getHostPrefix(), 505); this.departmentName = ENGLISH_EDU; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/JapaneseLanguageDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/JapaneseLanguageDept.java index 16b612ad..0b60c7bc 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/JapaneseLanguageDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/JapaneseLanguageDept.java @@ -24,8 +24,8 @@ public JapaneseLanguageDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11307"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11318); + this.staffScrapInfo = new StaffScrapInfo(JAPANESE_EDU.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(JAPANESE_EDU.getHostPrefix(), 497); this.departmentName = JAPANESE_EDU; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MathematicsEducationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MathematicsEducationDept.java index 4aa0f8c1..fc15d67c 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MathematicsEducationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MathematicsEducationDept.java @@ -24,8 +24,8 @@ public MathematicsEducationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11335"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11345); + this.staffScrapInfo = new StaffScrapInfo(MATH_EDU.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(MATH_EDU.getHostPrefix(), 499); this.departmentName = MATH_EDU; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MusicEducationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MusicEducationDept.java index 9e36d11c..4674a0ab 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MusicEducationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/MusicEducationDept.java @@ -24,8 +24,8 @@ public MusicEducationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11383"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11399); + this.staffScrapInfo = new StaffScrapInfo(MUSIC_EDU.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(MUSIC_EDU.getHostPrefix(), 503); this.departmentName = MUSIC_EDU; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/PhysicalEducationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/PhysicalEducationDept.java index 0c4b7bd9..0ec932ea 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/PhysicalEducationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/education/PhysicalEducationDept.java @@ -24,8 +24,8 @@ public PhysicalEducationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11357"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11371); + this.staffScrapInfo = new StaffScrapInfo(PHY_EDU.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(PHY_EDU.getHostPrefix(), 501); this.departmentName = PHY_EDU; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/AdvancedIndustrialFusionDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/AdvancedIndustrialFusionDept.java index c83ce4c6..12fab749 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/AdvancedIndustrialFusionDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/AdvancedIndustrialFusionDept.java @@ -24,8 +24,8 @@ public AdvancedIndustrialFusionDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10085"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10085); + this.staffScrapInfo = new StaffScrapInfo(ADV_INDUSTRIAL.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ADV_INDUSTRIAL.getHostPrefix(), 415); this.departmentName = ADV_INDUSTRIAL; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/BiologicalDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/BiologicalDept.java index dc3a4f32..16c6adcd 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/BiologicalDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/BiologicalDept.java @@ -24,8 +24,8 @@ public BiologicalDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10097"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10097); + this.staffScrapInfo = new StaffScrapInfo(BIOLOGICAL.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(BIOLOGICAL.getHostPrefix(), 790); this.departmentName = BIOLOGICAL; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ChemicalDivisionDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ChemicalDivisionDept.java index 37cc1a50..46f4f7b9 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ChemicalDivisionDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ChemicalDivisionDept.java @@ -24,8 +24,8 @@ public ChemicalDivisionDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9926"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9926); + this.staffScrapInfo = new StaffScrapInfo(CHEMI_DIV.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CHEMI_DIV.getHostPrefix(), 409); this.departmentName = CHEMI_DIV; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/CivilEnvironmentDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/CivilEnvironmentDept.java index 1cb8add5..a524a34f 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/CivilEnvironmentDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/CivilEnvironmentDept.java @@ -24,8 +24,8 @@ public CivilEnvironmentDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10022"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10022); + this.staffScrapInfo = new StaffScrapInfo(CIVIL_ENV.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CIVIL_ENV.getHostPrefix(), 401); this.departmentName = CIVIL_ENV; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ComputerScienceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ComputerScienceDept.java index 11ae756e..e798c8d1 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ComputerScienceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ComputerScienceDept.java @@ -24,8 +24,8 @@ public ComputerScienceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9938"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9960); + this.staffScrapInfo = new StaffScrapInfo(COMPUTER.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(COMPUTER.getHostPrefix(), 775); this.departmentName = COMPUTER; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ElectricalElectronicsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ElectricalElectronicsDept.java index a1fa8412..c6a493c1 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ElectricalElectronicsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/ElectricalElectronicsDept.java @@ -24,8 +24,8 @@ public ElectricalElectronicsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10962"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10974); + this.staffScrapInfo = new StaffScrapInfo(ELEC_ELEC.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ELEC_ELEC.getHostPrefix(), 407); this.departmentName = ELEC_ELEC; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/IndustrialDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/IndustrialDept.java index af9129e9..7572054c 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/IndustrialDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/IndustrialDept.java @@ -24,8 +24,8 @@ public IndustrialDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9972"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9988); + this.staffScrapInfo = new StaffScrapInfo(INDUSTRIAL.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(INDUSTRIAL.getHostPrefix(), 413); this.departmentName = INDUSTRIAL; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/KBeautyIndustryFusionDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/KBeautyIndustryFusionDept.java index 047ff6ae..9386e89b 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/KBeautyIndustryFusionDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/KBeautyIndustryFusionDept.java @@ -24,8 +24,8 @@ public KBeautyIndustryFusionDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10127"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10142); + this.staffScrapInfo = new StaffScrapInfo(KBEAUTY.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(KBEAUTY.getHostPrefix(), 419); this.departmentName = KBEAUTY; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/MechanicalAerospaceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/MechanicalAerospaceDept.java index 9e93cf84..199425a8 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/MechanicalAerospaceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/engineering/MechanicalAerospaceDept.java @@ -24,8 +24,8 @@ public MechanicalAerospaceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("20565480"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9904); + this.staffScrapInfo = new StaffScrapInfo(MECH_AERO.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(MECH_AERO.getHostPrefix(), 405); this.departmentName = MECH_AERO; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/BioMedicalScienceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/BioMedicalScienceDept.java index b70ea832..35144b16 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/BioMedicalScienceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/BioMedicalScienceDept.java @@ -24,8 +24,8 @@ public BioMedicalScienceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10770"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10784); + this.staffScrapInfo = new StaffScrapInfo(BIO_MEDICAL.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(BIO_MEDICAL.getHostPrefix(), 880); this.departmentName = BIO_MEDICAL; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/CosmeticsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/CosmeticsDept.java index 2529f12d..ca9c7a95 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/CosmeticsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/CosmeticsDept.java @@ -24,8 +24,8 @@ public CosmeticsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("15930"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(15931); + this.staffScrapInfo = new StaffScrapInfo(COSMETICS.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(COSMETICS.getHostPrefix(), 457); this.departmentName = COSMETICS; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/EnergyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/EnergyDept.java index 7a7e127d..4e816ae7 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/EnergyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/EnergyDept.java @@ -24,8 +24,8 @@ public EnergyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10614"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10628); + this.staffScrapInfo = new StaffScrapInfo(ENERGY.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ENERGY.getHostPrefix(), 451); this.departmentName = ENERGY; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/IntergrativeBioscienceBiotechnologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/IntergrativeBioscienceBiotechnologyDept.java index 4fff4dc5..d35dc9bd 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/IntergrativeBioscienceBiotechnologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/IntergrativeBioscienceBiotechnologyDept.java @@ -24,8 +24,8 @@ public IntergrativeBioscienceBiotechnologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10837"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10851); + this.staffScrapInfo = new StaffScrapInfo(INT_BIO_TECH.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(INT_BIO_TECH.getHostPrefix(), 895); this.departmentName = INT_BIO_TECH; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartIctConvergenceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartIctConvergenceDept.java index 9759108e..664c4285 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartIctConvergenceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartIctConvergenceDept.java @@ -24,8 +24,8 @@ public SmartIctConvergenceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10673"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(15929); + this.staffScrapInfo = new StaffScrapInfo(SMART_ICT.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(SMART_ICT.getHostPrefix(), 455); this.departmentName = SMART_ICT; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartVehicleDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartVehicleDept.java index 9b1783a7..c811ef42 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartVehicleDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SmartVehicleDept.java @@ -24,8 +24,8 @@ public SmartVehicleDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10656"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10656); + this.staffScrapInfo = new StaffScrapInfo(SMART_VEHICLE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(SMART_VEHICLE.getHostPrefix(), 453); this.departmentName = SMART_VEHICLE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/StemCellRegenerativeBioTechnologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/StemCellRegenerativeBioTechnologyDept.java index 88075cde..8d03e1e5 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/StemCellRegenerativeBioTechnologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/StemCellRegenerativeBioTechnologyDept.java @@ -24,8 +24,8 @@ public StemCellRegenerativeBioTechnologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10744"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10758); + this.staffScrapInfo = new StaffScrapInfo(STEM_REGEN.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(STEM_REGEN.getHostPrefix(), 876); this.departmentName = STEM_REGEN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SystemBiotechnologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SystemBiotechnologyDept.java index c07c7415..4be8a52d 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SystemBiotechnologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/ku_integrated_science/SystemBiotechnologyDept.java @@ -24,8 +24,8 @@ public SystemBiotechnologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10810"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(16019); + this.staffScrapInfo = new StaffScrapInfo(SYSTEM_BIO_TECH.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(SYSTEM_BIO_TECH.getHostPrefix(), 887); this.departmentName = SYSTEM_BIO_TECH; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/ChineseDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/ChineseDept.java index 14788fef..8c95c00b 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/ChineseDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/ChineseDept.java @@ -24,8 +24,8 @@ public ChineseDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("3989"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(4001); + this.staffScrapInfo = new StaffScrapInfo(CHINESE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CHINESE.getHostPrefix(), 353); this.departmentName = CHINESE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/CultureContentDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/CultureContentDept.java index ade67326..6110186b 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/CultureContentDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/CultureContentDept.java @@ -24,8 +24,8 @@ public CultureContentDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("8001"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(8001); + this.staffScrapInfo = new StaffScrapInfo(CULTURE_CONT.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CULTURE_CONT.getHostPrefix(), 661); this.departmentName = CULTURE_CONT; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/EnglishDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/EnglishDept.java index aba8d99f..fa89fc73 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/EnglishDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/EnglishDept.java @@ -24,8 +24,8 @@ public EnglishDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("3886"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(3901); + this.staffScrapInfo = new StaffScrapInfo(ENGLISH.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ENGLISH.getHostPrefix(), 347); this.departmentName = ENGLISH; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/GeologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/GeologyDept.java index f25104fd..faf29efa 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/GeologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/GeologyDept.java @@ -24,8 +24,8 @@ public GeologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11509"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11509); + this.staffScrapInfo = new StaffScrapInfo(GEOLOGY.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(GEOLOGY.getHostPrefix(), 373); this.departmentName = GEOLOGY; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/HistoryDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/HistoryDept.java index b384d1e1..b78c6a28 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/HistoryDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/HistoryDept.java @@ -24,8 +24,8 @@ public HistoryDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("4110"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(4124); + this.staffScrapInfo = new StaffScrapInfo(HISTORY.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(HISTORY.getHostPrefix(), 361); this.departmentName = HISTORY; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/KoreanDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/KoreanDept.java index 60c549b8..4a18019f 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/KoreanDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/KoreanDept.java @@ -24,8 +24,8 @@ public KoreanDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("3815"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(3827); + this.staffScrapInfo = new StaffScrapInfo(KOREAN.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(KOREAN.getHostPrefix(), 334); this.departmentName = KOREAN; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/MediaCommunicationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/MediaCommunicationDept.java index 8a5828e9..1b349bab 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/MediaCommunicationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/MediaCommunicationDept.java @@ -24,8 +24,8 @@ public MediaCommunicationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("7879"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(7895); + this.staffScrapInfo = new StaffScrapInfo(MEDIA_COMM.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(MEDIA_COMM.getHostPrefix(), 375); this.departmentName = MEDIA_COMM; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/PhilosophyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/PhilosophyDept.java index 65f6725e..b93203a2 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/PhilosophyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/liberal_art/PhilosophyDept.java @@ -24,8 +24,8 @@ public PhilosophyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("4046"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(4061); + this.staffScrapInfo = new StaffScrapInfo(PHILOSOPHY.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(PHILOSOPHY.getHostPrefix(), 356); this.departmentName = PHILOSOPHY; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/real_estate/RealEstateDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/real_estate/RealEstateDept.java index f49f1bd1..4b83d956 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/real_estate/RealEstateDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/real_estate/RealEstateDept.java @@ -14,7 +14,6 @@ @RegisterDepartmentMap(key = REAL_ESTATE) public class RealEstateDept extends RealEstateCollege { - // 부동산학과는 교수진 정보를 렌더링하는 방법이 다름. 따라서 pfForumId 인자를 전달하지 않았다. public RealEstateDept(RealEstateNoticeApiClient realEstateNoticeApiClient, RealEstateNoticeHtmlParser realEstateNoticeHtmlParser, LatestPageNoticeProperties latestPageNoticeProperties) { @@ -23,8 +22,8 @@ public RealEstateDept(RealEstateNoticeApiClient realEstateNoticeApiClient, this.htmlParser = realEstateNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("13949"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(13949); + this.staffScrapInfo = new StaffScrapInfo("kure",siteIds); this.noticeScrapInfo = new NoticeScrapInfo(REAL_ESTATE.getHostPrefix(), 1563); this.departmentName = REAL_ESTATE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalResourcesFoodScienceBiotechnologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalResourcesFoodScienceBiotechnologyDept.java index 32d82978..af340edd 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalResourcesFoodScienceBiotechnologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalResourcesFoodScienceBiotechnologyDept.java @@ -24,8 +24,8 @@ public AnimalResourcesFoodScienceBiotechnologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11016"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11016); + this.staffScrapInfo = new StaffScrapInfo(ANIMAL_RESOURCES.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ANIMAL_RESOURCES.getHostPrefix(), 923); this.departmentName = ANIMAL_RESOURCES; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalScienceTechnologyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalScienceTechnologyDept.java index 512becb9..f74c6143 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalScienceTechnologyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/AnimalScienceTechnologyDept.java @@ -24,8 +24,8 @@ public AnimalScienceTechnologyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10902"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10902); + this.staffScrapInfo = new StaffScrapInfo(ANIMAL_SCIENCE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ANIMAL_SCIENCE.getHostPrefix(), 914); this.departmentName = ANIMAL_SCIENCE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/BiologicalSciencesDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/BiologicalSciencesDept.java index 449ead91..b60c3f62 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/BiologicalSciencesDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/BiologicalSciencesDept.java @@ -25,8 +25,8 @@ public BiologicalSciencesDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10864"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10880); + this.staffScrapInfo = new StaffScrapInfo(BIO_SCIENCE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(BIO_SCIENCE.getHostPrefix(), 909); this.departmentName = BIO_SCIENCE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/CropScienceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/CropScienceDept.java index 0af9c76a..a62442ed 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/CropScienceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/CropScienceDept.java @@ -24,8 +24,8 @@ public CropScienceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10939"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10939); + this.staffScrapInfo = new StaffScrapInfo(CROP_SCIENCE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CROP_SCIENCE.getHostPrefix(), 471); this.departmentName = CROP_SCIENCE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/EnvironmentalHealthScienceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/EnvironmentalHealthScienceDept.java index 01c75970..6f42185e 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/EnvironmentalHealthScienceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/EnvironmentalHealthScienceDept.java @@ -24,8 +24,8 @@ public EnvironmentalHealthScienceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11062"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11062); + this.staffScrapInfo = new StaffScrapInfo(ENV_HEALTH_SCIENCE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ENV_HEALTH_SCIENCE.getHostPrefix(), 477); this.departmentName = ENV_HEALTH_SCIENCE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/FoodMarketingSafetyDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/FoodMarketingSafetyDept.java index 297621be..ef5e8a99 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/FoodMarketingSafetyDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/FoodMarketingSafetyDept.java @@ -24,8 +24,8 @@ public FoodMarketingSafetyDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11029"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11029); + this.staffScrapInfo = new StaffScrapInfo(FOOD_MARKETING.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(FOOD_MARKETING.getHostPrefix(), 929); this.departmentName = FOOD_MARKETING; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/ForestryLandscapeArchitectureDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/ForestryLandscapeArchitectureDept.java index ecd9b03a..7321d972 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/ForestryLandscapeArchitectureDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_biology/ForestryLandscapeArchitectureDept.java @@ -24,8 +24,8 @@ public ForestryLandscapeArchitectureDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11103"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11103); + this.staffScrapInfo = new StaffScrapInfo(FORESTRY_LANDSCAPE_ARCH.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(FORESTRY_LANDSCAPE_ARCH.getHostPrefix(), 479); this.departmentName = FORESTRY_LANDSCAPE_ARCH; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/ElectiveEducationCenterDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/ElectiveEducationCenterDept.java index f359934f..aae0de35 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/ElectiveEducationCenterDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/ElectiveEducationCenterDept.java @@ -24,8 +24,8 @@ public ElectiveEducationCenterDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("11471"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11471); + this.staffScrapInfo = new StaffScrapInfo(ELE_EDU_CENTER.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ELE_EDU_CENTER.getHostPrefix(), 509); this.departmentName = ELE_EDU_CENTER; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/VolunteerCenterDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/VolunteerCenterDept.java index a919998c..5fe2764f 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/VolunteerCenterDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/sanghuo_elective/VolunteerCenterDept.java @@ -12,7 +12,6 @@ import static com.kustacks.kuring.notice.domain.DepartmentName.VOLUNTEER; -// TODO: 교직원 스크랩 시 장애가 되지 않는지 확인 필요 @RegisterDepartmentMap(key = VOLUNTEER) public class VolunteerCenterDept extends SanghuoCollege { @@ -26,8 +25,8 @@ public VolunteerCenterDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = Collections.emptyList(); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = Collections.emptyList(); + this.staffScrapInfo = new StaffScrapInfo(null,siteIds); this.noticeScrapInfo = new NoticeScrapInfo(VOLUNTEER.getHostPrefix(), 523); this.departmentName = VOLUNTEER; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/ChemicalsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/ChemicalsDept.java index 81dd7430..9da94c59 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/ChemicalsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/ChemicalsDept.java @@ -23,8 +23,8 @@ public ChemicalsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9794"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9794); + this.staffScrapInfo = new StaffScrapInfo(CHEMICALS.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(CHEMICALS.getHostPrefix(), 739); this.departmentName = CHEMICALS; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/MathematicsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/MathematicsDept.java index d9c97908..12dd7561 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/MathematicsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/MathematicsDept.java @@ -24,8 +24,8 @@ public MathematicsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9733"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9748); + this.staffScrapInfo = new StaffScrapInfo(MATH.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(MATH.getHostPrefix(), 727); this.departmentName = MATH; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/PhysicsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/PhysicsDept.java index b5259201..33455ceb 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/PhysicsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/science/PhysicsDept.java @@ -23,8 +23,8 @@ public PhysicsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("9765"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(9780); + this.staffScrapInfo = new StaffScrapInfo(PHYSICS.getHostPrefix(),siteIds); this.noticeScrapInfo = new NoticeScrapInfo(PHYSICS.getHostPrefix(), 393); this.departmentName = PHYSICS; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/AppliedStatisticsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/AppliedStatisticsDept.java index 1d626f8d..29781c44 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/AppliedStatisticsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/AppliedStatisticsDept.java @@ -24,8 +24,8 @@ public AppliedStatisticsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10389"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10389); + this.staffScrapInfo = new StaffScrapInfo(STATISTICS.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(STATISTICS.getHostPrefix(), 431); this.departmentName = STATISTICS; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/EconomicsDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/EconomicsDept.java index 249379f9..e234716f 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/EconomicsDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/EconomicsDept.java @@ -24,8 +24,8 @@ public EconomicsDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10216"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10216); + this.staffScrapInfo = new StaffScrapInfo(ECONOMICS.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ECONOMICS.getHostPrefix(), 423); this.departmentName = ECONOMICS; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/GlobalBusinessDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/GlobalBusinessDept.java index 27485b07..cbf4542e 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/GlobalBusinessDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/GlobalBusinessDept.java @@ -24,8 +24,8 @@ public GlobalBusinessDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10443"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10443); + this.staffScrapInfo = new StaffScrapInfo(GLOBAL_BUSI.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(GLOBAL_BUSI.getHostPrefix(), 435); this.departmentName = GLOBAL_BUSI; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InterDisciplinaryStudiesDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InterDisciplinaryStudiesDept.java index 26a748f2..3f4c1cf2 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InterDisciplinaryStudiesDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InterDisciplinaryStudiesDept.java @@ -24,8 +24,8 @@ public InterDisciplinaryStudiesDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10430"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10416); + this.staffScrapInfo = new StaffScrapInfo(DISCI_STUDIES.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(DISCI_STUDIES.getHostPrefix(), 433); this.departmentName = DISCI_STUDIES; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InternationalTradeDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InternationalTradeDept.java index 0ca74f37..8494af97 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InternationalTradeDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/InternationalTradeDept.java @@ -24,8 +24,8 @@ public InternationalTradeDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10371"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10371); + this.staffScrapInfo = new StaffScrapInfo(INT_TRADE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(INT_TRADE.getHostPrefix(), 429); this.departmentName = INT_TRADE; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PoliticalScienceDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PoliticalScienceDept.java index 1df50fd3..3ad0e306 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PoliticalScienceDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PoliticalScienceDept.java @@ -24,8 +24,8 @@ public PoliticalScienceDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10199"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10199); + this.staffScrapInfo = new StaffScrapInfo(POLITICS.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(POLITICS.getHostPrefix(), 803); this.departmentName = POLITICS; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PublicAdministrationDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PublicAdministrationDept.java index a386df2a..44b20687 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PublicAdministrationDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/social_science/PublicAdministrationDept.java @@ -24,8 +24,8 @@ public PublicAdministrationDept( this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List professorForumIds = List.of("10264"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(10264); + this.staffScrapInfo = new StaffScrapInfo("kupa",siteIds); this.noticeScrapInfo = new NoticeScrapInfo(ADMINISTRATION.getHostPrefix(), 855); this.departmentName = ADMINISTRATION; } diff --git a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/veterinary_medicine/VeterinaryMedicineDept.java b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/veterinary_medicine/VeterinaryMedicineDept.java index 23c6cfc6..0983c068 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/veterinary_medicine/VeterinaryMedicineDept.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/deptinfo/veterinary_medicine/VeterinaryMedicineDept.java @@ -23,9 +23,8 @@ public VeterinaryMedicineDept( this.noticeApiClient = latestPageNoticeApiClient; this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - - List professorForumIds = List.of("11135", "11136"); - this.staffScrapInfo = new StaffScrapInfo(professorForumIds); + List siteIds = List.of(11135); + this.staffScrapInfo = new StaffScrapInfo(VET_MEDICINE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(VET_MEDICINE.getHostPrefix(), 948); this.departmentName = VET_MEDICINE; } diff --git a/src/main/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupport.java b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupport.java index de4bcd5e..b386f815 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupport.java +++ b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupport.java @@ -12,7 +12,7 @@ public class StaffCompareSupport { public StaffCompareResults compareAllDepartmentsAndUpdateExistStaff( - List scrapStaffStorage, + Map scrapStaffStorage, Map originStaffStorage ) { updateAlreadyExistsStaffs(scrapStaffStorage, originStaffStorage); @@ -21,35 +21,35 @@ public StaffCompareResults compareAllDepartmentsAndUpdateExistStaff( return new StaffCompareResults(newStaffs, deleteStaffs); } - private void updateAlreadyExistsStaffs(List scrapStaffStorage, Map originStaffStorage) { - scrapStaffStorage.stream() - .filter(staffDto -> originStaffStorage.containsKey(staffDto.getEmail())) - .forEach(staffDto -> updateSingleStaff(staffDto, originStaffStorage)); + private void updateAlreadyExistsStaffs(Map scrapStaffStorage, Map originStaffStorage) { + scrapStaffStorage.keySet().stream() + .filter(originStaffStorage::containsKey) + .forEach(staffDtoKey -> updateSingleStaff(scrapStaffStorage.get(staffDtoKey), originStaffStorage)); } private void updateSingleStaff(StaffDto staffDto, Map originStaffStorage) { - Staff staff = originStaffStorage.get(staffDto.getEmail()); + Staff staff = originStaffStorage.get(staffDto.identifier()); if (staffDto.isNotSameInformation(staff)) { updateStaffInfo(staffDto, staff); } } - private List filteringNewStaffs(List scrapStaffStorage, Map originStaffStorage) { - return scrapStaffStorage.stream() - .filter(staffDto -> !originStaffStorage.containsKey(staffDto.getEmail())) - .map(StaffDto::toEntity) + private List filteringNewStaffs(Map scrapStaffStorage, Map originStaffStorage) { + return scrapStaffStorage.keySet().stream() + .filter(staffDtoKey -> !originStaffStorage.containsKey(staffDtoKey)) + .map(staffDtoKey -> scrapStaffStorage.get(staffDtoKey).toEntity()) .toList(); } - private List filteringDeleteStaffs(List scrapStaffStorage, Map originStaffStorage) { - for (StaffDto staffDto : scrapStaffStorage) { - originStaffStorage.remove(staffDto.getEmail()); + private List filteringDeleteStaffs(Map scrapStaffStorage, Map originStaffStorage) { + for (String staffDtoKey : scrapStaffStorage.keySet()) { + originStaffStorage.remove(staffDtoKey); } return originStaffStorage.values().stream().toList(); } - private static void updateStaffInfo(StaffDto staffDto, Staff staff) { + private void updateStaffInfo(StaffDto staffDto, Staff staff) { staff.updateInformation( staffDto.getName(), staffDto.getMajor(), @@ -57,7 +57,8 @@ private static void updateStaffInfo(StaffDto staffDto, Staff staff) { staffDto.getPhone(), staffDto.getEmail(), staffDto.getDeptName(), - staffDto.getCollegeName() + staffDto.getCollegeName(), + staffDto.getPosition() ); } } diff --git a/src/main/java/com/kustacks/kuring/worker/update/staff/StaffDataSynchronizer.java b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffDataSynchronizer.java index 1dee3d16..00f40a21 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/staff/StaffDataSynchronizer.java +++ b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffDataSynchronizer.java @@ -9,7 +9,6 @@ import org.springframework.stereotype.Component; import org.springframework.transaction.annotation.Transactional; -import java.util.List; import java.util.Map; import java.util.function.Function; import java.util.stream.Collectors; @@ -29,8 +28,8 @@ public void compareAndUpdateDb(StaffScrapResults scrapResults) { } private StaffCompareResults compare(StaffScrapResults scrapResults) { - Map originStaffStorage = findByDeptContainingMap(scrapResults.successDepartmentNames()); - return staffCompareSupport.compareAllDepartmentsAndUpdateExistStaff(scrapResults.getStaffDtos(), originStaffStorage); + Map originStaffStorage = findAllOriginStaffs(); + return staffCompareSupport.compareAllDepartmentsAndUpdateExistStaff(scrapResults.kuStaffDTOMap(), originStaffStorage); } private void synchronizationWithDb(StaffCompareResults compareResults) { @@ -38,13 +37,11 @@ private void synchronizationWithDb(StaffCompareResults compareResults) { staffRepository.saveAll(compareResults.newStaffs()); } - private Map findByDeptContainingMap(List scrapSuccessDepartmentNames) { - return scrapSuccessDepartmentNames.stream() - .flatMap( - deptName -> staffRepository.findByDeptContaining(deptName).stream() - ).collect( + private Map findAllOriginStaffs() { + return staffRepository.findAll().stream() + .collect( Collectors.toMap( - Staff::getEmail, + Staff::identifier, Function.identity(), (existing, newValue) -> existing ) diff --git a/src/main/java/com/kustacks/kuring/worker/update/staff/StaffUpdater.java b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffUpdater.java index 51ffc5e8..e4d0c8b2 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/staff/StaffUpdater.java +++ b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffUpdater.java @@ -7,12 +7,13 @@ import com.kustacks.kuring.worker.update.staff.dto.StaffScrapResults; import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; +import org.springframework.scheduling.annotation.Scheduled; import org.springframework.stereotype.Component; import java.util.HashMap; -import java.util.LinkedList; import java.util.List; import java.util.Map; +import java.util.concurrent.TimeUnit; import java.util.stream.Collectors; @Slf4j @@ -23,14 +24,8 @@ public class StaffUpdater { private final StaffDataSynchronizer staffDataSynchronizer; private final StaffScraper staffScraper; private final List deptInfos; - - /* - 각 학과별 url로 스크래핑, 교수진 데이터 수집 - 스크래핑 실패한 학과들을 재시도하기 위해 호출된 경우 - values에 StaffDeptInfo 전체 값이 아닌, 매개변수로 들어온 값을 전달한다. - */ - //@Scheduled(fixedRate = 30, timeUnit = TimeUnit.DAYS) - @Deprecated(since = "2.7.3", forRemoval = true) + + @Scheduled(fixedRate = 30, timeUnit = TimeUnit.DAYS) public void update() { log.info("========== 교직원 업데이트 시작 =========="); @@ -42,20 +37,17 @@ public void update() { private StaffScrapResults scrapAllDepartmentsStaffs() { Map kuStaffDtoMap = new HashMap<>(); - List successDepartmentNames = new LinkedList<>(); - - for (DeptInfo deptInfo : deptInfos) { - scrapSingleDepartmentsStaffs(kuStaffDtoMap, successDepartmentNames, deptInfo); - } - return new StaffScrapResults(kuStaffDtoMap, successDepartmentNames); + deptInfos.stream() + .filter(DeptInfo::isSupportStaffScrap) + .forEach(deptInfo -> scrapSingleDepartmentsStaffs(kuStaffDtoMap, deptInfo)); + return new StaffScrapResults(kuStaffDtoMap); } - private void scrapSingleDepartmentsStaffs(Map kuStaffDtoMap, List successDepartmentNames, DeptInfo deptInfo) { + private void scrapSingleDepartmentsStaffs(Map kuStaffDtoMap, DeptInfo deptInfo) { try { Map staffScrapResultMap = scrapStaffByDepartment(deptInfo); mergeForMultipleDepartmentsStaff(kuStaffDtoMap, staffScrapResultMap); - successDepartmentNames.add(deptInfo.getDeptName()); } catch (InternalLogicException e) { log.error("[StaffScraperException] {}학과 교직원 스크래핑 문제 발생.", deptInfo.getDeptName()); } @@ -68,7 +60,7 @@ private Map scrapStaffByDepartment(DeptInfo deptInfo) { private Map convertStaffDtoMap(List scrapedStaffDtos) { return scrapedStaffDtos.stream() - .collect(Collectors.toMap(StaffDto::getEmail, staffDto -> staffDto)); + .collect(Collectors.toMap(StaffDto::identifier, staffDto -> staffDto)); } private void mergeForMultipleDepartmentsStaff( diff --git a/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffDto.java b/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffDto.java index 3e516701..b8c3b220 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffDto.java +++ b/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffDto.java @@ -1,5 +1,7 @@ package com.kustacks.kuring.worker.update.staff.dto; +import com.kustacks.kuring.common.utils.converter.EmailSupporter; +import com.kustacks.kuring.common.utils.converter.PhoneNumberSupporter; import com.kustacks.kuring.staff.domain.Staff; import lombok.AccessLevel; import lombok.Builder; @@ -26,15 +28,34 @@ public class StaffDto { private String collegeName; + private String position; + @Builder - private StaffDto(String name, String major, String lab, String phone, String email, String deptName, String collegeName) { + private StaffDto(String name, String major, String lab, String phone, String email, String deptName, String collegeName, String position) { this.name = name; this.major = major; this.lab = lab; - this.phone = phone; - this.email = email; + this.phone = processPhone(phone); + this.email = processEmail(email); this.deptName = deptName; this.collegeName = collegeName; + this.position = position; + + } + + private String processPhone(String phone) { + if (PhoneNumberSupporter.isNullOrBlank(phone)) { + return ""; + } + + return PhoneNumberSupporter.convertFullExtensionNumber(phone); + } + + private String processEmail(String email) { + if (EmailSupporter.isNullOrBlank(email)) { + return ""; + } + return EmailSupporter.convertValidEmail(email); } public boolean isNotSameInformation(Staff staff) { @@ -44,7 +65,8 @@ public boolean isNotSameInformation(Staff staff) { || !staff.isSamePhone(phone) || !staff.isSameEmail(email) || !staff.isSameDept(deptName) - || !staff.isSameCollege(collegeName); + || !staff.isSameCollege(collegeName) + || !staff.isSamePosition(position); } public Staff toEntity() { @@ -55,13 +77,19 @@ public Staff toEntity() { .phone(phone) .email(email) .dept(deptName) - .college(collegeName).build(); + .college(collegeName) + .position(position) + .build(); } public void setDeptName(String deptName) { this.deptName = deptName; } + public String identifier() { + return String.join(",", name, position, deptName); + } + @Override public boolean equals(Object o) { if (this == o) return true; @@ -73,11 +101,12 @@ public boolean equals(Object o) { && Objects.equals(getPhone(), staffDto.getPhone()) && Objects.equals(getEmail(), staffDto.getEmail()) && Objects.equals(getDeptName(), staffDto.getDeptName()) - && Objects.equals(getCollegeName(), staffDto.getCollegeName()); + && Objects.equals(getCollegeName(), staffDto.getCollegeName()) + && Objects.equals(getPosition(), staffDto.getPosition()); } @Override public int hashCode() { - return Objects.hash(getName(), getMajor(), getLab(), getPhone(), getEmail(), getDeptName(), getCollegeName()); + return Objects.hash(getName(), getMajor(), getLab(), getPhone(), getEmail(), getDeptName(), getCollegeName(), getPosition()); } } diff --git a/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffScrapResults.java b/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffScrapResults.java index 28c07703..afc9be90 100644 --- a/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffScrapResults.java +++ b/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffScrapResults.java @@ -4,11 +4,7 @@ import java.util.Map; public record StaffScrapResults( - Map kuStaffDTOMap, - List successDepartmentNames + Map kuStaffDTOMap ) { - public List getStaffDtos() { - return kuStaffDTOMap.values().stream().toList(); - } } diff --git a/src/main/resources/application-dev.yml b/src/main/resources/application-dev.yml index a74a32d1..e471f504 100644 --- a/src/main/resources/application-dev.yml +++ b/src/main/resources/application-dev.yml @@ -154,7 +154,4 @@ ip: proxy-list: 14.63.228.239:80, 101.79.15.198:80, 222.104.128.205:8678, 106.244.154.91:8080, 103.51.205.42:8181 staff: - real-estate-url: http://www.realestate.ac.kr/gb/bbs/board.php?bo_table=faculty - communication-design-url: http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_01_tab01.jsp - living-design-url: http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_05_tab01.jsp - each-dept-url: http://home.konkuk.ac.kr/cms/Common/Professor/ProfessorList.do + each-dept-url: https://{department}.konkuk.ac.kr/{department}/{siteId}/subview.do \ No newline at end of file diff --git a/src/main/resources/application-local.yml b/src/main/resources/application-local.yml index e429895d..b185dd4f 100644 --- a/src/main/resources/application-local.yml +++ b/src/main/resources/application-local.yml @@ -157,7 +157,4 @@ ip: proxy-list: 14.63.228.239:80, 101.79.15.198:80, 222.104.128.205:8678, 106.244.154.91:8080, 103.51.205.42:8181 staff: - real-estate-url: http://www.realestate.ac.kr/gb/bbs/board.php?bo_table=faculty - communication-design-url: http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_01_tab01.jsp - living-design-url: http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_05_tab01.jsp - each-dept-url: http://home.konkuk.ac.kr/cms/Common/Professor/ProfessorList.do + each-dept-url: https://{department}.konkuk.ac.kr/{department}/{siteId}/subview.do \ No newline at end of file diff --git a/src/main/resources/application-prod.yml b/src/main/resources/application-prod.yml index 8137f084..fbed0d5b 100644 --- a/src/main/resources/application-prod.yml +++ b/src/main/resources/application-prod.yml @@ -114,7 +114,4 @@ ip: proxy-list: 14.63.228.239:80, 101.79.15.198:80, 222.104.128.205:8678, 106.244.154.91:8080, 103.51.205.42:8181 staff: - real-estate-url: http://www.realestate.ac.kr/gb/bbs/board.php?bo_table=faculty - communication-design-url: http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_01_tab01.jsp - living-design-url: http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_05_tab01.jsp - each-dept-url: http://home.konkuk.ac.kr/cms/Common/Professor/ProfessorList.do + each-dept-url: https://{department}.konkuk.ac.kr/{department}/{siteId}/subview.do \ No newline at end of file diff --git a/src/main/resources/db/migration/V241130__Add_position_to_staff.sql b/src/main/resources/db/migration/V241130__Add_position_to_staff.sql new file mode 100644 index 00000000..78009bf4 --- /dev/null +++ b/src/main/resources/db/migration/V241130__Add_position_to_staff.sql @@ -0,0 +1,2 @@ +ALTER TABLE staff + ADD column position varchar(64); diff --git a/src/test/java/com/kustacks/kuring/common/utils/converter/EmailSupporterTest.java b/src/test/java/com/kustacks/kuring/common/utils/converter/EmailSupporterTest.java new file mode 100644 index 00000000..e278cdc4 --- /dev/null +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/EmailSupporterTest.java @@ -0,0 +1,68 @@ +package com.kustacks.kuring.common.utils.converter; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static org.assertj.core.api.Assertions.assertThat; + +class EmailSupporterTest { + + @DisplayName("이메일 구조 변경 테스트") + @Test + void convertEmailTest() { + //given + String[] emails = new String[]{ + "ab1234@konkuk.ac.kr", + "gclee at konkuk dot ac dot kr", + "slryu2002@konkuk.ac.kr/ slryu2002@gmail.com", + "sawng@konkuk.ac.kr, ywsong13@gmail.com", + "", + null}; + String[] answer = new String[]{ + "ab1234@konkuk.ac.kr", + "gclee@konkuk.ac.kr", + "slryu2002@konkuk.ac.kr", + "sawng@konkuk.ac.kr", + "", + ""}; + + //when + List convertedEmails = Arrays.stream(emails) + .map(EmailSupporter::convertValidEmail) + .toList(); + + //then + for (int i = 0; i < emails.length; i++) { + assertThat(Objects.equals(convertedEmails.get(i), answer[i])).isTrue(); + } + } + + @DisplayName("이메일 Null or Blank 테스트") + @Test + void validationEmailTest() { + //given + String[] emails = new String[]{ + "ab1234@konkuk.ac.kr", + "gclee at konkuk dot ac dot kr", + "slryu2002@konkuk.ac.kr/ slryu2002@gmail.com", + "sawng@konkuk.ac.kr, ywsong13@gmail.com", + "", + null}; + + Boolean[] answer = new Boolean[]{false, false, false, false, true, true}; + + //when + List validationResults = Arrays.stream(emails) + .map(EmailSupporter::isNullOrBlank) + .toList(); + + //then + for (int i = 0; i < emails.length; i++) { + assertThat(Objects.equals(validationResults.get(i), answer[i])).isTrue(); + } + } +} \ No newline at end of file diff --git a/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java new file mode 100644 index 00000000..c9b6c84b --- /dev/null +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java @@ -0,0 +1,74 @@ +package com.kustacks.kuring.common.utils.converter; + +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; + +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + +import static org.assertj.core.api.Assertions.assertThat; + +class PhoneNumberSupporterTest { + + @DisplayName("전화번호 구조 변경 테스트") + @Test + void convertValidNumber() { + //given + String[] numbers = new String[]{ + "1234", + "02-450-1234", + "02)450-1234", + "02-2049-1234", + "02)2049-1234", + "218)", + "", + null}; + String[] answer = new String[]{ + "02-450-1234", + "02-450-1234", + "02-450-1234", + "02-2049-1234", + "02-2049-1234", + "", + "", + ""}; + + //when + List convertedNumbers = Arrays.stream(numbers) + .map(PhoneNumberSupporter::convertFullExtensionNumber) + .toList(); + + //then + for (int i = 0; i < numbers.length; i++) { + assertThat(Objects.equals(convertedNumbers.get(i), answer[i])).isTrue(); + } + } + + @DisplayName("전화번호 Null or Blank 테스트") + @Test + void validationEmailTest() { + //given + String[] numbers = new String[]{ + "1234", + "02-450-1234", + "02)450-1234", + "02-2049-1234", + "02)2049-1234", + "218)", + "", + null}; + + Boolean[] answer = new Boolean[]{false, false, false, false, false, false, true, true}; + + //when + List validationResults = Arrays.stream(numbers) + .map(PhoneNumberSupporter::isNullOrBlank) + .toList(); + + //then + for (int i = 0; i < numbers.length; i++) { + assertThat(Objects.equals(validationResults.get(i), answer[i])).isTrue(); + } + } +} \ No newline at end of file diff --git a/src/test/java/com/kustacks/kuring/staff/domain/StaffTest.java b/src/test/java/com/kustacks/kuring/staff/domain/StaffTest.java index dfbd5b01..fb392c0d 100644 --- a/src/test/java/com/kustacks/kuring/staff/domain/StaffTest.java +++ b/src/test/java/com/kustacks/kuring/staff/domain/StaffTest.java @@ -166,9 +166,9 @@ private static Stream phoneNumberInputProvider() { Arguments.of("02-2049-6052 / 02-457-1341(Lab)", "02-2049-6052 / 02-457-1341(Lab)"), Arguments.of("02-450-3936 ( FAX : 02-3437-8360)", "02-450-3936 ( FAX : 02-3437-8360)"), Arguments.of("1-505-667-2716", "1-505-667-2716"), - Arguments.of(" ", "-"), - Arguments.of("", "-"), - Arguments.of(null, "-") + Arguments.of(" ", ""), + Arguments.of("", ""), + Arguments.of(null, "") ); } } diff --git a/src/test/java/com/kustacks/kuring/support/MockServerSupport.java b/src/test/java/com/kustacks/kuring/support/MockServerSupport.java new file mode 100644 index 00000000..4d73ce65 --- /dev/null +++ b/src/test/java/com/kustacks/kuring/support/MockServerSupport.java @@ -0,0 +1,28 @@ +package com.kustacks.kuring.support; + +import org.mockserver.client.MockServerClient; +import org.mockserver.model.HttpRequest; +import org.mockserver.model.HttpResponse; +import org.mockserver.model.MediaType; + +import static org.mockserver.matchers.Times.exactly; + +public class MockServerSupport { + public static HttpRequest getMockRequest(String httpMethod, String requestPath) { + return HttpRequest.request(httpMethod) + .withPath(requestPath); + } + + public static HttpResponse getMockResponse(int statusCode, MediaType mediaType, String responseBody) { + return HttpResponse.response() + .withStatusCode(statusCode) + .withBody(responseBody) + .withContentType(mediaType); + } + + public static void createNewMockServer(int port, HttpRequest httpRequest, HttpResponse httpResponse) { + new MockServerClient("127.0.0.1", port) + .when(httpRequest, exactly(1)) + .respond(httpResponse); + } +} diff --git a/src/test/java/com/kustacks/kuring/worker/parser/StaffHtmlParserTemplateTest.java b/src/test/java/com/kustacks/kuring/worker/parser/StaffHtmlParserTemplateTest.java index ee16c35f..35525921 100644 --- a/src/test/java/com/kustacks/kuring/worker/parser/StaffHtmlParserTemplateTest.java +++ b/src/test/java/com/kustacks/kuring/worker/parser/StaffHtmlParserTemplateTest.java @@ -2,7 +2,6 @@ import com.kustacks.kuring.support.TestFileLoader; import com.kustacks.kuring.worker.parser.staff.EachDeptStaffHtmlParser; -import com.kustacks.kuring.worker.parser.staff.LivingAndCommunicationDesignStaffHtmlParser; import com.kustacks.kuring.worker.parser.staff.RealEstateStaffHtmlParser; import org.jsoup.Jsoup; import org.jsoup.nodes.Document; @@ -18,61 +17,11 @@ class StaffHtmlParserTemplateTest { - @DisplayName("리빙 디자인 학과의 교수진 정보를 파싱한다.") - @Test - void LivingDesignHtmlParserTwo() throws IOException { - // given - Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/livingdesign.html")); - - // when - List parseResults = new LivingAndCommunicationDesignStaffHtmlParser().parse(doc); - - // then - assertAll( - () -> assertThat(parseResults).hasSize(5), - () -> assertThat(parseResults) - .extracting(arr -> arr[0], arr -> arr[1], arr -> arr[2], arr -> arr[3], arr -> arr[4]) - .containsExactlyInAnyOrder( - tuple("김선미", "텍스타일디자인", "예술문화관 507호", "02-450-3790", "cemi@konkuk.ac.kr"), - tuple("이필하", "섬유미술", "예술문화관 504호", "02-2049-6015", "imphil@konkuk.ac.kr"), - tuple("김성달", "텍스타일디자인", "예술문화관 505호", "02-450-3732", "dahlkim@naver.com"), - tuple("이하린", "도자공예", "예술문화관 506호", "02-450-3796", "fredmizer@naver.com"), - tuple("황선욱", "금속공예", "예술문화관 519호", "02-2049-6032", "renerary@hanmail.net") - ) - ); - } - - @DisplayName("커뮤니케이션 디자인 학과의 교수진 정보를 파싱한다.") - @Test - void CommunicationDesignHtmlParserTwo() throws IOException { - // given - Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/communicationdesign.html")); - - // when - List parseResults = new LivingAndCommunicationDesignStaffHtmlParser().parse(doc); - - // then - assertAll( - () -> assertThat(parseResults).hasSize(7), - () -> assertThat(parseResults) - .extracting(arr -> arr[0], arr -> arr[1], arr -> arr[2], arr -> arr[3], arr -> arr[4]) - .containsExactlyInAnyOrder( - tuple("박성완", "드로잉", "예술문화관 811호", "02-450-3787", "swpark@konkuk.ac.kr"), - tuple("김병진", "시각디자인", "예술문화관 810호", "02-450-3788", "turbokbj@hanmail.net"), - tuple("유우종", "멀티미디어디자인", "예술문화관 809호", "02-450-4115", "yoowoojong@hotmail.com"), - tuple("김지윤", "디지털미디어디자인", "예술문화관 808호", "02-450-3763", "joonkim@konkuk.ac.kr"), - tuple("한창호", "시각디자인", "예술문화관 807호", "02-2049-6057", "hann@konkuk.ac.kr"), - tuple("최병일", "멀티미디어디자인", "예술문화관 806호", "02-2049-6056", "redhorse@konkuk.ac.kr"), - tuple("조혜영", "디자인 한국학/역사문화이론", "예술문화관 804호", "02-450-4297", "joahe@konkuk.ac.kr") - ) - ); - } - - @DisplayName("부동 학과의 교수진 정보를 파싱한다.") + @DisplayName("부동산 학과의 교수진 정보를 파싱한다.") @Test void RealEstateStaffHtmlParser() throws IOException { // given - Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/realestate.html")); + Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/real_estate_staff_page.html")); // when List parseResults = new RealEstateStaffHtmlParser().parse(doc); @@ -81,27 +30,57 @@ void RealEstateStaffHtmlParser() throws IOException { assertThat(parseResults).hasSize(11); } - @DisplayName("컴퓨터공학과의 교수진 정보를 파싱한다.") + @DisplayName("컴퓨터공학부 홈페이지의 교수진 정보를 파싱한다.") @Test - void StaffEachDeptHtmlParser() throws IOException { + void LatestStaffEachDeptHtmlParser() throws IOException { // given - Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/computer.html")); + Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/cse_staff_page.html")); // when - List parseResults = new EachDeptStaffHtmlParser().parse(doc); - + EachDeptStaffHtmlParser parser = new EachDeptStaffHtmlParser(); + List parseResults = parser.parse(doc); // then assertAll( - () -> assertThat(parseResults).hasSize(5), + // 전체 파싱된 교수진 수 검증 + () -> assertThat(parseResults).hasSize(23), + + // 각각의 데이터 검증 () -> assertThat(parseResults) - .extracting(arr -> arr[0], arr -> arr[1], arr -> arr[2], arr -> arr[3], arr -> arr[4]) + .extracting( + arr -> arr[0], // 이름 + arr -> arr[1], // 직위 + arr -> arr[2], // 연구분야 + arr -> arr[3], // 연구실 위치 + arr -> arr[4], // 전화번호 + arr -> arr[5] // 이메일 + ) .containsExactlyInAnyOrder( - tuple("김기천 ( Keecheon Kim )", "Computer Communications and Mobile Computing", "공학관 C동 385-2호 / 신공학관 1205호", "02-450-3518", "kckim@konkuk.ac.kr"), - tuple("김두현 ( Doohyun Kim )", "Embedded & Intelligent Computing", "공학관 C동 483호 / 신공학관 1004호", "02-2049-6044", "doohyun@konkuk.ac.kr"), - tuple("김성렬 ( Sung-Ryul Kim )", "Cryptography and System Security", "공학관 483-2호", "02-450-4134", "kimsr@konkuk.ac.kr"), - tuple("김욱희", "Database Systems, Storage Systems", "공학관 C동 422호 / 신공학관 1217호", "02-450-3493", "wookhee@konkuk.ac.kr"), - tuple("김은이 ( Eun Yi Kim )", "인공지능, 컴퓨터비전", "공학관 483-1호", "02-450-4135", "eykim@konkuk.ac.kr") + tuple("김기천 (Keecheon Kim)", "교수", "Computer Communications and Mobile Computing", "공C385-2", "3518", "kckim@konkuk.ac.kr"), + tuple("김두현 (Doo Hyun Kim)", "교수", "Embedded & Intelligent Computing", "공C483", "6044", "doohyun@konkuk.ac.kr"), + tuple("김성열 (Sung Ryul Kim)", "교수", "Cryptography and System Security", "공C483-2", "4134", "kimsr@konkuk.ac.kr"), + tuple("김욱희 (Wookhee Kim)", "조교수", "Database Systems, Storage Systems", "공C422", "3493", "wookhee@konkuk.ac.kr"), + tuple("김은이 (Eun Yi KIm)", "교수", "인공지능, 컴퓨터비전", "공C483-1", "4135", "eykim@konkuk.ac.kr"), + tuple("김학수 (Kim, Harksoo)", "교수", "Natural Language Processing", "공C386-1", "3499", "nlpdrkim@konkuk.ac.kr"), + tuple("김형석 (HyungSeok Kim)", "교수", "Virtual Reality/Computer Graphics", "공C292-2", "4095", "hyuskim@konkuk.ac.kr"), + tuple("남원홍 (WONHONG NAM)", "교수", "Formal Methods", "공C293", "6128", "wnam@konkuk.ac.kr"), + tuple("민덕기 (Min, Dugki)", "교수", "Distributed Systems / AI(Deep (Reinforcement) Learning) / Software Architecture", "공C385", "3490", "dkmin@konkuk.ac.kr"), + tuple("박능수 (Neungsoo Park)", "교수", "Computer Architecture and Parallel Computing", "공C384-1", "4081", "neungsoo@konkuk.ac.kr"), + tuple("박소영 (Soyoung Park)", "부교수", "Cryptography", "공A1409-1", "0482", "soyoungpark@konkuk.ac.kr"), + tuple("신효섭 (Hyoseop Shin)", "교수", "Database Systems", "공C386-2", "6117", "hsshin@konkuk.ac.kr"), + tuple("오병국 (Byungkook Oh)", "조교수", "", "공C384-2", "3073", "bkoh@konkuk.ac.kr"), + tuple("유준범 (JUNBEOM YOO)", "교수", "Software Engineering", "공C386", "3258", "jbyoo@konkuk.ac.kr"), + tuple("윤경로 (Kyoungro Yoon)", "교수", "Multimedia Systems", "공C384", "4129", "yoonk@konkuk.ac.kr"), + tuple("이향원 (Hyang-Won Lee)", "교수", "Networked Systems and Data Science", "공C293-1", "0471", "leehw@konkuk.ac.kr"), + tuple("임민규 (Mingyu Lim)", "교수", "Distributed Systems", "공C292-1", "6270", "mlim@konkuk.ac.kr"), + tuple("임창훈 (Yim, Changhoon)", "교수", "Image Processing, Computer Vision", "공C292-3", "4016", "cyim@konkuk.ac.kr"), + tuple("정갑주 (KARPJOO JEONG)", "교수", "Smart Infrastructure", "공C385-1", "3510", "jeongk@konkuk.ac.kr"), + tuple("지정희 (Jeonghee Chi)", "조교수", "Spatiotemporal Database", "공학관 A동 1409-1호", "3350", "jhchi@konkuk.ac.kr"), + tuple("진현욱 (Hyun-Wook Jin)", "교수", "Operating Systems", "공C291-1", "3535", "jinh@konkuk.ac.kr"), + tuple("차영운 (YoungWoon Cha)", "조교수", "Extended Reality, Vision, Graphics", "공C293-2", "3509", "youngcha@konkuk.ac.kr"), + tuple("하영국 (Ha Young-Guk)", "교수", "Intelligent Systems and Big Data", "공C291-2", "3273", "ygha@konkuk.ac.kr") ) + ); } + } diff --git a/src/test/java/com/kustacks/kuring/worker/parser/StaffScraperTest.java b/src/test/java/com/kustacks/kuring/worker/parser/StaffScraperTest.java deleted file mode 100644 index 079164f0..00000000 --- a/src/test/java/com/kustacks/kuring/worker/parser/StaffScraperTest.java +++ /dev/null @@ -1,356 +0,0 @@ -package com.kustacks.kuring.worker.parser; - -import com.fasterxml.jackson.databind.ObjectMapper; -import com.kustacks.kuring.common.exception.InternalLogicException; -import com.kustacks.kuring.common.exception.code.ErrorCode; -import com.kustacks.kuring.worker.scrap.StaffScraper; -import com.kustacks.kuring.worker.scrap.client.NormalJsoupClient; -import com.kustacks.kuring.worker.scrap.client.notice.LatestPageNoticeApiClient; -import com.kustacks.kuring.worker.scrap.client.notice.property.LatestPageNoticeProperties; -import com.kustacks.kuring.worker.scrap.client.staff.EachDeptStaffApiClient; -import com.kustacks.kuring.worker.scrap.client.staff.LivingAndCommunicationDesignStaffApiClient; -import com.kustacks.kuring.worker.scrap.client.staff.RealEstateStaffApiClient; -import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.CommunicationDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.art_design.LivingDesignDept; -import com.kustacks.kuring.worker.scrap.deptinfo.liberal_art.KoreanDept; -import com.kustacks.kuring.worker.scrap.deptinfo.real_estate.RealEstateDept; -import com.kustacks.kuring.worker.parser.dto.TestStaffDTO; -import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser; -import com.kustacks.kuring.worker.parser.staff.EachDeptStaffHtmlParser; -import com.kustacks.kuring.worker.parser.staff.LivingAndCommunicationDesignStaffHtmlParser; -import com.kustacks.kuring.worker.parser.staff.RealEstateStaffHtmlParser; -import com.kustacks.kuring.worker.update.staff.dto.StaffDto; -import org.junit.jupiter.api.*; -import org.mockserver.client.MockServerClient; -import org.mockserver.integration.ClientAndServer; -import org.mockserver.model.HttpRequest; -import org.mockserver.model.HttpResponse; -import org.mockserver.model.MediaType; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.boot.context.properties.EnableConfigurationProperties; -import org.springframework.core.io.ClassPathResource; -import org.springframework.test.context.TestConstructor; -import org.springframework.test.context.junit.jupiter.SpringJUnitConfig; -import org.springframework.util.FileCopyUtils; - -import java.io.IOException; -import java.io.InputStream; -import java.io.InputStreamReader; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.LinkedList; -import java.util.List; - -import static org.junit.jupiter.api.Assertions.assertEquals; -import static org.junit.jupiter.api.Assertions.assertThrows; -import static org.mockserver.matchers.Times.exactly; -import static org.mockserver.model.HttpRequest.request; -import static org.mockserver.model.HttpResponse.response; - -@Disabled -@SpringJUnitConfig({ - StaffScraper.class, - LatestPageNoticeApiClient.class, LatestPageNoticeHtmlParser.class, - EachDeptStaffApiClient.class, LivingAndCommunicationDesignStaffApiClient.class, RealEstateStaffApiClient.class, - EachDeptStaffHtmlParser.class, LivingAndCommunicationDesignStaffHtmlParser.class, RealEstateStaffHtmlParser.class, - NormalJsoupClient.class, - KoreanDept.class, LivingDesignDept.class, CommunicationDesignDept.class, RealEstateDept.class, - ObjectMapper.class}) -@EnableConfigurationProperties(value = LatestPageNoticeProperties.class) -@TestConstructor(autowireMode = TestConstructor.AutowireMode.ALL) -public class StaffScraperTest { - - @Value("${staff.each-dept-url}") - private String eachDeptUrl; - - @Value("${staff.living-design-url}") - private String livingDesignDeptUrl; - - @Value("${staff.real-estate-url}") - private String realEstateUrl; - - private final StaffScraper staffScraper; - - private final KoreanDept koreanDept; - private final LivingDesignDept livingDesignDept; - private final RealEstateDept realEstateDept; - - private final ObjectMapper objectMapper; - - private static ClientAndServer mockServer; - private static final int MOCK_SERVER_PORT = 9000; - - private final String realEstateFolderName = "real_estate"; - private final String livingDesignFolderName = "living_design"; - private final String koreanFolderName = "korean"; - - - public StaffScraperTest( - StaffScraper staffScraper, - ObjectMapper objectMapper, - KoreanDept koreanDept, - LivingDesignDept livingDesignDept, - RealEstateDept realEstateDept) { - - this.staffScraper = staffScraper; - this.objectMapper = objectMapper; - this.koreanDept = koreanDept; - this.livingDesignDept = livingDesignDept; - this.realEstateDept = realEstateDept; - } - - @BeforeAll - static void setUp() { - mockServer = ClientAndServer.startClientAndServer(MOCK_SERVER_PORT); - } - - @AfterAll - static void cleanUp() { - mockServer.stop(); - } - - @Nested - @DisplayName("성공") - class Success { - - @Test - @DisplayName("RealEstate") - void successForRealEstate() throws URISyntaxException, IOException { - - URI uri = new URI(realEstateUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, realEstateDept, realEstateFolderName); - } - - @Test - @DisplayName("Ku") - void successForKu() throws URISyntaxException, IOException { - - URI uri = new URI(livingDesignDeptUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, livingDesignDept, livingDesignFolderName); - } - - @Test - @DisplayName("EachDept") - void successForEachDept() throws URISyntaxException, IOException { - - URI uri = new URI(eachDeptUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, koreanDept, koreanFolderName); - } - - private void testTemplate(String requestPath, DeptInfo deptInfo, String folderName) throws IOException { - - // given - createExpectationForSuccess(requestPath, deptInfo instanceof KoreanDept ? deptInfo.getStaffScrapInfo().getProfessorForumId().get(0) : "", folderName); - - // when - List staffDtoList = staffScraper.scrap(deptInfo); - - // then - int correct = 0; - List answers = getAnswers("staffpages/" + folderName + "/answers"); - for (StaffDto result : staffDtoList) { - for (TestStaffDTO answer : answers) { - if (compareDTO(result, answer)) { - ++correct; - break; - } - } - } - - assertEquals(answers.size(), correct); - } - - private void createExpectationForSuccess(String requestPath, String pfForumId, String folderName) throws IOException { - - String responseBody = readHTML("staffpages/" + folderName + "/page.html"); - - HttpRequest request = request().withMethod("GET").withPath(requestPath); - boolean isEachDept = pfForumId.length() > 0; - if (isEachDept) { - request.withQueryStringParameter("pfForumId", pfForumId); - } - - HttpResponse response = response().withStatusCode(200) - .withContentType(MediaType.TEXT_HTML_UTF_8) - .withBody(responseBody); - - new MockServerClient("127.0.0.1", MOCK_SERVER_PORT) - .when(request, exactly(1)) - .respond(response); - } - - private List getAnswers(String answerPath) { - - List staffDTOList = new LinkedList<>(); - int idx = 1; - while (true) { - try { - String answerStr = readAnswer(answerPath, idx); - staffDTOList.add(objectMapper.readValue(answerStr, TestStaffDTO.class)); - ++idx; - } catch (IOException e) { - return staffDTOList; - } - } - } - } - - @Nested - @DisplayName("실패") - class Fail { - - /* - HTMLParser 실패 테스트 - */ - @Nested - @DisplayName("HTML 구조 달라짐") - class HTMLDiff { - - // 두 번째 교수님 (정의철) 연락처 div 삭제함 - @Test - @DisplayName("RealEstate") - void failByHTMLDiffForRealEstate() throws IOException, URISyntaxException { - - URI uri = new URI(realEstateUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, realEstateDept, realEstateFolderName); - } - - // 첫 번째 교수님 (김선미) 이름 제외 column 없음 - @Test - @DisplayName("Ku") - void failByHTMLDiffForKu() throws IOException, URISyntaxException { - - URI uri = new URI(livingDesignDeptUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, livingDesignDept, livingDesignFolderName); - } - - // 첫 번째 교수님 (신동흔) 첫 번째 dl태그를 d로 바꿈 - @Test - @DisplayName("EachDept") - void failByHTMLDiffForEachDept() throws IOException, URISyntaxException { - - URI uri = new URI(eachDeptUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, koreanDept, koreanFolderName); - } - - private void testTemplate(String requestPath, DeptInfo deptInfo, String folderName) throws IOException { - - // given - createExpectationForHTMLDiff(requestPath, deptInfo instanceof KoreanDept ? deptInfo.getStaffScrapInfo().getProfessorForumId().get(0) : "", folderName); - - // when, then - InternalLogicException e = assertThrows(InternalLogicException.class, () -> staffScraper.scrap(deptInfo)); - assertEquals(ErrorCode.STAFF_SCRAPER_CANNOT_PARSE, e.getErrorCode()); - } - - private void createExpectationForHTMLDiff(String requestPath, String pfForumId, String folderName) throws IOException { - - // 첫 번째 교수님 모든 태그 dd -> dt로 바꿈 - String responseBody = readHTML("staffpages/" + folderName + "/wrong.html"); - - HttpRequest request = request().withMethod("GET").withPath(requestPath); - boolean isEachDept = pfForumId.length() > 0; - if (isEachDept) { - request.withQueryStringParameter("pfForumId", pfForumId); - } - - HttpResponse response = response().withStatusCode(200) - .withContentType(MediaType.TEXT_HTML_UTF_8) - .withBody(responseBody); - - new MockServerClient("127.0.0.1", MOCK_SERVER_PORT) - .when(request, exactly(1)) - .respond(response); - } - } - - @Nested - @DisplayName("API 요청에 대한 잘못된 응답") - class APIError { - - /* - StaffAPIClient 실패 테스트 - */ - @Test - @DisplayName("RealEstate") - void failByAPIErrorForRealEstate() throws URISyntaxException { - - URI uri = new URI(realEstateUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, realEstateDept); - } - - @Test - @DisplayName("Ku") - void failByAPIErrorForKu() throws URISyntaxException { - - URI uri = new URI(livingDesignDeptUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, livingDesignDept); - } - - @Test - @DisplayName("EachDept") - void failByAPIErrorForEachDept() throws URISyntaxException { - - URI uri = new URI(eachDeptUrl); - String requestPath = uri.getPath(); - testTemplate(requestPath, koreanDept); - } - - private void testTemplate(String requestPath, DeptInfo deptInfo) { - - // given - createExpectationForAPIError(requestPath, deptInfo instanceof KoreanDept ? deptInfo.getStaffScrapInfo().getProfessorForumId().get(0) : ""); - - // when, then - InternalLogicException e = assertThrows(InternalLogicException.class, () -> staffScraper.scrap(deptInfo)); - assertEquals(ErrorCode.STAFF_SCRAPER_CANNOT_SCRAP, e.getErrorCode()); - } - - private void createExpectationForAPIError(String requestPath, String pfForumId) { - - HttpRequest request = request().withMethod("GET").withPath(requestPath); - boolean isEachDept = pfForumId.length() > 0; - if (isEachDept) { - request.withQueryStringParameter("pfForumId", pfForumId); - } - - HttpResponse response = response().withStatusCode(404); - - new MockServerClient("127.0.0.1", MOCK_SERVER_PORT) - .when(request, exactly(1)) - .respond(response); - } - } - } - - private String readHTML(String path) throws IOException { - ClassPathResource resource = new ClassPathResource(path); - return resourceToString(resource.getInputStream()); - } - - private String readAnswer(String path, int idx) throws IOException { - ClassPathResource resource = new ClassPathResource(path + "/" + idx + ".json"); - return resourceToString(resource.getInputStream()); - } - - private String resourceToString(InputStream inputStream) throws IOException { - return FileCopyUtils.copyToString(new InputStreamReader(inputStream)); - } - - private boolean compareDTO(StaffDto result, TestStaffDTO answer) { - return (result.getName().equals(answer.getName())) && - (result.getMajor().equals(answer.getMajor())) && - (result.getLab().equals(answer.getLab())) && - (result.getPhone().equals(answer.getPhone())) && - (result.getEmail().equals(answer.getEmail())); - } -} diff --git a/src/test/java/com/kustacks/kuring/worker/parser/dto/TestStaffDTO.java b/src/test/java/com/kustacks/kuring/worker/parser/dto/TestStaffDTO.java deleted file mode 100644 index c98d5e01..00000000 --- a/src/test/java/com/kustacks/kuring/worker/parser/dto/TestStaffDTO.java +++ /dev/null @@ -1,53 +0,0 @@ -package com.kustacks.kuring.worker.parser.dto; - -import com.fasterxml.jackson.annotation.JsonProperty; - -public class TestStaffDTO { - - @JsonProperty("name") - private String name; - - @JsonProperty("major") - private String major; - - @JsonProperty("lab") - private String lab; - - @JsonProperty("phone") - private String phone; - - @JsonProperty("email") - private String email; - - public TestStaffDTO() { - - } - - public TestStaffDTO(String name, String major, String lab, String phone, String email) { - this.name = name; - this.major = major; - this.lab = lab; - this.phone = phone; - this.email = email; - } - - public String getName() { - return name; - } - - public String getMajor() { - return major; - } - - public String getLab() { - return lab; - } - - public String getPhone() { - return phone; - } - - public String getEmail() { - return email; - } -} diff --git a/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java new file mode 100644 index 00000000..eaf42634 --- /dev/null +++ b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java @@ -0,0 +1,113 @@ +package com.kustacks.kuring.worker.scrap; + +import com.kustacks.kuring.support.MockServerSupport; +import com.kustacks.kuring.support.TestFileLoader; +import com.kustacks.kuring.worker.scrap.deptinfo.engineering.ComputerScienceDept; +import com.kustacks.kuring.worker.scrap.deptinfo.real_estate.RealEstateDept; +import com.kustacks.kuring.worker.update.staff.dto.StaffDto; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.DisplayName; +import org.junit.jupiter.api.Test; +import org.mockserver.integration.ClientAndServer; +import org.mockserver.model.HttpRequest; +import org.mockserver.model.HttpResponse; +import org.mockserver.model.MediaType; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.boot.test.context.SpringBootTest; + +import java.io.IOException; +import java.util.List; + +import static org.assertj.core.api.Assertions.assertThat; +import static org.junit.jupiter.api.Assertions.assertAll; + +@DisplayName("교직원 스크랩 테스트") +@SpringBootTest +class StaffScraperTest { + + @Autowired + private StaffScraper staffScraper; + + @Autowired + private ComputerScienceDept computerScienceDept; + + @Autowired + private RealEstateDept realEstateDept; + + private ClientAndServer mockServer; + private final int mockServerPort = 9000; + + @Value("${staff.each-dept-url}") + private String eachDeptUrl; + + @BeforeEach + public void startServer() { + mockServer = ClientAndServer.startClientAndServer(mockServerPort); // 원하는 포트 지정 + } + + @AfterEach + public void stopServer() { + mockServer.stop(); + } + + @DisplayName("컴퓨터공학부 교직원 정보를 스크랩한다.") + @Test + void cseStaffScrapTest() throws IOException { + // given + setUpMockServerWith200Response(buildDeptStaffPageUrl(computerScienceDept.getStaffSiteName(), String.valueOf(computerScienceDept.getStaffSiteIds().get(0))), + TestFileLoader.loadHtmlFile("src/test/resources/staff/cse_staff_page.html") + ); + + // when + List scrapResult = staffScraper.scrap(computerScienceDept); + + // then + assertAll( + () -> assertThat(scrapResult).hasSize(23), + () -> assertThat(scrapResult.get(0).getName()).isEqualTo("김기천 (Keecheon Kim)"), + () -> assertThat(scrapResult.get(0).getPosition()).isEqualTo("교수"), + () -> assertThat(scrapResult.get(0).getMajor()).isEqualTo("Computer Communications and Mobile Computing"), + () -> assertThat(scrapResult.get(0).getLab()).isEqualTo("공C385-2"), + () -> assertThat(scrapResult.get(0).getPhone()).isEqualTo("02-450-3518"), + () -> assertThat(scrapResult.get(0).getEmail()).isEqualTo("kckim@konkuk.ac.kr") + + ); + } + + @DisplayName("부동산학과 교직원 정보를 스크랩한다.") + @Test + void realEstateStaffScrapTest() throws IOException { + // given + setUpMockServerWith200Response(buildDeptStaffPageUrl(realEstateDept.getStaffSiteName(), String.valueOf(realEstateDept.getStaffSiteIds().get(0))), + TestFileLoader.loadHtmlFile("src/test/resources/staff/cse_staff_page.html") + ); + + // when + List scrapResult = staffScraper.scrap(realEstateDept); + + // then + assertAll( + () -> assertThat(scrapResult).hasSize(11), + () -> assertThat(scrapResult.get(0).getName()).isEqualTo("정의철"), + () -> assertThat(scrapResult.get(0).getPosition()).isEqualTo("교수"), + () -> assertThat(scrapResult.get(0).getMajor()).isEqualTo("부동산경제학, 부동산정책론"), + () -> assertThat(scrapResult.get(0).getLab()).isEqualTo("해봉부동산학관 702호"), + () -> assertThat(scrapResult.get(0).getPhone()).isEqualTo("02-450-4069"), + () -> assertThat(scrapResult.get(0).getEmail()).isEqualTo("echung@konkuk.ac.kr") + ); + } + + private String buildDeptStaffPageUrl(String siteName, String siteId) { + return eachDeptUrl + .replaceAll("\\{department\\}", siteName) + .replace("{siteId}", siteId); + } + + private void setUpMockServerWith200Response(String requestPath, String responseBody) { + HttpRequest request = MockServerSupport.getMockRequest("GET", requestPath); + HttpResponse response = MockServerSupport.getMockResponse(200, MediaType.TEXT_HTML_UTF_8, responseBody); + MockServerSupport.createNewMockServer(mockServerPort, request, response); + } +} diff --git a/src/test/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupportTest.java b/src/test/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupportTest.java index c67a5d46..f06d7cc6 100644 --- a/src/test/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupportTest.java +++ b/src/test/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupportTest.java @@ -8,7 +8,6 @@ import org.junit.jupiter.api.Test; import java.util.HashMap; -import java.util.List; import java.util.Map; import static org.assertj.core.api.Assertions.assertThat; @@ -32,56 +31,64 @@ void compareAllDepartments() { .name("김길동") .major("분자생물학") .lab("동물생명과학관") - .phone("010-5678-1234") + .phone("02-5678-1234") .email("life@test.com") .dept("생명과학부") .college("상허생명과학대학") + .position("조교수") .build(); Staff updateStaff = Staff.builder() .name("홍길동") .major("AI") .lab("공과대 A동") - .phone("010-1234-5678") + .phone("02-1234-1234") .email("email@test.com") - .dept("컴퓨터공학과") + .dept("컴퓨터공학부, 스마트ICT융합공학과") .college("공과대학") + .position("조교수") .build(); - originStaffMap.put(updateStaff.getEmail(), updateStaff); - originStaffMap.put(deleteStaff.getEmail(), deleteStaff); + originStaffMap.put(updateStaff.identifier(), updateStaff); + originStaffMap.put(deleteStaff.identifier(), deleteStaff); StaffDto updateStaffDto = StaffDto.builder() .name("홍길동") .major("AI") .lab("공과대 A동") - .phone("010-1234-5678") + .phone("02-1234-5678") .email("email@test.com") .deptName("컴퓨터공학부, 스마트ICT융합공학과") .collegeName("공과대학") + .position("조교수") .build(); StaffDto newStaffDto1 = StaffDto.builder() .name("고길동") .major("발생생물학") .lab("동물생명과학관") - .phone("010-5678-5678") + .phone("02-5678-5678") .email("brain@test.com") .deptName("생명과학부") .collegeName("상허생명과학대학") + .position("명예교수") .build(); StaffDto newStaffDto2 = StaffDto.builder() .name("김샤인") .major("분자생물학") .lab("동물생명과학관") - .phone("010-1111-2222") + .phone("02-1111-2222") .email("molecular@test.com") .deptName("생명과학부") .collegeName("상허생명과학대학") + .position("부교수") .build(); - List staffDtos = List.of(updateStaffDto, newStaffDto1, newStaffDto2); + Map staffDtos = new HashMap<>(); + staffDtos.put(updateStaffDto.identifier(), updateStaffDto); + staffDtos.put(newStaffDto1.identifier(), newStaffDto1); + staffDtos.put(newStaffDto2.identifier(), newStaffDto2); // when StaffCompareResults results = updateSupport.compareAllDepartmentsAndUpdateExistStaff(staffDtos, originStaffMap); @@ -91,7 +98,7 @@ void compareAllDepartments() { () -> assertThat(newStaffDto1.isNotSameInformation(results.newStaffs().get(0))).isFalse(), () -> assertThat(newStaffDto2.isNotSameInformation(results.newStaffs().get(1))).isFalse(), () -> assertThat(deleteStaff).isEqualTo(results.deleteStaffs().get(0)), - () -> assertThat(updateStaff.getDept()).isEqualTo("컴퓨터공학부, 스마트ICT융합공학과") + () -> assertThat(updateStaff.getPhone()).isEqualTo("02-1234-5678") ); } } diff --git a/src/test/java/com/kustacks/kuring/worker/update/staff/StaffUpdaterTest.java b/src/test/java/com/kustacks/kuring/worker/update/staff/StaffUpdaterTest.java index 091a5a15..5e6ba9a9 100644 --- a/src/test/java/com/kustacks/kuring/worker/update/staff/StaffUpdaterTest.java +++ b/src/test/java/com/kustacks/kuring/worker/update/staff/StaffUpdaterTest.java @@ -40,20 +40,22 @@ void compareAndUpdateDb() { .name("홍길동") .major("AI") .lab("공과대 A동") - .phone("010-1234-5678") + .phone("02-1234-5678") .email("email@test.com") .dept("컴퓨터공학과") .college("공과대학") + .position("조교수") .build(); Staff staff2 = Staff.builder() .name("김길동") .major("분자생물학") .lab("동물생명과학관") - .phone("010-5678-1234") + .phone("02-5678-1234") .email("life@test.com") .dept("생명과학부") .college("상허생명과학대학") + .position("교수") .build(); staffRepository.saveAll(List.of(staff1, staff2)); @@ -63,27 +65,28 @@ void compareAndUpdateDb() { .name("홍길동") .major("AI") .lab("공과대 A동") - .phone("010-1234-5678") + .phone("02-1234-5678") .email("email@test.com") .deptName("컴퓨터공학부, 스마트ICT융합공학과") .collegeName("공과대학") + .position("조교수") .build(); StaffDto dto2 = StaffDto.builder() .name("고길동") .major("발생생물학") .lab("동물생명과학관") - .phone("010-5678-5678") + .phone("02-5678-5678") .email("brain@test.com") .deptName("생명과학부") .collegeName("상허생명과학대학") + .position("명예교수") .build(); - kuStaffDtoMap.put(dto1.getEmail(), dto1); - kuStaffDtoMap.put(dto2.getEmail(), dto2); + kuStaffDtoMap.put(dto1.identifier(), dto1); + kuStaffDtoMap.put(dto2.identifier(), dto2); - List successDepartmentNames = List.of("컴퓨터공학과", "생명과학부"); - StaffScrapResults staffScrapResults = new StaffScrapResults(kuStaffDtoMap, successDepartmentNames); + StaffScrapResults staffScrapResults = new StaffScrapResults(kuStaffDtoMap); // when staffDataSynchronizer.compareAndUpdateDb(staffScrapResults); @@ -95,8 +98,9 @@ void compareAndUpdateDb() { () -> assertThat(staffList).extracting("name").contains("홍길동", "고길동"), () -> assertThat(staffList).extracting("major").contains("AI", "발생생물학"), () -> assertThat(staffList).extracting("lab").contains("공과대 A동", "동물생명과학관"), - () -> assertThat(staffList).extracting("phone").contains("010-1234-5678", "010-5678-5678"), - () -> assertThat(staffList).extracting("dept").contains("컴퓨터공학부, 스마트ICT융합공학과", "생명과학부") + () -> assertThat(staffList).extracting("phone").contains("02-1234-5678", "02-5678-5678"), + () -> assertThat(staffList).extracting("dept").contains("컴퓨터공학부, 스마트ICT융합공학과", "생명과학부"), + () -> assertThat(staffList).extracting("position").contains("조교수", "명예교수") ); } diff --git a/src/test/resources/application-test.yml b/src/test/resources/application-test.yml index 6b0fb912..b3f210ee 100644 --- a/src/test/resources/application-test.yml +++ b/src/test/resources/application-test.yml @@ -99,7 +99,4 @@ ip: proxy-list: 14.63.228.239:80, 101.79.15.198:80, 222.104.128.205:8678, 106.244.154.91:8080, 103.51.205.42:8181 staff: - real-estate-url: "http://www.realestate.ac.kr/gb/bbs/board.php?bo_table=faculty" - communication-design-url: "http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_01_tab01.jsp" - living-design-url: "http://www.konkuk.ac.kr/jsp/Coll/coll_01_13_01_05_tab01.jsp" - each-dept-url: "http://home.konkuk.ac.kr/cms/Common/Professor/ProfessorList.do" + each-dept-url: https://{department}.konkuk.ac.kr/{department}/{siteId}/subview.do \ No newline at end of file diff --git a/src/test/resources/staff/cse_staff_page.html b/src/test/resources/staff/cse_staff_page.html new file mode 100644 index 00000000..f536ae30 --- /dev/null +++ b/src/test/resources/staff/cse_staff_page.html @@ -0,0 +1,2927 @@ + + + + + + + 교수진 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
본문 + 바로가기
+
주메뉴 + 바로가기
+
+ + + +
+
+ + +
+ + +
+ + + +
+ + +
+ +
+
+ + + +
+
+ + +
+ + + +
+ + + 건국대학교 + 검색 + +
+ + + + + + +
+ + + + + + SITEMAP +
+
+ + +
+ +
+
+ +

구성원

+ +
+
+ + +
+
+ +
+
    + +
  • + +
  • + + +
  • + +
    + 즐겨찾는 메뉴 + +
    + + +
    +
    +
  • + + +
  • + +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
  • + +
+
+ + + + +
+
+ +
+ + +
+
+
+ +
+

교수진

+
+ + + + + +
+ + + + + +
+ + +
+
+ + + + +
+ /WEB-INF/jsp/k2web/com/cop/site/layout.jsp
+ cse_JW_MS_K2WT001_S +
+ + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/staff/communicationdesign.html b/src/test/resources/staff/legacy/communicationdesign.html similarity index 100% rename from src/test/resources/staff/communicationdesign.html rename to src/test/resources/staff/legacy/communicationdesign.html diff --git a/src/test/resources/staff/computer.html b/src/test/resources/staff/legacy/computer.html similarity index 100% rename from src/test/resources/staff/computer.html rename to src/test/resources/staff/legacy/computer.html diff --git a/src/test/resources/staff/livingdesign.html b/src/test/resources/staff/legacy/livingdesign.html similarity index 100% rename from src/test/resources/staff/livingdesign.html rename to src/test/resources/staff/legacy/livingdesign.html diff --git a/src/test/resources/staff/realestate.html b/src/test/resources/staff/legacy/realestate.html similarity index 100% rename from src/test/resources/staff/realestate.html rename to src/test/resources/staff/legacy/realestate.html diff --git a/src/test/resources/staff/real_estate_staff_page.html b/src/test/resources/staff/real_estate_staff_page.html new file mode 100644 index 00000000..77d9a7bc --- /dev/null +++ b/src/test/resources/staff/real_estate_staff_page.html @@ -0,0 +1,3433 @@ + + + + + + + 교수 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
본문 + 바로가기
+
주메뉴 + 바로가기
+
+ + + +
+
+ + +
+ + +
+ + + +
+ + +
+ +
+
+ + + + + + + + + +
+
+ + +
+ + + +
+ + + 건국대학교 + 검색 + + +
+ + + + + + +
+ + + + + + SITEMAP +
+
+ + +
+ +
+
+ +

교수소개

+ +
+
+ + +
+
+ +
+
    + +
  • + +
  • + + +
  • + +
    + 즐겨찾는 메뉴 + +
    + + +
    +
    +
  • + + +
  • + +
    + +
      +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    • + +
    • +
    +
    +
  • + +
+
+ + + + +
+
+ +
+ + +
+
+
+ +
+

교수

+
+ + + + + +
+ + + + + +
+ + +
+
+ + + + +
+ /WEB-INF/jsp/k2web/com/cop/site/layout.jsp
+ kure_JW_MS_K2WT001_S +
+ + + + + + + + + + + + +
+ + + + +
+ + +
+
+ +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/answers/1.json b/src/test/resources/staffpages/korean/answers/1.json deleted file mode 100644 index 909a0ee9..00000000 --- a/src/test/resources/staffpages/korean/answers/1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "신동흔 ( Shin, Dong-Hun,申東昕 )", - "major": "구비문학론", - "lab": "인문학관 교수연구동 302호", - "email": "shindh@konkuk.ac.kr", - "phone": "02)450-3331" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/answers/2.json b/src/test/resources/staffpages/korean/answers/2.json deleted file mode 100644 index 7c39dfe2..00000000 --- a/src/test/resources/staffpages/korean/answers/2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "고창운 ( Ko, Chang-un,高昌運 )", - "major": "국어학(통사의미론)", - "lab": "인문학관 교수연구동 208호", - "email": "ccuuko@konkuk.ac.kr", - "phone": "02)450-3330" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/answers/3.json b/src/test/resources/staffpages/korean/answers/3.json deleted file mode 100644 index 032b5d25..00000000 --- a/src/test/resources/staffpages/korean/answers/3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "김진기 ( Kim, jin-gi,金進基 )", - "major": "현대소설론", - "lab": "인문학관 교수연구동 303호", - "email": "jingik@konkuk.ac.kr", - "phone": "02)450-3329" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/answers/4.json b/src/test/resources/staffpages/korean/answers/4.json deleted file mode 100644 index 24776cef..00000000 --- a/src/test/resources/staffpages/korean/answers/4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "홍재범 ( Hong Jae Beom,洪在範 )", - "major": "현대희곡 및 시나리오", - "lab": "인문학관 교수연구동 301호", - "email": "luke@konkuk.ac.kr", - "phone": "02)450-3394" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/answers/5.json b/src/test/resources/staffpages/korean/answers/5.json deleted file mode 100644 index 35752fb3..00000000 --- a/src/test/resources/staffpages/korean/answers/5.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "황혜진 ( Hwang Hye Jin,黃惠眞 )", - "major": "고전문학", - "lab": "인문학관 교수연구동 409호", - "email": "jiny@Konkuk.ac.kr", - "phone": "02)450-3340" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/page.html b/src/test/resources/staffpages/korean/page.html deleted file mode 100644 index c9b9206c..00000000 --- a/src/test/resources/staffpages/korean/page.html +++ /dev/null @@ -1,4984 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - -
- -
-
- - - - - -

-About Professor 우리 교수님들을 소개합니다. 언제나 여러분께 최고의 커리큘럼을 제공하기 위해 노력합니다. -

- - - - -
교수소개
- - - - -
- - - -
- -
- -
- -
교수명 : 신동흔 ( Shin, Dong-Hun,申東昕 )
- -
직위 : 교수
- - -
세부전공 : 구비문학론
- -
연구실 : 인문학관 교수연구동 302호
- -
연락처 : 02)450-3331
- -
이메일 : shindh@konkuk.ac.kr
- - -
홈페이지 : http://gubi.co.kr
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 고창운 ( Ko, Chang-un,高昌運 )
- -
직위 : 교수
- - -
세부전공 : 국어학(통사의미론)
- -
연구실 : 인문학관 교수연구동 208호
- -
연락처 : 02)450-3330
- -
이메일 : ccuuko@konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 김진기 ( Kim, jin-gi,金進基 )
- -
직위 : 교수
- - -
세부전공 : 현대소설론
- -
연구실 : 인문학관 교수연구동 303호
- -
연락처 : 02)450-3329
- -
이메일 : jingik@konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 홍재범 ( Hong Jae Beom,洪在範 )
- -
직위 : 교수
- - -
세부전공 : 현대희곡 및 시나리오
- -
연구실 : 인문학관 교수연구동 301호
- -
연락처 : 02)450-3394
- -
이메일 : luke@konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 황혜진 ( Hwang Hye Jin,黃惠眞 )
- -
직위 : 교수
- - -
세부전공 : 고전문학
- -
연구실 : 인문학관 교수연구동 409호
- -
연락처 : 02)450-3340
- -
이메일 : jiny@Konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- - - - - - - - - - - - - -
- - - -
-
- - - - - - - 12 - - - - - - -
- -
- - - - - - - - - - - - - - - - -
- - - - - \ No newline at end of file diff --git a/src/test/resources/staffpages/korean/wrong.html b/src/test/resources/staffpages/korean/wrong.html deleted file mode 100644 index 63fb9d45..00000000 --- a/src/test/resources/staffpages/korean/wrong.html +++ /dev/null @@ -1,4984 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- -
- - - - - - - -
- -
-
- - - - - -

-About Professor 우리 교수님들을 소개합니다. 언제나 여러분께 최고의 커리큘럼을 제공하기 위해 노력합니다. -

- - - - -
교수소개
- - - - -
- - - -
- -
- -
- -
교수명 : 신동흔 ( Shin, Dong-Hun,申東昕 )
- -
직위 : 교수
- - -
세부전공 : 구비문학론
- -
연구실 : 인문학관 교수연구동 302호
- -
연락처 : 02)450-3331
- -
이메일 : shindh@konkuk.ac.kr
- - -
홈페이지 : http://gubi.co.kr
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 고창운 ( Ko, Chang-un,高昌運 )
- -
직위 : 교수
- - -
세부전공 : 국어학(통사의미론)
- -
연구실 : 인문학관 교수연구동 208호
- -
연락처 : 02)450-3330
- -
이메일 : ccuuko@konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 김진기 ( Kim, jin-gi,金進基 )
- -
직위 : 교수
- - -
세부전공 : 현대소설론
- -
연구실 : 인문학관 교수연구동 303호
- -
연락처 : 02)450-3329
- -
이메일 : jingik@konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 홍재범 ( Hong Jae Beom,洪在範 )
- -
직위 : 교수
- - -
세부전공 : 현대희곡 및 시나리오
- -
연구실 : 인문학관 교수연구동 301호
- -
연락처 : 02)450-3394
- -
이메일 : luke@konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- -
- -
- -
교수명 : 황혜진 ( Hwang Hye Jin,黃惠眞 )
- -
직위 : 교수
- - -
세부전공 : 고전문학
- -
연구실 : 인문학관 교수연구동 409호
- -
연락처 : 02)450-3340
- -
이메일 : jiny@Konkuk.ac.kr
- - -
홈페이지 : -
- - - -
- 상세보기
- -
- - -
- - - - - - - - - - - - - -
- - - -
-
- - - - - - - 12 - - - - - - -
- -
- - - - - - - - - - - - - - - - -
- - - - - \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/answers/1.json b/src/test/resources/staffpages/living_design/answers/1.json deleted file mode 100644 index 9a8449e4..00000000 --- a/src/test/resources/staffpages/living_design/answers/1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "김선미", - "major": "텍스타일디자인", - "lab": "예술문화관 507호", - "email": "cemi@konkuk.ac.kr", - "phone": "02-450-3790" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/answers/2.json b/src/test/resources/staffpages/living_design/answers/2.json deleted file mode 100644 index 65b5c07f..00000000 --- a/src/test/resources/staffpages/living_design/answers/2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "이필하", - "major": "섬유미술", - "lab": "예술문화관 504호", - "email": "imphil@konkuk.ac.kr", - "phone": "02-2049-6015" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/answers/3.json b/src/test/resources/staffpages/living_design/answers/3.json deleted file mode 100644 index a088998a..00000000 --- a/src/test/resources/staffpages/living_design/answers/3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "김성달", - "major": "텍스타일디자인", - "lab": "예술문화관 505호", - "email": "dahlkim@naver.com", - "phone": "02-450-3732" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/answers/4.json b/src/test/resources/staffpages/living_design/answers/4.json deleted file mode 100644 index 29989de4..00000000 --- a/src/test/resources/staffpages/living_design/answers/4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "이하린", - "major": "도자공예", - "lab": "예술문화관 506호", - "email": "fredmizer@naver.com", - "phone": "02-450-3796" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/answers/5.json b/src/test/resources/staffpages/living_design/answers/5.json deleted file mode 100644 index b404d34d..00000000 --- a/src/test/resources/staffpages/living_design/answers/5.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "황선욱", - "major": "금속공예", - "lab": "예술문화관 519호", - "email": "renerary@hanmail.net", - "phone": "02-2049-6032" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/page.html b/src/test/resources/staffpages/living_design/page.html deleted file mode 100644 index cc71da35..00000000 --- a/src/test/resources/staffpages/living_design/page.html +++ /dev/null @@ -1,1282 +0,0 @@ - - - - - -건국대학교 - 창조적 혁신으로 미래를 선도하는 대학 - - - - - -
-
- -
- - - - - - - - -
- 전체메뉴보기 - - - -
- -
- - 닫기 -
-
- - -
-
-

건국대학교

-
-

상단메뉴 목록

- - GLOCAL 캠퍼스 - 건국대병원 - 건국대충주병원 - - - - - - -
- - - -
- - - - - - - -
-
- -
-

주메뉴 목록

- - 전체 메뉴 한눈에 보기 - -
- -
- - - - - - -
- -
-
창조적 혁신으로 미래를 선도하는 대학 A history of leadership
-
- -
- -
- -
- -
-
- - - -

대학/대학원

-
- -
-
-
-
- -
    -
  • HOME
  • -
  • 대학/대학원 > 대학 > 예술디자인대학 > 리빙디자인학과
  • -
- -

예술디자인대학리빙디자인학과

-

생활문화 복지와 창의적 예술활동을 지향합니다.

-
- -
- - - - - - -
-
    -
  • 학과소개
  • -
  • 교과과정
  • -
  • 진로안내
  • -
-
- - -
-
-
-
-
- - - -
-
-
-
- -

학과소개

-

리빙디자인(Living Design)학과는 생활 문화를 풍요롭게 하기 위해 주거(住居) 공간과 신변(身邊) 장식에 적용되는 다양한 재료와 제품, 디자인과 공예, 아트 장르의 융복합을 연구하는 통합디자인의 한 분야이다.

- -

교육목표

-

실용성과 미적 만족을 동시에 높이는 것을 목적으로 라이프스타일 전반의 이슈를 다루어 시대적 가치를 반영한 고부가가치 콘텐츠와 생활 제품디자인을 연구한다. 리빙디자인에 적용되는 주요 매체(금속, 도자, 섬유)를 기반으로 다양한 재료(나무, 가죽 및 신소재 등)와 기법의 학제적 접근에 기초한 폭넓은 조형교육을 통하여 생활 속에서 조형적 가치를 실현할 수 있는 창의적이고 전문적인 리빙디자이너 및 디렉터 양성을 목표로 한다.

- - - - - - - -

교수소개

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
교수명전공연구실연락처E-mail
- - 김선미 - - 텍스타일디자인예술문화관 507호02-450-3790cemi@konkuk.ac.kr
- - 이필하 - - 섬유미술예술문화관 504호02-2049-6015imphil@konkuk.ac.kr
- - 김성달 - - 텍스타일디자인예술문화관 505호02-450-3732dahlkim@naver.com
- - 이하린 - - 도자공예예술문화관 506호02-450-3796fredmizer@naver.com
- - 황선욱 - - 금속공예예술문화관 519호02-2049-6032renerary@hanmail.net
- - - -
- -
-
  • 프린트하기
-
- -
- - - -
- -
- - \ No newline at end of file diff --git a/src/test/resources/staffpages/living_design/wrong.html b/src/test/resources/staffpages/living_design/wrong.html deleted file mode 100644 index f32fa4c4..00000000 --- a/src/test/resources/staffpages/living_design/wrong.html +++ /dev/null @@ -1,1282 +0,0 @@ - - - - - -건국대학교 - 창조적 혁신으로 미래를 선도하는 대학 - - - - - -
-
- -
- - - - - - - - -
- 전체메뉴보기 - - - -
- -
- - 닫기 -
-
- - -
-
-

건국대학교

-
-

상단메뉴 목록

- - GLOCAL 캠퍼스 - 건국대병원 - 건국대충주병원 - - - - - - -
- - - -
- - - - - - - -
-
- -
-

주메뉴 목록

- - 전체 메뉴 한눈에 보기 - -
- -
- - - - - - -
- -
-
창조적 혁신으로 미래를 선도하는 대학 A history of leadership
-
- -
- -
- -
- -
-
- - - -

대학/대학원

-
- -
-
-
-
- -
    -
  • HOME
  • -
  • 대학/대학원 > 대학 > 예술디자인대학 > 리빙디자인학과
  • -
- -

예술디자인대학리빙디자인학과

-

생활문화 복지와 창의적 예술활동을 지향합니다.

-
- -
- - - - - - -
-
    -
  • 학과소개
  • -
  • 교과과정
  • -
  • 진로안내
  • -
-
- - -
-
-
-
-
- - - -
-
-
-
- -

학과소개

-

리빙디자인(Living Design)학과는 생활 문화를 풍요롭게 하기 위해 주거(住居) 공간과 신변(身邊) 장식에 적용되는 다양한 재료와 제품, 디자인과 공예, 아트 장르의 융복합을 연구하는 통합디자인의 한 분야이다.

- -

교육목표

-

실용성과 미적 만족을 동시에 높이는 것을 목적으로 라이프스타일 전반의 이슈를 다루어 시대적 가치를 반영한 고부가가치 콘텐츠와 생활 제품디자인을 연구한다. 리빙디자인에 적용되는 주요 매체(금속, 도자, 섬유)를 기반으로 다양한 재료(나무, 가죽 및 신소재 등)와 기법의 학제적 접근에 기초한 폭넓은 조형교육을 통하여 생활 속에서 조형적 가치를 실현할 수 있는 창의적이고 전문적인 리빙디자이너 및 디렉터 양성을 목표로 한다.

- - - - - - - -

교수소개

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
교수명전공연구실연락처E-mail
- - - 김선미 - 텍스타일디자인예술문화관 507호02-450-3790cemi@konkuk.ac.kr
- - 이필하 - - 섬유미술예술문화관 504호02-2049-6015imphil@konkuk.ac.kr
- - 김성달 - - 텍스타일디자인예술문화관 505호02-450-3732dahlkim@naver.com
- - 이하린 - - 도자공예예술문화관 506호02-450-3796fredmizer@naver.com
- - 황선욱 - - 금속공예예술문화관 519호02-2049-6032renerary@hanmail.net
- - - -
- -
-
  • 프린트하기
-
- -
- - - -
- -
- - \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/1.json b/src/test/resources/staffpages/real_estate/answers/1.json deleted file mode 100644 index 911058e6..00000000 --- a/src/test/resources/staffpages/real_estate/answers/1.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "손재영", - "major": "부동산경제, 부동산정책", - "lab": "해봉부동산학관 601호", - "email": "jyson@konkuk.ac.kr", - "phone": "02-450-3587" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/10.json b/src/test/resources/staffpages/real_estate/answers/10.json deleted file mode 100644 index 95f69630..00000000 --- a/src/test/resources/staffpages/real_estate/answers/10.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "노승한", - "major": "부동산자산관리, 부동산투자", - "lab": "해봉부동산학관 701호", - "email": "shro@konkuk.ac.kr", - "phone": "02-450-0540" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/11.json b/src/test/resources/staffpages/real_estate/answers/11.json deleted file mode 100644 index 3f3112f4..00000000 --- a/src/test/resources/staffpages/real_estate/answers/11.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "전재식", - "major": "부동산정책, 주거복지, 공간분석", - "lab": "해봉부동산학관 503호", - "email": "jaesikjeon@konkuk.ac.kr", - "phone": "02-450-3586" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/2.json b/src/test/resources/staffpages/real_estate/answers/2.json deleted file mode 100644 index 6739a43f..00000000 --- a/src/test/resources/staffpages/real_estate/answers/2.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "정의철", - "major": "부동산경제학, 부동산정책론", - "lab": "해봉부동산학관 702호", - "email": "echung@konkuk.ac.kr", - "phone": "02-450-4069" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/3.json b/src/test/resources/staffpages/real_estate/answers/3.json deleted file mode 100644 index bd7e055f..00000000 --- a/src/test/resources/staffpages/real_estate/answers/3.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "고성수", - "major": "부동산금융론, 재무관리", - "lab": "해봉부동산학관 506호", - "email": "sskoh@konkuk.ac.kr", - "phone": "02-450-4068" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/4.json b/src/test/resources/staffpages/real_estate/answers/4.json deleted file mode 100644 index f3a1a252..00000000 --- a/src/test/resources/staffpages/real_estate/answers/4.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "이현석", - "major": "부동산개발, 개발금융, 도시계획", - "lab": "해봉부동산학관 606호", - "email": "hsl3@konkuk.ac.kr", - "phone": "02-450-4203" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/5.json b/src/test/resources/staffpages/real_estate/answers/5.json deleted file mode 100644 index 2e0796f4..00000000 --- a/src/test/resources/staffpages/real_estate/answers/5.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "신종칠", - "major": "부동산 마케팅, 부동산 시장조사", - "lab": "해봉부동산학관 605호", - "email": "jcshin@konkuk.ac.kr", - "phone": "02-450-4202" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/6.json b/src/test/resources/staffpages/real_estate/answers/6.json deleted file mode 100644 index 25c99483..00000000 --- a/src/test/resources/staffpages/real_estate/answers/6.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "이상엽", - "major": "의사결정, 건설경영, 시설관리", - "lab": "해봉부동산학관 706호", - "email": "sangyoub@konkuk.ac.kr", - "phone": "02-2049-6046" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/7.json b/src/test/resources/staffpages/real_estate/answers/7.json deleted file mode 100644 index 3e793a54..00000000 --- a/src/test/resources/staffpages/real_estate/answers/7.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "유선종", - "major": "부동산학원론, 감정평가, 부동산경매", - "lab": "해봉부동산학관 602호", - "email": "yoosj@konkuk.ac.kr", - "phone": "02-2049-6063" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/8.json b/src/test/resources/staffpages/real_estate/answers/8.json deleted file mode 100644 index 529d11c9..00000000 --- a/src/test/resources/staffpages/real_estate/answers/8.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "심교언", - "major": "도시공학, 부동산개발", - "lab": "해봉부동산학관 502호", - "email": "x1000@konkuk.ac.kr", - "phone": "02-450-3557" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/answers/9.json b/src/test/resources/staffpages/real_estate/answers/9.json deleted file mode 100644 index cc2d0182..00000000 --- a/src/test/resources/staffpages/real_estate/answers/9.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "name": "신승우", - "major": "부동산 금융 및 투자", - "lab": "해봉부동산학관 604호", - "email": "ss244@konkuk.ac.kr", - "phone": "02-450-3553" -} \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/page.html b/src/test/resources/staffpages/real_estate/page.html deleted file mode 100644 index 4abfedc1..00000000 --- a/src/test/resources/staffpages/real_estate/page.html +++ /dev/null @@ -1,574 +0,0 @@ - - - - - - -교수진 1 페이지 | 건국대학교 부동산학과 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - -
-
-

Faculty

-

교수진

-
- -
- -
-

교수진

-

Home > 교수진 > 교수진

- -
-
    -
-
- - -
- -
- -
- -
-

명예 교수진

- -
-
    -
    - - -
    - -
    - -
    - - - -
    -
    - - - - - - - - - - - - -
    -
    -
    - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/src/test/resources/staffpages/real_estate/wrong.html b/src/test/resources/staffpages/real_estate/wrong.html deleted file mode 100644 index 7c7afb2d..00000000 --- a/src/test/resources/staffpages/real_estate/wrong.html +++ /dev/null @@ -1,574 +0,0 @@ - - - - - - -교수진 1 페이지 | 건국대학교 부동산학과 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
    - - -
    -
    -

    Faculty

    -

    교수진

    -
    - -
    - -
    -

    교수진

    -

    Home > 교수진 > 교수진

    - -
    -
      -
    -
    - - -
    - -
    - -
    - -
    -

    명예 교수진

    - -
    -
      -
      - - -
      - -
      - -
      - - - -
      -
      - - - - - - - - - - - - -
      -
      -
      - - - - - - - - - - - - - - - - - - - \ No newline at end of file