Skip to content

Commit

Permalink
Merge pull request #46 from TeamDMU/fix/notice-save
Browse files Browse the repository at this point in the history
[Fix] 공지사항 저장이 안되는 문제 해결
  • Loading branch information
GiJungPark authored Nov 4, 2024
2 parents 742fe48 + bdd9f94 commit 13019f2
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class DepartmentNoticeParser(
val document = htmlLoader.get(generateSearchUrl())

return document.select(".board-table tbody tr")
.map { row -> parseRow(row) }
.mapNotNull { row -> parseRow(row) }
.toList()

}
Expand All @@ -33,8 +33,8 @@ class DepartmentNoticeParser(
this.major = major
}

private fun parseRow(row: Element): Notice {
val number = row.select(".td-num").text().toInt()
private fun parseRow(row: Element): Notice? {
val number = row.select(".td-num").text().toIntOrNull() ?: return null
val title = row.select(".td-subject a").text()
val author = row.select(".td-write").text()
val url = generateUrlFromSearch(row.select(".td-subject a").attr("href"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ internal class MongoConfig(
return MongoTemplate(mongoClient(), database)
}

@Bean
fun transactionManager(mongoDatabaseFactory: MongoDatabaseFactory): MongoTransactionManager{
return MongoTransactionManager(mongoDatabaseFactory)
}
// @Bean
// fun transactionManager(mongoDatabaseFactory: MongoDatabaseFactory): MongoTransactionManager{
// return MongoTransactionManager(mongoDatabaseFactory)
// }

}
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class DietEntityRepository(
private val dietRepository: DietMongoRepository,
) : DietRepository {

@Transactional
// @Transactional
override fun write(diets: List<Diet>) {
dietRepository.deleteAll()
dietRepository.save(DietMapper.mapToEntity(diets))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ internal class ScheduleEntityRepository(
private val scheduleMongoRepository: ScheduleMongoRepository
) : ScheduleRepository {

@Transactional
// @Transactional
override fun write(schedules: List<Schedule.Year>) {
scheduleMongoRepository.deleteAll()
scheduleMongoRepository.save(ScheduleMapper.mapToEntity(schedules))
Expand Down

0 comments on commit 13019f2

Please sign in to comment.