From cdab7ff0aaa2a69c061f05ee82f4532c3caaf289 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 00:53:38 +0900 Subject: [PATCH 01/48] =?UTF-8?q?fix=20:=20=EA=B5=90=EC=A7=81=EC=9B=90=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=ED=95=A0=20=ED=8E=98=EC=9D=B4?= =?UTF-8?q?=EC=A7=80=20base=20url=20=EB=B3=80=EA=B2=BD(=ED=95=99=EA=B3=BC?= =?UTF-8?q?=20=ED=99=88=ED=8E=98=EC=9D=B4=EC=A7=80)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/resources/application-dev.yml | 5 +---- src/main/resources/application-local.yml | 5 +---- src/main/resources/application-prod.yml | 5 +---- 3 files changed, 3 insertions(+), 12 deletions(-) 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 From 48a182e633465e4433a712fe5dd09df45884bb5a Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 00:54:54 +0900 Subject: [PATCH 02/48] =?UTF-8?q?remove=20:=20=EB=A6=AC=EB=B9=99=EB=94=94?= =?UTF-8?q?=EC=9E=90=EC=9D=B8,=20=EC=BB=A4=EB=AE=A4=EB=8B=88=EC=BC=80?= =?UTF-8?q?=EC=9D=B4=EC=85=98=20=EB=94=94=EC=9E=90=EC=9D=B8=20=ED=8C=8C?= =?UTF-8?q?=EC=84=9C=20=EC=82=AD=EC=A0=9C(=EB=AF=B8=EC=82=AC=EC=9A=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...AndCommunicationDesignStaffHtmlParser.java | 37 ------------------- 1 file changed, 37 deletions(-) delete mode 100644 src/main/java/com/kustacks/kuring/worker/parser/staff/LivingAndCommunicationDesignStaffHtmlParser.java 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}; - } -} From 39d0b7c89bc33fbbd8479c7cfa8cdcaa44d79f7b Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 00:56:22 +0900 Subject: [PATCH 03/48] =?UTF-8?q?fix=20:=20=ED=95=99=EA=B3=BC=20=EA=B5=90?= =?UTF-8?q?=EC=A7=81=EC=9B=90=20=ED=8E=98=EC=9D=B4=EC=A7=80=20=ED=8C=8C?= =?UTF-8?q?=EC=84=9C=20=EC=88=98=EC=A0=95(=EB=B6=80=EB=8F=99=EC=82=B0=20?= =?UTF-8?q?=ED=95=99=EA=B3=BC=20=EC=A0=9C=EC=99=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/staff/EachDeptStaffHtmlParser.java | 35 ++++++------------- 1 file changed, 11 insertions(+), 24 deletions(-) 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}; } } From 7d1e6db2616c22a493edcfe744c3bd8037054522 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 00:56:33 +0900 Subject: [PATCH 04/48] =?UTF-8?q?fix=20:=20=EB=B6=80=EB=8F=99=EC=82=B0=20?= =?UTF-8?q?=ED=95=99=EA=B3=BC=20=ED=8C=8C=EC=8B=B1=EB=A1=9C=EC=A7=81=20?= =?UTF-8?q?=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../staff/RealEstateStaffHtmlParser.java | 28 +++++++++---------- 1 file changed, 14 insertions(+), 14 deletions(-) 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..413b1256 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 @@ -7,6 +7,9 @@ import org.jsoup.select.Elements; import org.springframework.stereotype.Component; +import java.util.HashMap; +import java.util.Map; + @Component public class RealEstateStaffHtmlParser extends StaffHtmlParserTemplate { @@ -14,23 +17,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}; } } + From 8db54c625999e60cd97269df68e36bf5333bea47 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:01:22 +0900 Subject: [PATCH 05/48] =?UTF-8?q?feat=20:=20=EA=B5=90=EC=A7=81=EC=9B=90=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=EC=8B=9C=20=ED=95=84=EC=9A=94?= =?UTF-8?q?=ED=95=9C=20=EC=A0=95=EB=B3=B4=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/scrap/deptinfo/StaffScrapInfo.java | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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; } } From 9c64b736612ff7992924c6a02d8645a26480e6a2 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:09:00 +0900 Subject: [PATCH 06/48] =?UTF-8?q?feat=20:=20=EC=A0=84=EC=B2=B4=20=ED=95=99?= =?UTF-8?q?=EA=B3=BC=20siteId,=20siteName=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../scrap/deptinfo/architecture/ArchitectureDept.java | 4 ++-- .../worker/scrap/deptinfo/art_design/ApparelDesignDept.java | 4 ++-- .../scrap/deptinfo/art_design/CommunicationDesignDept.java | 4 ++-- .../scrap/deptinfo/art_design/ContemporaryArtDept.java | 4 ++-- .../scrap/deptinfo/art_design/IndustrialDesignDept.java | 4 ++-- .../worker/scrap/deptinfo/art_design/LivingDesignDept.java | 4 ++-- .../scrap/deptinfo/art_design/MovingImageFilmDept.java | 4 ++-- .../scrap/deptinfo/business/BusinessAdministrationDept.java | 4 ++-- .../scrap/deptinfo/business/TechnologicalBusinessDept.java | 4 ++-- .../worker/scrap/deptinfo/education/EducationDept.java | 4 ++-- .../scrap/deptinfo/education/EducationalTechnologyDept.java | 4 ++-- .../scrap/deptinfo/education/EnglishEducationDept.java | 4 ++-- .../scrap/deptinfo/education/JapaneseLanguageDept.java | 4 ++-- .../scrap/deptinfo/education/MathematicsEducationDept.java | 4 ++-- .../worker/scrap/deptinfo/education/MusicEducationDept.java | 4 ++-- .../scrap/deptinfo/education/PhysicalEducationDept.java | 4 ++-- .../deptinfo/engineering/AdvancedIndustrialFusionDept.java | 4 ++-- .../worker/scrap/deptinfo/engineering/BiologicalDept.java | 4 ++-- .../scrap/deptinfo/engineering/ChemicalDivisionDept.java | 4 ++-- .../scrap/deptinfo/engineering/CivilEnvironmentDept.java | 4 ++-- .../scrap/deptinfo/engineering/ComputerScienceDept.java | 4 ++-- .../deptinfo/engineering/ElectricalElectronicsDept.java | 4 ++-- .../worker/scrap/deptinfo/engineering/IndustrialDept.java | 4 ++-- .../deptinfo/engineering/KBeautyIndustryFusionDept.java | 4 ++-- .../scrap/deptinfo/engineering/MechanicalAerospaceDept.java | 4 ++-- .../ku_integrated_science/BioMedicalScienceDept.java | 4 ++-- .../scrap/deptinfo/ku_integrated_science/CosmeticsDept.java | 4 ++-- .../scrap/deptinfo/ku_integrated_science/EnergyDept.java | 4 ++-- .../IntergrativeBioscienceBiotechnologyDept.java | 4 ++-- .../ku_integrated_science/SmartIctConvergenceDept.java | 4 ++-- .../deptinfo/ku_integrated_science/SmartVehicleDept.java | 4 ++-- .../StemCellRegenerativeBioTechnologyDept.java | 4 ++-- .../ku_integrated_science/SystemBiotechnologyDept.java | 4 ++-- .../worker/scrap/deptinfo/liberal_art/ChineseDept.java | 4 ++-- .../scrap/deptinfo/liberal_art/CultureContentDept.java | 4 ++-- .../worker/scrap/deptinfo/liberal_art/EnglishDept.java | 4 ++-- .../worker/scrap/deptinfo/liberal_art/GeologyDept.java | 4 ++-- .../worker/scrap/deptinfo/liberal_art/HistoryDept.java | 4 ++-- .../worker/scrap/deptinfo/liberal_art/KoreanDept.java | 4 ++-- .../scrap/deptinfo/liberal_art/MediaCommunicationDept.java | 4 ++-- .../worker/scrap/deptinfo/liberal_art/PhilosophyDept.java | 4 ++-- .../worker/scrap/deptinfo/real_estate/RealEstateDept.java | 4 ++-- .../AnimalResourcesFoodScienceBiotechnologyDept.java | 4 ++-- .../sanghuo_biology/AnimalScienceTechnologyDept.java | 4 ++-- .../deptinfo/sanghuo_biology/BiologicalSciencesDept.java | 4 ++-- .../scrap/deptinfo/sanghuo_biology/CropScienceDept.java | 4 ++-- .../sanghuo_biology/EnvironmentalHealthScienceDept.java | 4 ++-- .../deptinfo/sanghuo_biology/FoodMarketingSafetyDept.java | 4 ++-- .../sanghuo_biology/ForestryLandscapeArchitectureDept.java | 4 ++-- .../sanghuo_elective/ElectiveEducationCenterDept.java | 4 ++-- .../deptinfo/sanghuo_elective/VolunteerCenterDept.java | 5 ++--- .../kuring/worker/scrap/deptinfo/science/ChemicalsDept.java | 4 ++-- .../worker/scrap/deptinfo/science/MathematicsDept.java | 4 ++-- .../kuring/worker/scrap/deptinfo/science/PhysicsDept.java | 4 ++-- .../deptinfo/social_science/AppliedStatisticsDept.java | 4 ++-- .../worker/scrap/deptinfo/social_science/EconomicsDept.java | 4 ++-- .../scrap/deptinfo/social_science/GlobalBusinessDept.java | 4 ++-- .../social_science/InterDisciplinaryStudiesDept.java | 4 ++-- .../deptinfo/social_science/InternationalTradeDept.java | 4 ++-- .../scrap/deptinfo/social_science/PoliticalScienceDept.java | 4 ++-- .../deptinfo/social_science/PublicAdministrationDept.java | 4 ++-- .../veterinary_medicine/VeterinaryMedicineDept.java | 6 +++--- 62 files changed, 125 insertions(+), 126 deletions(-) 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..753f8ee9 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 @@ -23,8 +23,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..78caf0c7 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 @@ -7,6 +7,7 @@ import com.kustacks.kuring.worker.scrap.deptinfo.RegisterDepartmentMap; import com.kustacks.kuring.worker.scrap.deptinfo.StaffScrapInfo; +import java.util.ArrayList; import java.util.List; import static com.kustacks.kuring.notice.domain.DepartmentName.VET_MEDICINE; @@ -23,9 +24,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, 11136); + this.staffScrapInfo = new StaffScrapInfo(VET_MEDICINE.getHostPrefix(), siteIds); this.noticeScrapInfo = new NoticeScrapInfo(VET_MEDICINE.getHostPrefix(), 948); this.departmentName = VET_MEDICINE; } From 0fd0dc8615dc17a886132b3017e408c7df465b10 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:09:56 +0900 Subject: [PATCH 07/48] =?UTF-8?q?feat=20:=20=EA=B5=90=EC=A7=81=EC=9B=90=20?= =?UTF-8?q?=EC=A0=95=EB=B3=B4=20=EC=A7=80=EC=9B=90=20=EC=9C=A0=EB=AC=B4=20?= =?UTF-8?q?=EA=B2=80=EC=A6=9D=EC=9D=84=20=EC=9C=84=ED=95=9C=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/scrap/deptinfo/DeptInfo.java | 4 ++++ 1 file changed, 4 insertions(+) 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..8836d4f9 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 @@ -65,6 +65,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(); From 28a7557166da88be422c8dfcc3eb7fe22f58a607 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:10:14 +0900 Subject: [PATCH 08/48] =?UTF-8?q?feat=20:=20siteId,=20siteName=20=ED=95=84?= =?UTF-8?q?=EB=93=9C=EA=B0=92=20=EC=B6=94=EA=B0=80=EB=A1=9C=20=EC=9D=B8?= =?UTF-8?q?=ED=95=9C=20getter=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kustacks/kuring/worker/scrap/deptinfo/DeptInfo.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) 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 8836d4f9..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) { From 961b896dc3bfaba9a319296e8573da2abb5682f3 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:11:31 +0900 Subject: [PATCH 09/48] =?UTF-8?q?remove=20:=20=EA=B5=90=EC=A7=81=EC=9B=90?= =?UTF-8?q?=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20API=20Client=20=ED=86=B5?= =?UTF-8?q?=ED=95=A9=EC=97=90=20=EB=94=B0=EB=A5=B8=20=EB=AF=B8=EC=82=AC?= =?UTF-8?q?=EC=9A=A9=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...gAndCommunicationDesignStaffApiClient.java | 61 ------------------- .../staff/RealEstateStaffApiClient.java | 52 ---------------- 2 files changed, 113 deletions(-) delete mode 100644 src/main/java/com/kustacks/kuring/worker/scrap/client/staff/LivingAndCommunicationDesignStaffApiClient.java delete mode 100644 src/main/java/com/kustacks/kuring/worker/scrap/client/staff/RealEstateStaffApiClient.java 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(); - } -} From fd4025e0d2021247b8b202ec00f8f7ec43ce3bce Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:12:41 +0900 Subject: [PATCH 10/48] =?UTF-8?q?feat=20:=20=ED=95=99=EA=B3=BC=20=EA=B5=90?= =?UTF-8?q?=EC=A7=81=EC=9B=90=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20API=20Client?= =?UTF-8?q?=20=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../client/staff/EachDeptStaffApiClient.java | 47 +++++-------------- 1 file changed, 11 insertions(+), 36 deletions(-) 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..d46e486f 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,30 @@ public EachDeptStaffApiClient(NormalJsoupClient normalJsoupClient) { this.jsoupClient = normalJsoupClient; } + /* + TODO: 만약, 학과별로 다른 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 +58,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.replaceAll("\\{department\\}", department) + .replace("{siteId}", String.valueOf(siteId)); } } From cca4bd4b9618cc00fd289324c9a41f20cc6668ce Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:13:00 +0900 Subject: [PATCH 11/48] =?UTF-8?q?feat=20:=20=EA=B5=90=EC=A7=81=EC=9B=90=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EA=B3=BC=EC=A0=95=20=EA=B0=84=20?= =?UTF-8?q?=EC=A7=81=EC=9C=84=EC=A0=95=EB=B3=B4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/scrap/StaffScraper.java | 26 ++++++++++++++++--- .../worker/update/staff/dto/StaffDto.java | 16 +++++++++--- 2 files changed, 34 insertions(+), 8 deletions(-) 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..1ee937ac 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -12,6 +12,7 @@ import org.springframework.retry.annotation.Retryable; import org.springframework.stereotype.Component; +import java.util.Arrays; import java.util.List; @Slf4j @@ -60,16 +61,33 @@ 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(convertFullExtensionNumber(oneStaffInfo[4])) + .email(oneStaffInfo[5]) .deptName(deptInfo.getDeptName()) .collegeName(deptInfo.getCollegeName() ).build() ).toList(); } + private static String convertFullExtensionNumber(String number) { + if (number == null || number.isBlank()) { + return ""; + } + if (number.matches("\\d{4}")) { + return "02-450-" + number; + } + if (number.matches("02-450-\\d{4}")) { + return number; + } + if (number.matches("02[)].*-\\d{4}")) { + return number.replace(")", "-"); + } + return number; + } + private StaffHtmlParserTemplate findHtmlParser(DeptInfo deptInfo) { return htmlParsers.stream() .filter(htmlParser -> htmlParser.support(deptInfo)) 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..d70d0779 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 @@ -5,6 +5,7 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; +import lombok.ToString; import java.util.Objects; @@ -26,8 +27,10 @@ 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; @@ -35,6 +38,7 @@ private StaffDto(String name, String major, String lab, String phone, String ema this.email = email; this.deptName = deptName; this.collegeName = collegeName; + this.position = position; } public boolean isNotSameInformation(Staff staff) { @@ -44,7 +48,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,7 +60,9 @@ public Staff toEntity() { .phone(phone) .email(email) .dept(deptName) - .college(collegeName).build(); + .college(collegeName) + .position(position) + .build(); } public void setDeptName(String deptName) { @@ -73,7 +80,8 @@ 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 From c8c22e18b6701c492d60dd1c58d5eea052861745 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:14:31 +0900 Subject: [PATCH 12/48] =?UTF-8?q?feat=20:=20StaffUpdater=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=9E=A9=20=EB=A1=9C=EC=A7=81=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/update/staff/StaffUpdater.java | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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..b69a5d63 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 @@ -44,10 +44,11 @@ private StaffScrapResults scrapAllDepartmentsStaffs() { Map kuStaffDtoMap = new HashMap<>(); List successDepartmentNames = new LinkedList<>(); - for (DeptInfo deptInfo : deptInfos) { - scrapSingleDepartmentsStaffs(kuStaffDtoMap, successDepartmentNames, deptInfo); - } - + deptInfos.stream() + .filter(DeptInfo::isSupportStaffScrap) + .forEach(deptInfo -> { + scrapSingleDepartmentsStaffs(kuStaffDtoMap, successDepartmentNames, deptInfo); + }); return new StaffScrapResults(kuStaffDtoMap, successDepartmentNames); } From a20e5dec963e65db83147b9c312038f031a68708 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:14:59 +0900 Subject: [PATCH 13/48] =?UTF-8?q?feat=20:=20=EC=88=98=EC=9D=98=EC=98=88?= =?UTF-8?q?=EA=B3=BC,=20=EC=88=98=EC=9D=98=ED=95=99=EA=B3=BC=20=EC=A4=91?= =?UTF-8?q?=EB=B3=B5=20=EA=B5=90=EC=A7=81=EC=9B=90=20=EC=A0=95=EB=B3=B4=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0=EB=A5=BC=20=EC=9C=84=ED=95=9C=20distinct?= =?UTF-8?q?=EC=B2=98=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/update/staff/StaffUpdater.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 b69a5d63..08d5babc 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 @@ -69,7 +69,8 @@ private Map scrapStaffByDepartment(DeptInfo deptInfo) { private Map convertStaffDtoMap(List scrapedStaffDtos) { return scrapedStaffDtos.stream() - .collect(Collectors.toMap(StaffDto::getEmail, staffDto -> staffDto)); + .distinct() + .collect(Collectors.toMap(staffDto -> staffDto.getName()+staffDto.getEmail()+staffDto.getDeptName(), staffDto -> staffDto)); } private void mergeForMultipleDepartmentsStaff( From 5c915ee1d75ee2e26b36a313c6f3cb9ca91d1354 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:16:03 +0900 Subject: [PATCH 14/48] =?UTF-8?q?feat=20:=20test=EC=9A=A9=20html=20?= =?UTF-8?q?=ED=8C=8C=EC=9D=BC=20=EC=B6=94=EA=B0=80(=EC=BB=B4=ED=93=A8?= =?UTF-8?q?=ED=84=B0=EA=B3=B5=ED=95=99=EB=B6=80,=20=EB=B6=80=EB=8F=99?= =?UTF-8?q?=EC=82=B0=ED=95=99=EA=B3=BC)=20=EB=B0=8F=20legacy=20=ED=8C=8C?= =?UTF-8?q?=EC=9D=BC=20=EC=9D=B4=EB=8F=99?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/test/resources/application-test.yml | 5 +- src/test/resources/staff/cse_staff_page.html | 2927 ++++++++++++++ .../{ => legacy}/communicationdesign.html | 0 .../staff/{ => legacy}/computer.html | 0 .../staff/{ => legacy}/livingdesign.html | 0 .../staff/{ => legacy}/realestate.html | 0 .../staff/real_estate_staff_page.html | 3433 +++++++++++++++++ 7 files changed, 6361 insertions(+), 4 deletions(-) create mode 100644 src/test/resources/staff/cse_staff_page.html rename src/test/resources/staff/{ => legacy}/communicationdesign.html (100%) rename src/test/resources/staff/{ => legacy}/computer.html (100%) rename src/test/resources/staff/{ => legacy}/livingdesign.html (100%) rename src/test/resources/staff/{ => legacy}/realestate.html (100%) create mode 100644 src/test/resources/staff/real_estate_staff_page.html 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 From f6bc03e4ab92f6daa8d517e8db96e37b64004382 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 01:17:09 +0900 Subject: [PATCH 15/48] =?UTF-8?q?test=20:=20=ED=95=99=EA=B3=BC=20=EA=B5=90?= =?UTF-8?q?=EC=A7=81=EC=9B=90=20=EC=A0=95=EB=B3=B4=20=EC=8A=A4=ED=81=AC?= =?UTF-8?q?=EB=9E=A9=20=EB=A1=9C=EC=A7=81=20=ED=85=8C=EC=8A=A4=ED=8A=B8?= =?UTF-8?q?=EC=BD=94=EB=93=9C=20=EC=9E=91=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../parser/StaffHtmlParserTemplateTest.java | 111 +++++++----------- 1 file changed, 45 insertions(+), 66 deletions(-) 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..11ce1624 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; @@ -16,63 +15,13 @@ import static org.assertj.core.api.Assertions.tuple; import static org.junit.jupiter.api.Assertions.assertAll; -class StaffHtmlParserTemplateTest { +public 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 { + public 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") ) + ); } + } From 49ca89be5fa9cc81b588c9414ae2986ed9e8ead7 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Thu, 28 Nov 2024 20:36:11 +0900 Subject: [PATCH 16/48] =?UTF-8?q?fix=20:=20entity=20position=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=20=EC=A0=84=20=EB=A1=9C=EC=A7=81=EC=9C=BC=EB=A1=9C=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/update/staff/dto/StaffDto.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 d70d0779..02c6e8a9 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 @@ -48,8 +48,7 @@ public boolean isNotSameInformation(Staff staff) { || !staff.isSamePhone(phone) || !staff.isSameEmail(email) || !staff.isSameDept(deptName) - || !staff.isSameCollege(collegeName) - || !staff.isSamePosition(position); + || !staff.isSameCollege(collegeName); } public Staff toEntity() { @@ -61,7 +60,6 @@ public Staff toEntity() { .email(email) .dept(deptName) .college(collegeName) - .position(position) .build(); } From 3ae1d1a832a67cb6953311ac3d992f8561f45772 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Fri, 29 Nov 2024 21:12:40 +0900 Subject: [PATCH 17/48] =?UTF-8?q?remove=20:=20legacy=20StaffScraperTest=20?= =?UTF-8?q?=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worker/parser/StaffScraperTest.java | 356 -- .../staffpages/korean/answers/1.json | 7 - .../staffpages/korean/answers/2.json | 7 - .../staffpages/korean/answers/3.json | 7 - .../staffpages/korean/answers/4.json | 7 - .../staffpages/korean/answers/5.json | 7 - .../resources/staffpages/korean/page.html | 4984 ----------------- .../resources/staffpages/korean/wrong.html | 4984 ----------------- .../staffpages/living_design/answers/1.json | 7 - .../staffpages/living_design/answers/2.json | 7 - .../staffpages/living_design/answers/3.json | 7 - .../staffpages/living_design/answers/4.json | 7 - .../staffpages/living_design/answers/5.json | 7 - .../staffpages/living_design/page.html | 1282 ----- .../staffpages/living_design/wrong.html | 1282 ----- .../staffpages/real_estate/answers/1.json | 7 - .../staffpages/real_estate/answers/10.json | 7 - .../staffpages/real_estate/answers/11.json | 7 - .../staffpages/real_estate/answers/2.json | 7 - .../staffpages/real_estate/answers/3.json | 7 - .../staffpages/real_estate/answers/4.json | 7 - .../staffpages/real_estate/answers/5.json | 7 - .../staffpages/real_estate/answers/6.json | 7 - .../staffpages/real_estate/answers/7.json | 7 - .../staffpages/real_estate/answers/8.json | 7 - .../staffpages/real_estate/answers/9.json | 7 - .../staffpages/real_estate/page.html | 574 -- .../staffpages/real_estate/wrong.html | 574 -- 28 files changed, 14183 deletions(-) delete mode 100644 src/test/java/com/kustacks/kuring/worker/parser/StaffScraperTest.java delete mode 100644 src/test/resources/staffpages/korean/answers/1.json delete mode 100644 src/test/resources/staffpages/korean/answers/2.json delete mode 100644 src/test/resources/staffpages/korean/answers/3.json delete mode 100644 src/test/resources/staffpages/korean/answers/4.json delete mode 100644 src/test/resources/staffpages/korean/answers/5.json delete mode 100644 src/test/resources/staffpages/korean/page.html delete mode 100644 src/test/resources/staffpages/korean/wrong.html delete mode 100644 src/test/resources/staffpages/living_design/answers/1.json delete mode 100644 src/test/resources/staffpages/living_design/answers/2.json delete mode 100644 src/test/resources/staffpages/living_design/answers/3.json delete mode 100644 src/test/resources/staffpages/living_design/answers/4.json delete mode 100644 src/test/resources/staffpages/living_design/answers/5.json delete mode 100644 src/test/resources/staffpages/living_design/page.html delete mode 100644 src/test/resources/staffpages/living_design/wrong.html delete mode 100644 src/test/resources/staffpages/real_estate/answers/1.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/10.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/11.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/2.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/3.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/4.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/5.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/6.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/7.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/8.json delete mode 100644 src/test/resources/staffpages/real_estate/answers/9.json delete mode 100644 src/test/resources/staffpages/real_estate/page.html delete mode 100644 src/test/resources/staffpages/real_estate/wrong.html 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/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 From 38654a637dcc0ec4c4bfbbe77a5dfe63d6bc7053 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Fri, 29 Nov 2024 21:12:57 +0900 Subject: [PATCH 18/48] =?UTF-8?q?remove=20:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=20=EC=A3=BC=EC=84=9D=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/scrap/deptinfo/real_estate/RealEstateDept.java | 1 - 1 file changed, 1 deletion(-) 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 753f8ee9..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) { From 8e921da8a84ffbd4a03ef2171de32a49494b3bcc Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Fri, 29 Nov 2024 21:13:08 +0900 Subject: [PATCH 19/48] =?UTF-8?q?test=20:=20MockServerSupport=20=EA=B0=9D?= =?UTF-8?q?=EC=B2=B4=20=EC=83=9D=EC=84=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/support/MockServerSupport.java | 28 +++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/test/java/com/kustacks/kuring/support/MockServerSupport.java 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); + } +} From 2a84b06e825946c18421d68055de7753d644f765 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Fri, 29 Nov 2024 21:13:42 +0900 Subject: [PATCH 20/48] =?UTF-8?q?remove=20:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=20DTO=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worker/parser/dto/TestStaffDTO.java | 53 ------------------- 1 file changed, 53 deletions(-) delete mode 100644 src/test/java/com/kustacks/kuring/worker/parser/dto/TestStaffDTO.java 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; - } -} From 4a5f28a01d99365687e4e4ddc2bf8b9ae0644f9e Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Fri, 29 Nov 2024 21:14:03 +0900 Subject: [PATCH 21/48] =?UTF-8?q?test=20:=20=EC=8B=A0=EA=B7=9C=20StaffScra?= =?UTF-8?q?perTest=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/scrap/StaffScraperTest.java | 114 ++++++++++++++++++ 1 file changed, 114 insertions(+) create mode 100644 src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java 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..1b568608 --- /dev/null +++ b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java @@ -0,0 +1,114 @@ +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.DeptInfo; +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 +public class StaffScraperTest { + + @Autowired + private StaffScraper staffScraper; + + @Autowired + private ComputerScienceDept computerScienceDept; + + @Autowired + private RealEstateDept realEstateDept; + + private ClientAndServer mockServer; + private final int MOCK_SERVER_PORT = 9000; + + @Value("${staff.each-dept-url}") + private String eachDeptUrl; + + @BeforeEach + public void startServer() { + mockServer = ClientAndServer.startClientAndServer(MOCK_SERVER_PORT); // 원하는 포트 지정 + } + + @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(MOCK_SERVER_PORT, request, response); + } +} From 708f4bf510c955651d1a697f27719b62afa3cf82 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 15:11:01 +0900 Subject: [PATCH 22/48] =?UTF-8?q?remove=20:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=20import=EB=AC=B8=20=EC=82=AD=EC=A0=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java | 1 - .../com/kustacks/kuring/worker/update/staff/dto/StaffDto.java | 1 - 2 files changed, 2 deletions(-) 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 1ee937ac..f0a78b12 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -12,7 +12,6 @@ import org.springframework.retry.annotation.Retryable; import org.springframework.stereotype.Component; -import java.util.Arrays; import java.util.List; @Slf4j 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 02c6e8a9..de7bca07 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 @@ -5,7 +5,6 @@ import lombok.Builder; import lombok.Getter; import lombok.NoArgsConstructor; -import lombok.ToString; import java.util.Objects; From 9ac2010ec915d6c3e9e29052e6de1780a6786ec4 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 15:12:07 +0900 Subject: [PATCH 23/48] =?UTF-8?q?feat=20:=20StaffDTO=20identifier()=20?= =?UTF-8?q?=EB=A9=94=EC=84=9C=EB=93=9C=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/update/staff/StaffUpdater.java | 2 +- .../com/kustacks/kuring/worker/update/staff/dto/StaffDto.java | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) 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 08d5babc..542eb92f 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 @@ -70,7 +70,7 @@ private Map scrapStaffByDepartment(DeptInfo deptInfo) { private Map convertStaffDtoMap(List scrapedStaffDtos) { return scrapedStaffDtos.stream() .distinct() - .collect(Collectors.toMap(staffDto -> staffDto.getName()+staffDto.getEmail()+staffDto.getDeptName(), 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 de7bca07..387a2c26 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 @@ -66,6 +66,10 @@ 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; From 2b36510f54b8d6a5f1b6dedc8dd844244c71c63a Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 15:16:08 +0900 Subject: [PATCH 24/48] =?UTF-8?q?feat=20:=20=EC=88=98=EC=9D=98=EA=B3=BC?= =?UTF-8?q?=EB=8C=80=ED=95=99=20=EA=B5=90=EC=A7=81=EC=9B=90=20=EC=8A=A4?= =?UTF-8?q?=ED=81=AC=EB=9E=A9=EC=8B=9C=20=EC=88=98=EC=9D=98=EC=98=88?= =?UTF-8?q?=EA=B3=BC=EB=A7=8C=20=EC=8A=A4=ED=81=AC=EB=9E=A9=20=ED=95=98?= =?UTF-8?q?=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../deptinfo/veterinary_medicine/VeterinaryMedicineDept.java | 2 +- .../com/kustacks/kuring/worker/update/staff/StaffUpdater.java | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) 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 78caf0c7..ef0a6bcd 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 @@ -24,7 +24,7 @@ public VeterinaryMedicineDept( this.noticeApiClient = latestPageNoticeApiClient; this.htmlParser = latestPageNoticeHtmlParser; this.latestPageNoticeProperties = latestPageNoticeProperties; - List siteIds = List.of(11135, 11136); + 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/StaffUpdater.java b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffUpdater.java index 542eb92f..601049ab 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 @@ -69,7 +69,6 @@ private Map scrapStaffByDepartment(DeptInfo deptInfo) { private Map convertStaffDtoMap(List scrapedStaffDtos) { return scrapedStaffDtos.stream() - .distinct() .collect(Collectors.toMap(StaffDto::identifier, staffDto -> staffDto)); } From 30c66752a70bcc708f1d3c8d44b4a1b4e36f2ca1 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 17:50:04 +0900 Subject: [PATCH 25/48] =?UTF-8?q?feat=20:=20=EC=A0=84=ED=99=94=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=9C=A0=ED=8B=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=20?= =?UTF-8?q?=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/converter/PhoneNumberConverter.java | 28 +++++++++++++++++++ .../kuring/worker/scrap/StaffScraper.java | 18 +----------- 2 files changed, 29 insertions(+), 17 deletions(-) create mode 100644 src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java diff --git a/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java b/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java new file mode 100644 index 00000000..df3a8e3f --- /dev/null +++ b/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java @@ -0,0 +1,28 @@ +package com.kustacks.kuring.common.utils.converter; + +import java.util.regex.Pattern; + +public class PhoneNumberConverter { + + 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}"); + + public static String convertFullExtensionNumber(String number) { + if (number == null || number.isBlank()) { + return ""; + } + if (LAST_FOUR_NUMBER_PATTERN.matcher(number).matches()) { + return "02-450-" + number; + } + if (FULL_NUMBER_PATTERN.matcher(number).matches()) { + return number; + } + if (FULL_NUMBER_WITH_PARENTHESES_PATTERN.matcher(number).matches()) { + return number.replace(")", "-"); + } + + //기타 이상한 형식은 빈공백으로 저장 ex. 218) 이게뭔데; + return ""; + } +} 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 f0a78b12..173c6f38 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -63,30 +63,14 @@ private static List convertStaffDtos(DeptInfo deptInfo, List .position(oneStaffInfo[1]) .major(oneStaffInfo[2]) .lab(oneStaffInfo[3]) - .phone(convertFullExtensionNumber(oneStaffInfo[4])) .email(oneStaffInfo[5]) + .phone(PhoneNumberConverter.convertFullExtensionNumber(oneStaffInfo[4])) .deptName(deptInfo.getDeptName()) .collegeName(deptInfo.getCollegeName() ).build() ).toList(); } - private static String convertFullExtensionNumber(String number) { - if (number == null || number.isBlank()) { - return ""; - } - if (number.matches("\\d{4}")) { - return "02-450-" + number; - } - if (number.matches("02-450-\\d{4}")) { - return number; - } - if (number.matches("02[)].*-\\d{4}")) { - return number.replace(")", "-"); - } - return number; - } - private StaffHtmlParserTemplate findHtmlParser(DeptInfo deptInfo) { return htmlParsers.stream() .filter(htmlParser -> htmlParser.support(deptInfo)) From 8ce7b429767055a6e04fdfd8fb632945e69b3ddd Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 17:50:21 +0900 Subject: [PATCH 26/48] =?UTF-8?q?feat=20:=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?=EC=9C=A0=ED=8B=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EB=B6=84?= =?UTF-8?q?=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/converter/EmailConverter.java | 57 +++++++++++++++++++ .../kuring/worker/scrap/StaffScraper.java | 4 +- 2 files changed, 60 insertions(+), 1 deletion(-) create mode 100644 src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java diff --git a/src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java b/src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java new file mode 100644 index 00000000..678508ce --- /dev/null +++ b/src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java @@ -0,0 +1,57 @@ +package com.kustacks.kuring.common.utils.converter; + +import java.util.regex.Pattern; + +public class EmailConverter { + 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"; + + public static String convertValidEmail(String email) { + if (email == null || email.isBlank()) { + return ""; // 빈 입력 처리 + } + + //여러 이메일인 경우 있으니 분리. + String[] emailGroups = email.split("[/,]"); + //정상 구조가 아닌 경우 구조 정상화 + for (int i = 0; i < emailGroups.length; i++) { + emailGroups[i] = normalizeEmail(emailGroups[i]); + } + + //여러 이메일 중 konkuk을 우선 선택, 없으면 첫번째 내용 + return selectEmail(emailGroups); + } + + private static String normalizeEmail(String email) { + if (email == null || email.isBlank()) { + return ""; + } + + // 정상 이메일인지 확인 + if (EMAIL_PATTERN.matcher(email).matches()) { + return email; + } + + // "@", "." 대신 "at", "dot"으로 되어있는 경우 변환 + if (DOT_PATTERN.matcher(email).find() && AT_PATTERN.matcher(email).find()) { + return email.replaceAll(DOT_PATTERN.pattern(), ".") + .replaceAll(AT_PATTERN.pattern(), "@"); + } + + // 기타 이상한 형식은 빈공백으로 저장 + return ""; + } + + // Konkuk 도메인 우선 선택 + private static String selectEmail(String[] emails) { + for (String email : emails) { + if (email.endsWith(KONKUK_DOMAIN)) { + return email; + } + } + return emails[0]; + } +} 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 173c6f38..a06f06b5 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -2,6 +2,8 @@ import com.kustacks.kuring.common.exception.InternalLogicException; import com.kustacks.kuring.common.exception.code.ErrorCode; +import com.kustacks.kuring.common.utils.converter.EmailConverter; +import com.kustacks.kuring.common.utils.converter.PhoneNumberConverter; import com.kustacks.kuring.worker.scrap.client.staff.StaffApiClient; import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; import com.kustacks.kuring.worker.parser.staff.StaffHtmlParserTemplate; @@ -63,8 +65,8 @@ private static List convertStaffDtos(DeptInfo deptInfo, List .position(oneStaffInfo[1]) .major(oneStaffInfo[2]) .lab(oneStaffInfo[3]) - .email(oneStaffInfo[5]) .phone(PhoneNumberConverter.convertFullExtensionNumber(oneStaffInfo[4])) + .email(EmailConverter.convertValidEmail(oneStaffInfo[5])) .deptName(deptInfo.getDeptName()) .collegeName(deptInfo.getCollegeName() ).build() From 3727f63d7228628bb053e6fd1265d16f47f567b3 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 17:50:56 +0900 Subject: [PATCH 27/48] =?UTF-8?q?test=20:=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?=EC=9C=A0=ED=8B=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=ED=85=8C?= =?UTF-8?q?=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/converter/EmailConverterTest.java | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java diff --git a/src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java b/src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java new file mode 100644 index 00000000..b318528a --- /dev/null +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java @@ -0,0 +1,43 @@ +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 EmailConverterTest { + + @DisplayName("이메일 구조 변경 테스트") + @Test + public void convertValidEmail() { + //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(EmailConverter::convertValidEmail) + .toList(); + + //then + for (int i = 0; i < emails.length; i++) { + assertThat(Objects.equals(convertedEmails.get(i), answer[i])).isTrue(); + } + } +} \ No newline at end of file From ffd86bdc740671f94661370a7be064d1c98ee0ad Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 17:51:06 +0900 Subject: [PATCH 28/48] =?UTF-8?q?teat=20:=20=EC=A0=84=ED=99=94=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=9C=A0=ED=8B=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../converter/PhoneNumberConverterTest.java | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverterTest.java diff --git a/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverterTest.java b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverterTest.java new file mode 100644 index 00000000..32087bfb --- /dev/null +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverterTest.java @@ -0,0 +1,48 @@ +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 PhoneNumberConverterTest { + + @DisplayName("전화번호 구조 변경 테스트") + @Test + public 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(PhoneNumberConverter::convertFullExtensionNumber) + .toList(); + + //then + for (int i = 0; i < numbers.length; i++) { + System.out.println(numbers[i] + " " +convertedNumbers.get(i) + " " + answer[i]); + assertThat(Objects.equals(convertedNumbers.get(i), answer[i])).isTrue(); + } + } +} \ No newline at end of file From 49c684b07f23465f812ba80b4c2b4ed40aa4cf65 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 22:51:10 +0900 Subject: [PATCH 29/48] =?UTF-8?q?feat=20:=20Staff=20DB=20position=20column?= =?UTF-8?q?=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/db/migration/V241130__Add_position_to_staff.sql | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 src/main/resources/db/migration/V241130__Add_position_to_staff.sql 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..7ee55400 --- /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) default false; From eb9cded5f9a69425c67a624a431341e176e7a574 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 22:51:45 +0900 Subject: [PATCH 30/48] =?UTF-8?q?feat=20:=20Staff=20&=20StaffDTO=20positio?= =?UTF-8?q?n=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/staff/domain/Staff.java | 13 +++++++++++-- .../kuring/worker/update/staff/dto/StaffDto.java | 1 + 2 files changed, 12 insertions(+), 2 deletions(-) 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..3940d9b0 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,9 @@ public class Staff { @Column(name = "lab", length = 64) private String lab; + @Column(name = "position", length = 64) + private String position; + @Embedded private Phone phone; @@ -45,7 +48,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 +56,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 +67,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 +110,10 @@ public boolean isSameCollege(String collegeName) { return this.college == College.valueOf(collegeName); } + public boolean isSamePosition(String position) { + return this.position.equals(position); + } + @Override public boolean equals(Object o) { if (this == o) return true; 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 387a2c26..f22d226d 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 @@ -59,6 +59,7 @@ public Staff toEntity() { .email(email) .dept(deptName) .college(collegeName) + .position(position) .build(); } From 5d3a7152675d3bc1ad393820000fe51be0324889 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 22:54:22 +0900 Subject: [PATCH 31/48] =?UTF-8?q?feat=20:=20StaffDTO=20position=20?= =?UTF-8?q?=EB=B9=84=EA=B5=90=20=EB=A1=9C=EC=A7=81=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/update/staff/dto/StaffDto.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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 f22d226d..19af0610 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 @@ -47,7 +47,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() { From 666db2cd1581dd135d90351d2ae3b7f788340720 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 22:54:53 +0900 Subject: [PATCH 32/48] =?UTF-8?q?feat=20:=20=EC=9D=B4=EB=A9=94=EC=9D=BC=20?= =?UTF-8?q?valid=20=EC=A0=95=EC=B1=85=20=EC=88=98=EC=A0=95(=EA=B3=B5?= =?UTF-8?q?=EB=B0=B1=20=ED=97=88=EC=9A=A9)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/kustacks/kuring/staff/domain/Email.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) { From b6075527d2cb755a83d6143b4d8207eb6db9443d Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 22:55:21 +0900 Subject: [PATCH 33/48] =?UTF-8?q?feat=20:=20Staff=20=EC=97=85=EB=8D=B0?= =?UTF-8?q?=EC=9D=B4=ED=8A=B8=EC=8B=9C=20=EC=A7=81=EC=9C=84=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/update/staff/StaffCompareSupport.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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..0096983b 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 @@ -57,7 +57,8 @@ private static void updateStaffInfo(StaffDto staffDto, Staff staff) { staffDto.getPhone(), staffDto.getEmail(), staffDto.getDeptName(), - staffDto.getCollegeName() + staffDto.getCollegeName(), + staffDto.getPosition() ); } } From 980fe0f7a2b0f32ce50697407f8356818bb98c38 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Sat, 30 Nov 2024 22:56:12 +0900 Subject: [PATCH 34/48] =?UTF-8?q?feat=20:=20=EA=B5=90=EC=A7=81=EC=9B=90=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EC=8A=A4=EC=BC=80=EC=A5=B4?= =?UTF-8?q?=EB=A7=81=20=EC=9B=94=201=ED=9A=8C=20=ED=99=9C=EC=84=B1?= =?UTF-8?q?=ED=99=94?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/update/staff/StaffUpdater.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) 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 601049ab..38db8d70 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,14 @@ 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 +25,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("========== 교직원 업데이트 시작 =========="); From 143a5e5ae8f7e5c913e34023dea9529ded2a4a0b Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:45:17 +0900 Subject: [PATCH 35/48] =?UTF-8?q?feat=20:=20EmailSupporter=20&=20PhoneNumb?= =?UTF-8?q?erSupporter=20=EA=B2=80=EC=A6=9D/=EB=B3=80=ED=99=98=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../utils/converter/EmailConverter.java | 57 ---------------- .../utils/converter/EmailSupporter.java | 68 +++++++++++++++++++ .../utils/converter/PhoneNumberConverter.java | 28 -------- .../utils/converter/PhoneNumberSupporter.java | 42 ++++++++++++ .../worker/update/staff/dto/StaffDto.java | 24 ++++++- 5 files changed, 131 insertions(+), 88 deletions(-) delete mode 100644 src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java create mode 100644 src/main/java/com/kustacks/kuring/common/utils/converter/EmailSupporter.java delete mode 100644 src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java create mode 100644 src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporter.java diff --git a/src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java b/src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java deleted file mode 100644 index 678508ce..00000000 --- a/src/main/java/com/kustacks/kuring/common/utils/converter/EmailConverter.java +++ /dev/null @@ -1,57 +0,0 @@ -package com.kustacks.kuring.common.utils.converter; - -import java.util.regex.Pattern; - -public class EmailConverter { - 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"; - - public static String convertValidEmail(String email) { - if (email == null || email.isBlank()) { - return ""; // 빈 입력 처리 - } - - //여러 이메일인 경우 있으니 분리. - String[] emailGroups = email.split("[/,]"); - //정상 구조가 아닌 경우 구조 정상화 - for (int i = 0; i < emailGroups.length; i++) { - emailGroups[i] = normalizeEmail(emailGroups[i]); - } - - //여러 이메일 중 konkuk을 우선 선택, 없으면 첫번째 내용 - return selectEmail(emailGroups); - } - - private static String normalizeEmail(String email) { - if (email == null || email.isBlank()) { - return ""; - } - - // 정상 이메일인지 확인 - if (EMAIL_PATTERN.matcher(email).matches()) { - return email; - } - - // "@", "." 대신 "at", "dot"으로 되어있는 경우 변환 - if (DOT_PATTERN.matcher(email).find() && AT_PATTERN.matcher(email).find()) { - return email.replaceAll(DOT_PATTERN.pattern(), ".") - .replaceAll(AT_PATTERN.pattern(), "@"); - } - - // 기타 이상한 형식은 빈공백으로 저장 - return ""; - } - - // Konkuk 도메인 우선 선택 - private static String selectEmail(String[] emails) { - for (String email : emails) { - if (email.endsWith(KONKUK_DOMAIN)) { - return email; - } - } - return emails[0]; - } -} 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/PhoneNumberConverter.java b/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java deleted file mode 100644 index df3a8e3f..00000000 --- a/src/main/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverter.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.kustacks.kuring.common.utils.converter; - -import java.util.regex.Pattern; - -public class PhoneNumberConverter { - - 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}"); - - public static String convertFullExtensionNumber(String number) { - if (number == null || number.isBlank()) { - return ""; - } - if (LAST_FOUR_NUMBER_PATTERN.matcher(number).matches()) { - return "02-450-" + number; - } - if (FULL_NUMBER_PATTERN.matcher(number).matches()) { - return number; - } - if (FULL_NUMBER_WITH_PARENTHESES_PATTERN.matcher(number).matches()) { - return number.replace(")", "-"); - } - - //기타 이상한 형식은 빈공백으로 저장 ex. 218) 이게뭔데; - return ""; - } -} 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/worker/update/staff/dto/StaffDto.java b/src/main/java/com/kustacks/kuring/worker/update/staff/dto/StaffDto.java index 19af0610..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; @@ -33,11 +35,27 @@ private StaffDto(String name, String major, String lab, String phone, String ema 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) { @@ -89,6 +107,6 @@ public boolean equals(Object o) { @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()); } } From 3049c308e2cdc5b0e8f0ba6e61d2b536957b9be3 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:46:44 +0900 Subject: [PATCH 36/48] =?UTF-8?q?feat=20:=20EmailSupporter=20&=20PhoneNumb?= =?UTF-8?q?erSupporter=20=EA=B2=80=EC=A6=9D=20=EB=A9=94=EC=84=9C=EB=93=9C?= =?UTF-8?q?=20=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ...erterTest.java => EmailSupporterTest.java} | 31 +++++++++++++++-- ...est.java => PhoneNumberSupporterTest.java} | 33 +++++++++++++++++-- 2 files changed, 58 insertions(+), 6 deletions(-) rename src/test/java/com/kustacks/kuring/common/utils/converter/{EmailConverterTest.java => EmailSupporterTest.java} (55%) rename src/test/java/com/kustacks/kuring/common/utils/converter/{PhoneNumberConverterTest.java => PhoneNumberSupporterTest.java} (56%) diff --git a/src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java b/src/test/java/com/kustacks/kuring/common/utils/converter/EmailSupporterTest.java similarity index 55% rename from src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java rename to src/test/java/com/kustacks/kuring/common/utils/converter/EmailSupporterTest.java index b318528a..e278cdc4 100644 --- a/src/test/java/com/kustacks/kuring/common/utils/converter/EmailConverterTest.java +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/EmailSupporterTest.java @@ -9,11 +9,11 @@ import static org.assertj.core.api.Assertions.assertThat; -class EmailConverterTest { +class EmailSupporterTest { @DisplayName("이메일 구조 변경 테스트") @Test - public void convertValidEmail() { + void convertEmailTest() { //given String[] emails = new String[]{ "ab1234@konkuk.ac.kr", @@ -32,7 +32,7 @@ public void convertValidEmail() { //when List convertedEmails = Arrays.stream(emails) - .map(EmailConverter::convertValidEmail) + .map(EmailSupporter::convertValidEmail) .toList(); //then @@ -40,4 +40,29 @@ public void convertValidEmail() { 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/PhoneNumberConverterTest.java b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java similarity index 56% rename from src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverterTest.java rename to src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java index 32087bfb..2379fc53 100644 --- a/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberConverterTest.java +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java @@ -9,11 +9,11 @@ import static org.assertj.core.api.Assertions.assertThat; -class PhoneNumberConverterTest { +class PhoneNumberSupporterTest { @DisplayName("전화번호 구조 변경 테스트") @Test - public void convertValidNumber() { + void convertValidNumber() { //given String[] numbers = new String[]{ "1234", @@ -36,7 +36,7 @@ public void convertValidNumber() { //when List convertedNumbers = Arrays.stream(numbers) - .map(PhoneNumberConverter::convertFullExtensionNumber) + .map(PhoneNumberSupporter::convertFullExtensionNumber) .toList(); //then @@ -45,4 +45,31 @@ public void convertValidNumber() { 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 From 47b08f9275719a7f36bef7893430f40744a3fc54 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:49:17 +0900 Subject: [PATCH 37/48] =?UTF-8?q?feat=20:=20StaffDTO=20=EA=B0=9D=EC=B2=B4?= =?UTF-8?q?=20=EC=83=9D=EC=84=B1=20=EA=B0=84=20email,=20phone=20=EA=B2=80?= =?UTF-8?q?=EC=A6=9D,=20=EB=B3=80=ED=99=98=ED=95=98=EB=8F=84=EB=A1=9D=20?= =?UTF-8?q?=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/kustacks/kuring/worker/scrap/StaffScraper.java | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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 a06f06b5..58df39d9 100644 --- a/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java +++ b/src/main/java/com/kustacks/kuring/worker/scrap/StaffScraper.java @@ -2,8 +2,6 @@ import com.kustacks.kuring.common.exception.InternalLogicException; import com.kustacks.kuring.common.exception.code.ErrorCode; -import com.kustacks.kuring.common.utils.converter.EmailConverter; -import com.kustacks.kuring.common.utils.converter.PhoneNumberConverter; import com.kustacks.kuring.worker.scrap.client.staff.StaffApiClient; import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; import com.kustacks.kuring.worker.parser.staff.StaffHtmlParserTemplate; @@ -65,8 +63,8 @@ private static List convertStaffDtos(DeptInfo deptInfo, List .position(oneStaffInfo[1]) .major(oneStaffInfo[2]) .lab(oneStaffInfo[3]) - .phone(PhoneNumberConverter.convertFullExtensionNumber(oneStaffInfo[4])) - .email(EmailConverter.convertValidEmail(oneStaffInfo[5])) + .phone(oneStaffInfo[4]) + .email(oneStaffInfo[5]) .deptName(deptInfo.getDeptName()) .collegeName(deptInfo.getCollegeName() ).build() From 05bdb5d76a7b82e922c63f6d44bfea3a2026943c Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:49:58 +0900 Subject: [PATCH 38/48] =?UTF-8?q?refactor=20:=20=EB=B6=88=ED=95=84?= =?UTF-8?q?=EC=9A=94=20import=EB=AC=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/parser/staff/RealEstateStaffHtmlParser.java | 3 --- .../deptinfo/veterinary_medicine/VeterinaryMedicineDept.java | 1 - .../com/kustacks/kuring/worker/scrap/StaffScraperTest.java | 1 - 3 files changed, 5 deletions(-) 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 413b1256..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 @@ -7,9 +7,6 @@ import org.jsoup.select.Elements; import org.springframework.stereotype.Component; -import java.util.HashMap; -import java.util.Map; - @Component public class RealEstateStaffHtmlParser extends StaffHtmlParserTemplate { 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 ef0a6bcd..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 @@ -7,7 +7,6 @@ import com.kustacks.kuring.worker.scrap.deptinfo.RegisterDepartmentMap; import com.kustacks.kuring.worker.scrap.deptinfo.StaffScrapInfo; -import java.util.ArrayList; import java.util.List; import static com.kustacks.kuring.notice.domain.DepartmentName.VET_MEDICINE; diff --git a/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java index 1b568608..f36cf6c3 100644 --- a/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java +++ b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java @@ -2,7 +2,6 @@ import com.kustacks.kuring.support.MockServerSupport; import com.kustacks.kuring.support.TestFileLoader; -import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo; 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; From c8f848ece9cdce0342312cf845780d312ca5223a Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:50:21 +0900 Subject: [PATCH 39/48] =?UTF-8?q?refactor=20:=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=ED=81=B4=EB=9E=98=EC=8A=A4=20=EB=B0=8F=20=EB=A9=94?= =?UTF-8?q?=EC=84=9C=EB=93=9C=20public=20=ED=82=A4=EC=9B=8C=EB=93=9C=20?= =?UTF-8?q?=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/worker/parser/StaffHtmlParserTemplateTest.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 11ce1624..35525921 100644 --- a/src/test/java/com/kustacks/kuring/worker/parser/StaffHtmlParserTemplateTest.java +++ b/src/test/java/com/kustacks/kuring/worker/parser/StaffHtmlParserTemplateTest.java @@ -15,7 +15,7 @@ import static org.assertj.core.api.Assertions.tuple; import static org.junit.jupiter.api.Assertions.assertAll; -public class StaffHtmlParserTemplateTest { +class StaffHtmlParserTemplateTest { @DisplayName("부동산 학과의 교수진 정보를 파싱한다.") @Test @@ -32,7 +32,7 @@ void RealEstateStaffHtmlParser() throws IOException { @DisplayName("컴퓨터공학부 홈페이지의 교수진 정보를 파싱한다.") @Test - public void LatestStaffEachDeptHtmlParser() throws IOException { + void LatestStaffEachDeptHtmlParser() throws IOException { // given Document doc = Jsoup.parse(TestFileLoader.loadHtmlFile("src/test/resources/staff/cse_staff_page.html")); From 48b48c16cc4bdb990bacb43570e9e85043508fac Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:50:53 +0900 Subject: [PATCH 40/48] =?UTF-8?q?refactor=20:=20=EC=A3=BC=EC=84=9D=20TODO?= =?UTF-8?q?=20=ED=82=A4=EC=9B=8C=EB=93=9C=20=EC=A0=9C=EA=B1=B0=20=EB=B0=8F?= =?UTF-8?q?=20replaceAll()=20->=20replace()=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../worker/scrap/client/staff/EachDeptStaffApiClient.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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 d46e486f..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 @@ -26,7 +26,9 @@ public EachDeptStaffApiClient(NormalJsoupClient normalJsoupClient) { } /* - TODO: 만약, 학과별로 다른 API Client를 구성해야 한다면 support 구현 필요.(현재는 교직원 스크랩을 위한 모든 API 클래이언트 스펙 동일, 파싱에서 분리) [2024.11.28 김한주] + 만약, 학과별로 다른 API Client를 구성해야 한다면 support 구현 필요. + 현재는 교직원 스크랩을 위한 모든 API 클래이언트 스펙 동일, 파싱에서 분리 + [2024.11.28 김한주] */ @Override public boolean support(DeptInfo deptInfo) { @@ -59,7 +61,7 @@ private Document getDocument(String url) { } private String buildDeptStaffPageUrl(String department, int siteId) { - return baseUrl.replaceAll("\\{department\\}", department) + return baseUrl.replace("{department}", department) .replace("{siteId}", String.valueOf(siteId)); } } From ec2fafba918bba183c0d3b4b5d0cda8b95190485 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:52:17 +0900 Subject: [PATCH 41/48] =?UTF-8?q?feat=20:=20=EC=A7=81=EC=9C=84=20=EC=B6=94?= =?UTF-8?q?=EA=B0=80=EC=97=90=20=EB=94=B0=EB=A5=B8=20StaffUpdate=20?= =?UTF-8?q?=EB=A1=9C=EC=A7=81=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kustacks/kuring/staff/domain/Staff.java | 5 ++++ .../update/staff/StaffCompareSupport.java | 28 +++++++++---------- .../update/staff/StaffDataSynchronizer.java | 4 +-- 3 files changed, 21 insertions(+), 16 deletions(-) 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 3940d9b0..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,7 @@ public class Staff { @Column(name = "lab", length = 64) private String lab; + @Getter(AccessLevel.PUBLIC) @Column(name = "position", length = 64) private String position; @@ -114,6 +115,10 @@ 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/update/staff/StaffCompareSupport.java b/src/main/java/com/kustacks/kuring/worker/update/staff/StaffCompareSupport.java index 0096983b..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(), 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..3d2f341a 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 @@ -30,7 +30,7 @@ public void compareAndUpdateDb(StaffScrapResults scrapResults) { private StaffCompareResults compare(StaffScrapResults scrapResults) { Map originStaffStorage = findByDeptContainingMap(scrapResults.successDepartmentNames()); - return staffCompareSupport.compareAllDepartmentsAndUpdateExistStaff(scrapResults.getStaffDtos(), originStaffStorage); + return staffCompareSupport.compareAllDepartmentsAndUpdateExistStaff(scrapResults.kuStaffDTOMap(), originStaffStorage); } private void synchronizationWithDb(StaffCompareResults compareResults) { @@ -44,7 +44,7 @@ private Map findByDeptContainingMap(List scrapSuccessDepa deptName -> staffRepository.findByDeptContaining(deptName).stream() ).collect( Collectors.toMap( - Staff::getEmail, + Staff::identifier, Function.identity(), (existing, newValue) -> existing ) From 5cf13773f2a581080fbcde0a3b1eb320743b1416 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:52:56 +0900 Subject: [PATCH 42/48] =?UTF-8?q?refactor=20:=20=EB=9E=8C=EB=8B=A4=20?= =?UTF-8?q?=ED=95=A8=EC=88=98=20=EC=82=AC=EC=9A=A9=20=EA=B0=84=20=EB=B6=88?= =?UTF-8?q?=ED=95=84=EC=9A=94=20=EA=B4=84=ED=98=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/update/staff/StaffUpdater.java | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) 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 38db8d70..608e3af5 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 @@ -42,9 +42,7 @@ private StaffScrapResults scrapAllDepartmentsStaffs() { deptInfos.stream() .filter(DeptInfo::isSupportStaffScrap) - .forEach(deptInfo -> { - scrapSingleDepartmentsStaffs(kuStaffDtoMap, successDepartmentNames, deptInfo); - }); + .forEach(deptInfo -> scrapSingleDepartmentsStaffs(kuStaffDtoMap, successDepartmentNames, deptInfo)); return new StaffScrapResults(kuStaffDtoMap, successDepartmentNames); } From 518ac33020f08401e3dfd1a8a2550034c29ef186 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:53:58 +0900 Subject: [PATCH 43/48] =?UTF-8?q?feat=20:=20=EC=A0=84=ED=99=94=EB=B2=88?= =?UTF-8?q?=ED=98=B8=20=EC=97=86=EC=9D=84=20=EA=B2=BD=EC=9A=B0=20=EA=B8=B0?= =?UTF-8?q?=EB=B3=B8=20=EC=A0=80=EC=9E=A5=20=EA=B0=92=20=EB=B3=80=EA=B2=BD?= =?UTF-8?q?("-"=20->=20"")?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/kustacks/kuring/staff/domain/Phone.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) 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) { From bcadaba07487ddbc2d5847e6f0931b0d99525861 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:54:50 +0900 Subject: [PATCH 44/48] =?UTF-8?q?fix=20:=20StaffUpdate=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?Staff=20=EB=8F=84=EB=A9=94=EC=9D=B8=20=ED=85=8C=EC=8A=A4?= =?UTF-8?q?=ED=8A=B8=20=EB=B3=80=EA=B2=BD(identifier(),=20=EC=A0=84?= =?UTF-8?q?=ED=99=94=EB=B2=88=ED=98=B8)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../java/com/kustacks/kuring/staff/domain/StaffTest.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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, "") ); } } From 42166767b4cfb2f6c6d040f1ef60e9c119fc51a8 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 18:55:25 +0900 Subject: [PATCH 45/48] =?UTF-8?q?test=20:=20StaffUpdate=20=EB=A1=9C?= =?UTF-8?q?=EC=A7=81=20=EB=B3=80=EA=B2=BD=EC=97=90=20=EB=94=B0=EB=A5=B8=20?= =?UTF-8?q?=ED=85=8C=EC=8A=A4=ED=8A=B8=20=EC=BD=94=EB=93=9C=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD(identifier(),=20=EC=A0=84=ED=99=94=EB=B2=88=ED=98=B8,?= =?UTF-8?q?=20=EC=A7=81=EC=9C=84)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../update/staff/StaffCompareSupportTest.java | 29 ++++++++++++------- .../worker/update/staff/StaffUpdaterTest.java | 21 +++++++++----- 2 files changed, 31 insertions(+), 19 deletions(-) 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..5a25333f 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,24 +65,26 @@ 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); @@ -95,8 +99,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("조교수", "명예교수") ); } From 90f5958f4d12f542973f1854d3b4a85849062316 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 19:10:11 +0900 Subject: [PATCH 46/48] =?UTF-8?q?refactor=20:=20=EC=86=8C=EB=82=98?= =?UTF-8?q?=ED=81=90=EB=B8=8C=20=EC=9D=B4=EC=8A=88=20=EC=88=98=EC=A0=95(?= =?UTF-8?q?=EB=B3=80=EC=88=98=EB=AA=85=20=EC=BB=A8=EB=B2=A4=EC=85=98)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kustacks/kuring/worker/scrap/StaffScraperTest.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java index f36cf6c3..eaf42634 100644 --- a/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java +++ b/src/test/java/com/kustacks/kuring/worker/scrap/StaffScraperTest.java @@ -25,7 +25,7 @@ @DisplayName("교직원 스크랩 테스트") @SpringBootTest -public class StaffScraperTest { +class StaffScraperTest { @Autowired private StaffScraper staffScraper; @@ -37,14 +37,14 @@ public class StaffScraperTest { private RealEstateDept realEstateDept; private ClientAndServer mockServer; - private final int MOCK_SERVER_PORT = 9000; + private final int mockServerPort = 9000; @Value("${staff.each-dept-url}") private String eachDeptUrl; @BeforeEach public void startServer() { - mockServer = ClientAndServer.startClientAndServer(MOCK_SERVER_PORT); // 원하는 포트 지정 + mockServer = ClientAndServer.startClientAndServer(mockServerPort); // 원하는 포트 지정 } @AfterEach @@ -108,6 +108,6 @@ private String buildDeptStaffPageUrl(String siteName, String 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(MOCK_SERVER_PORT, request, response); + MockServerSupport.createNewMockServer(mockServerPort, request, response); } } From 3954e23cc8525809f6bac03f1c8f93840d257716 Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Mon, 2 Dec 2024 22:22:43 +0900 Subject: [PATCH 47/48] =?UTF-8?q?remove=20:=20=EB=B6=88=ED=95=84=EC=9A=94?= =?UTF-8?q?=20=EC=B6=9C=EB=A0=A5=EB=AC=B8=20=EC=A0=9C=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../kuring/common/utils/converter/PhoneNumberSupporterTest.java | 1 - 1 file changed, 1 deletion(-) 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 index 2379fc53..c9b6c84b 100644 --- a/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java +++ b/src/test/java/com/kustacks/kuring/common/utils/converter/PhoneNumberSupporterTest.java @@ -41,7 +41,6 @@ void convertValidNumber() { //then for (int i = 0; i < numbers.length; i++) { - System.out.println(numbers[i] + " " +convertedNumbers.get(i) + " " + answer[i]); assertThat(Objects.equals(convertedNumbers.get(i), answer[i])).isTrue(); } } From 5afe41f8f308dca57334f9a4183971bdd0984f8f Mon Sep 17 00:00:00 2001 From: Han Ju Kim Date: Tue, 3 Dec 2024 21:00:29 +0900 Subject: [PATCH 48/48] =?UTF-8?q?feat=20:=20=EA=B5=90=EC=A7=81=EC=9B=90=20?= =?UTF-8?q?=EC=8A=A4=ED=81=AC=EB=9E=A9=20=EC=8A=A4=EC=BC=80=EC=A5=B4?= =?UTF-8?q?=EB=A7=81=20=EC=8B=9C=EA=B0=84=201=EB=B6=84=20=EB=B3=80?= =?UTF-8?q?=EA=B2=BD.(=ED=85=8C=EC=8A=A4=ED=8A=B8=20=ED=9B=84=2030?= =?UTF-8?q?=EB=B6=84=20=EB=90=98=EB=8F=8C=EB=A6=B4=20=EC=98=88=EC=A0=95)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/kustacks/kuring/worker/update/staff/StaffUpdater.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 608e3af5..0144767a 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 @@ -26,7 +26,7 @@ public class StaffUpdater { private final StaffScraper staffScraper; private final List deptInfos; - @Scheduled(fixedRate = 30, timeUnit = TimeUnit.DAYS) + @Scheduled(fixedRate = 1, timeUnit = TimeUnit.DAYS) public void update() { log.info("========== 교직원 업데이트 시작 ==========");