-
Notifications
You must be signed in to change notification settings - Fork 0
Fix: 학과 공지 업데이트 오류 수정, 학과 목록 조회 api 수정 #310
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 6 commits
ebe8a6b
dded893
1500013
daab412
a9d107f
e880cbc
b365d03
6482cd0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| 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 |
|---|---|---|
|
|
@@ -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; | ||
|
|
@@ -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.*; | ||
| import java.util.stream.Collectors; | ||
|
|
||
| import static com.kustacks.kuring.notice.domain.CategoryName.DEPARTMENT; | ||
|
|
@@ -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 | ||
|
|
@@ -87,7 +79,7 @@ public List<NoticeCategoryNameResult> lookupSupportedCategories() { | |
|
|
||
| @Override | ||
| public List<NoticeDepartmentNameResult> lookupSupportedDepartments() { | ||
| return convertDepartmentNameDtos(supportedDepartmentNameList); | ||
| return convertDepartmentNameDtos(deptInfoList); | ||
| } | ||
|
|
||
| @Override | ||
|
|
@@ -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) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (질문) DepartmentName 에서 DeptInfo쪽으로 바뀐 이유가 졸업여부 정보 떄문인가요??
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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(); | ||
| } | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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", "교직과"), | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 오잉 이거 한글명 교직과가 맞나유?? |
||
|
|
||
| ELE_EDU_CENTER("elective_education_center", "sgedu", "교양교육센터"), | ||
| VOLUNTEER("volunteer_center", "kuvolunteer", "사회봉사센터"), | ||
|
|
||
| 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; | ||
| } | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
여러게 import시 *로 한번에 바꿔버리는 옵션을 꺼주세요~ 팀원들 입장에서 util.*로 보이면 뭐를 가져다 쓰는지 import만 보고 확인이 어려워져요!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
아하 넵!!