-
Notifications
You must be signed in to change notification settings - Fork 0
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
feat: 가정통신문 크롤링 및 요약 스케쥴러 추가 #71
Conversation
# Conflicts: # src/main/kotlin/com/asap/asapbackend/domain/classroom/application/dto/GetAnnouncements.kt # src/main/kotlin/com/asap/asapbackend/domain/classroom/domain/model/Classroom.kt
...m/asap/asapbackend/client/crawling/announcement/EducationOfficeAnnouncementCrawlingClient.kt
Show resolved
Hide resolved
|
||
@Scheduled(cron = "0 0 9-18 * * MON-FRI") | ||
fun addEducationOfficeAnnouncement() { | ||
val batchSize = 100 |
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.
현재 학교에서 10개만 가져오는데 batchsize가 100일 필요가 왜 있는지
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.
차라리 batch랑 hasNext 지우는걸로 할까
val hasNext = schoolAnnouncements.hasNext() | ||
val announcementFluxes = schoolAnnouncements.map { schoolAnnouncement -> | ||
val startIdx = schoolAnnouncementRepository.findLastIndex(schoolAnnouncement.getSchoolId()) | ||
retrieveAnnouncementInfoFromCrawlingServer(schoolAnnouncement, startIdx, batchSize) |
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.
startIdx+1을 넣도록
import org.springframework.scheduling.annotation.Scheduled | ||
import org.springframework.stereotype.Component | ||
|
||
private val logger = KotlinLogging.logger {} |
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.
안쓰면 지울까.?
|
||
val announcements = announcementDataContainer.schoolAnnouncementInfo.groupBy { it.index } | ||
.map { | ||
it.value.reduce { acc, educationOfficeAnnouncementInfo -> |
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.
acc가 어떤건지 잘 모르겠어서 바꿔볼까..??
"version" to "v2", | ||
"requestId" to UUID.randomUUID(), | ||
"timestamp" to 0, | ||
"lang" to "ko", | ||
"images" to listOf( | ||
mapOf( | ||
"format" to "png", | ||
"name" to "string", | ||
"url" to imageUrl |
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.
map 말고 다른 방법은 없나ㅏㅏ????
🗃 Issue
🔥 Task
가정통신문 조회 및 요약 스케쥴러 추가
가정통신문 도메인 추가
이미지에서 텍스트 추출, 텍스트 요약 인터페이스 및 구현체 추가
교육청 조회는 아직 추가 안됨
지금까지 저장한 부분에 대해서 다시 저장히지못하도록 추가해야함
📄 Reference