Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,15 @@
public record NoticeDepartmentNameResponse(
String name,
String hostPrefix,
String korName
String korName,
boolean graduateSupported
) {
public static NoticeDepartmentNameResponse from(NoticeDepartmentNameResult result) {
return new NoticeDepartmentNameResponse(
result.name(),
result.hostPrefix(),
result.korName()
result.korName(),
result.graduateSupported()
);
}
}
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
package com.kustacks.kuring.notice.application.port.in.dto;

import com.kustacks.kuring.notice.domain.DepartmentName;
import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo;

public record NoticeDepartmentNameResult(
String name,
String hostPrefix,
String korName
String korName,
boolean graduateSupported
) {
public static NoticeDepartmentNameResult from(DepartmentName name) {
return new NoticeDepartmentNameResult(name.getName(), name.getHostPrefix(), name.getKorName());
public static NoticeDepartmentNameResult from(DeptInfo deptInfo) {
DepartmentName name = deptInfo.getDepartmentName();
return new NoticeDepartmentNameResult(name.getName(), name.getHostPrefix(), name.getKorName(), deptInfo.isSupportGraduateScrap());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,7 @@
import com.kustacks.kuring.notice.adapter.in.web.dto.CommentDetailResponse;
import com.kustacks.kuring.notice.application.port.in.NoticeCommentReadingUseCase;
import com.kustacks.kuring.notice.application.port.in.NoticeQueryUseCase;
import com.kustacks.kuring.notice.application.port.in.dto.NoticeCategoryNameResult;
import com.kustacks.kuring.notice.application.port.in.dto.NoticeContentSearchResult;
import com.kustacks.kuring.notice.application.port.in.dto.NoticeDepartmentNameResult;
import com.kustacks.kuring.notice.application.port.in.dto.NoticeRangeLookupCommand;
import com.kustacks.kuring.notice.application.port.in.dto.NoticeRangeLookupResult;
import com.kustacks.kuring.notice.application.port.in.dto.*;
import com.kustacks.kuring.notice.application.port.out.CommentQueryPort;
import com.kustacks.kuring.notice.application.port.out.NoticeQueryPort;
import com.kustacks.kuring.notice.application.port.out.dto.CommentReadModel;
Expand All @@ -22,16 +18,11 @@
import com.kustacks.kuring.notice.domain.DepartmentName;
import com.kustacks.kuring.user.application.port.out.RootUserQueryPort;
import com.kustacks.kuring.user.domain.RootUser;
import com.kustacks.kuring.worker.scrap.deptinfo.DeptInfo;
import org.springframework.data.domain.PageRequest;
import org.springframework.transaction.annotation.Transactional;

import java.util.Arrays;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.Objects;
import java.util.Optional;
import java.util.Set;
import java.util.*;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

여러게 import시 *로 한번에 바꿔버리는 옵션을 꺼주세요~ 팀원들 입장에서 util.*로 보이면 뭐를 가져다 쓰는지 import만 보고 확인이 어려워져요!

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

아하 넵!!

import java.util.stream.Collectors;

import static com.kustacks.kuring.notice.domain.CategoryName.DEPARTMENT;
Expand All @@ -48,18 +39,19 @@ public class NoticeQueryService implements NoticeQueryUseCase, NoticeCommentRead
private final CommentQueryPort commentQueryPort;
private final RootUserQueryPort rootUserQueryPort;
private final List<CategoryName> supportedCategoryNameList;
private final List<DepartmentName> supportedDepartmentNameList;
private final List<DeptInfo> deptInfoList;

public NoticeQueryService(
NoticeQueryPort noticeQueryPort,
CommentQueryPort commentQueryPort,
RootUserQueryPort rootUserQueryPort
RootUserQueryPort rootUserQueryPort,
List<DeptInfo> deptInfoList
) {
this.noticeQueryPort = noticeQueryPort;
this.commentQueryPort = commentQueryPort;
this.rootUserQueryPort = rootUserQueryPort;
this.supportedCategoryNameList = Arrays.asList(CategoryName.values());
this.supportedDepartmentNameList = Arrays.asList(DepartmentName.values());
this.deptInfoList = deptInfoList;
}

@Override
Expand Down Expand Up @@ -87,7 +79,7 @@ public List<NoticeCategoryNameResult> lookupSupportedCategories() {

@Override
public List<NoticeDepartmentNameResult> lookupSupportedDepartments() {
return convertDepartmentNameDtos(supportedDepartmentNameList);
return convertDepartmentNameDtos(deptInfoList);
}

@Override
Expand Down Expand Up @@ -191,9 +183,9 @@ private List<NoticeRangeLookupResult> getDepartmentNoticeRangeLookup(NoticeRange
.toList();
}

private List<NoticeDepartmentNameResult> convertDepartmentNameDtos(List<DepartmentName> departmentNames) {
return departmentNames.stream()
.filter(dn -> !dn.equals(DepartmentName.COMM_DESIGN))
private List<NoticeDepartmentNameResult> convertDepartmentNameDtos(List<DeptInfo> deptInfos) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(질문) DepartmentName 에서 DeptInfo쪽으로 바뀐 이유가 졸업여부 정보 떄문인가요??

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 DepartmentName은 graduated 필드가 없어서 여기에 새로 추가하는거보다 원래 있던 DeptInfo의 isSupportGraduateScrap()를 쓰는게 나을 것 같아서 DeptInfo로 바꿨습니다!

return deptInfos.stream()
.filter(dept -> !dept.getDepartmentName().equals(DepartmentName.COMM_DESIGN))
.map(NoticeDepartmentNameResult::from)
.toList();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,15 @@ public enum DepartmentName {
LIVING_DESIGN("living_design", "livingdesign", "리빙디자인학과"),
CONT_ART("contemporary_art", "contemporaryart", "현대미술학과"),
MOV_IMAGE("moving_image_film", "movingimages", "영상학과"),
MEDIA_ACTING("media_acting", "mediaacting", "매체연기학과"),

JAPANESE_EDU("japanese_education", "japan", "일어교육과"),
MATH_EDU("mathematics_education", "mathedu", "수학교육과"),
PHY_EDU("physical_education", "kupe", "체육교육과"),
MUSIC_EDU("music_education", "music", "음악교육과"),
EDU_TECH("education_technology", "edutech", "교육공학과"),
ENGLISH_EDU("english_education", "englishedu", "영어교육과"),
EDUCATION("education", "edu", "교육학과"),
EDUCATION("education", "edu", "교직과"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오잉 이거 한글명 교직과가 맞나유??
edu.konkuk.ac.kr들어가보니 "교육학과"로 나와서유!


ELE_EDU_CENTER("elective_education_center", "sgedu", "교양교육센터"),
VOLUNTEER("volunteer_center", "kuvolunteer", "사회봉사센터"),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.architecture;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class ArchitectureDept extends ArchitectureCollege {
public ArchitectureDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public ArchitectureDept(
this.noticeScrapInfo = new NoticeScrapInfo(ARCHITECTURE.getHostPrefix(), 397);
this.departmentName = ARCHITECTURE;
this.noticeGraduationInfo = new NoticeScrapInfo(ARCHITECTURE.getHostPrefix(), 748);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.art_design;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class IndustrialDesignDept extends ArtDesignCollege {
public IndustrialDesignDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public IndustrialDesignDept(
this.noticeScrapInfo = new NoticeScrapInfo(IND_DESIGN.getHostPrefix(), 4017);
this.departmentName = IND_DESIGN;
this.noticeGraduationInfo = new NoticeScrapInfo(IND_DESIGN.getHostPrefix(), 5683);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.art_design;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -18,7 +19,8 @@ public class LivingDesignDept extends ArtDesignCollege {
public LivingDesignDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -30,5 +32,6 @@ public LivingDesignDept(
this.noticeScrapInfo = new NoticeScrapInfo(LIVING_DESIGN.getHostPrefix(), 962);
this.departmentName = LIVING_DESIGN;
this.noticeGraduationInfo = new NoticeScrapInfo(LIVING_DESIGN.getHostPrefix(), 487);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package com.kustacks.kuring.worker.scrap.deptinfo.art_design;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
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.deptinfo.NoticeScrapInfo;
import com.kustacks.kuring.worker.scrap.deptinfo.RegisterDepartmentMap;
import com.kustacks.kuring.worker.scrap.deptinfo.StaffScrapInfo;

import java.util.List;

import static com.kustacks.kuring.notice.domain.DepartmentName.MEDIA_ACTING;

@RegisterDepartmentMap(key = MEDIA_ACTING)
public class MediaActingDept extends ArtDesignCollege {

public MediaActingDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
this.htmlParser = latestPageNoticeHtmlParser;
this.latestPageNoticeProperties = latestPageNoticeProperties;

List<Integer> siteIds = List.of(11299);
this.staffScrapInfo = new StaffScrapInfo(MEDIA_ACTING.getHostPrefix(), siteIds);
this.noticeScrapInfo = new NoticeScrapInfo(MEDIA_ACTING.getHostPrefix(), 493);
this.departmentName = MEDIA_ACTING;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.art_design;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class MovingImageFilmDept extends ArtDesignCollege {
public MovingImageFilmDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public MovingImageFilmDept(
this.noticeScrapInfo = new NoticeScrapInfo(MOV_IMAGE.getHostPrefix(), 491);
this.departmentName = MOV_IMAGE;
this.noticeGraduationInfo = new NoticeScrapInfo(MOV_IMAGE.getHostPrefix(), 5710);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.education;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class EducationalTechnologyDept extends EducationCollege {
public EducationalTechnologyDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public EducationalTechnologyDept(
this.noticeScrapInfo = new NoticeScrapInfo(EDU_TECH.getHostPrefix(), 4020);
this.departmentName = EDU_TECH;
this.noticeGraduationInfo = new NoticeScrapInfo(EDU_TECH.getHostPrefix(), 4092);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.education;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class EnglishEducationDept extends EducationCollege {
public EnglishEducationDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public EnglishEducationDept(
this.noticeScrapInfo = new NoticeScrapInfo(ENGLISH_EDU.getHostPrefix(), 505);
this.departmentName = ENGLISH_EDU;
this.noticeGraduationInfo = new NoticeScrapInfo(ENGLISH_EDU.getHostPrefix(), 990);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.education;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class PhysicalEducationDept extends EducationCollege {
public PhysicalEducationDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public PhysicalEducationDept(
this.noticeScrapInfo = new NoticeScrapInfo(PHY_EDU.getHostPrefix(), 501);
this.departmentName = PHY_EDU;
this.noticeGraduationInfo = new NoticeScrapInfo(PHY_EDU.getHostPrefix(), 979);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.engineering;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class BiologicalDept extends EngineeringCollege {
public BiologicalDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public BiologicalDept(
this.noticeScrapInfo = new NoticeScrapInfo(BIOLOGICAL.getHostPrefix(), 790);
this.departmentName = BIOLOGICAL;
this.noticeGraduationInfo = new NoticeScrapInfo(BIOLOGICAL.getHostPrefix(), 417);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.kustacks.kuring.worker.scrap.deptinfo.engineering;

import com.kustacks.kuring.worker.parser.notice.LatestPageNoticeHtmlParser;
import com.kustacks.kuring.worker.scrap.client.notice.LatestPageGraduateNoticeApiClient;
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.deptinfo.NoticeScrapInfo;
Expand All @@ -17,7 +18,8 @@ public class ChemicalDivisionDept extends EngineeringCollege {
public ChemicalDivisionDept(
LatestPageNoticeApiClient latestPageNoticeApiClient,
LatestPageNoticeHtmlParser latestPageNoticeHtmlParser,
LatestPageNoticeProperties latestPageNoticeProperties
LatestPageNoticeProperties latestPageNoticeProperties,
LatestPageGraduateNoticeApiClient latestPageGraduateNoticeApiClient
) {
super();
this.noticeApiClient = latestPageNoticeApiClient;
Expand All @@ -29,5 +31,6 @@ public ChemicalDivisionDept(
this.noticeScrapInfo = new NoticeScrapInfo(CHEMI_DIV.getHostPrefix(), 409);
this.departmentName = CHEMI_DIV;
this.noticeGraduationInfo = new NoticeScrapInfo(CHEMI_DIV.getHostPrefix(), 769);
this.latestPageGraduateNoticeApiClient = latestPageGraduateNoticeApiClient;
}
}
Loading