Skip to content
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

Merged
merged 18 commits into from
May 18, 2024

Conversation

tlarbals824
Copy link
Contributor

🗃 Issue

  • Close #이슈번호

🔥 Task

  • 가정통신문 조회 및 요약 스케쥴러 추가

  • 가정통신문 도메인 추가

  • 이미지에서 텍스트 추출, 텍스트 요약 인터페이스 및 구현체 추가

  • 교육청 조회는 아직 추가 안됨

  • 지금까지 저장한 부분에 대해서 다시 저장히지못하도록 추가해야함

📄 Reference

  • None

@tlarbals824 tlarbals824 requested a review from sominyun May 17, 2024 11:12
@tlarbals824 tlarbals824 self-assigned this May 17, 2024

@Scheduled(cron = "0 0 9-18 * * MON-FRI")
fun addEducationOfficeAnnouncement() {
val batchSize = 100
Copy link
Member

Choose a reason for hiding this comment

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

현재 학교에서 10개만 가져오는데 batchsize가 100일 필요가 왜 있는지

Copy link
Member

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)
Copy link
Member

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 {}
Copy link
Member

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 ->
Copy link
Member

Choose a reason for hiding this comment

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

acc가 어떤건지 잘 모르겠어서 바꿔볼까..??

Comment on lines +37 to +45
"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
Copy link
Member

Choose a reason for hiding this comment

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

map 말고 다른 방법은 없나ㅏㅏ????

@tlarbals824 tlarbals824 merged commit b9becbc into develop May 18, 2024
1 check passed
@tlarbals824 tlarbals824 deleted the feature/#69-crawling-announcement branch May 18, 2024 12:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants