Skip to content

25학번 이전 교양분류 보여주는 기능 추가#325

Merged
asp345 merged 13 commits intodevelopfrom
feature/old-category
Jan 29, 2025
Merged

25학번 이전 교양분류 보여주는 기능 추가#325
asp345 merged 13 commits intodevelopfrom
feature/old-category

Conversation

@asp345
Copy link
Member

@asp345 asp345 commented Jan 23, 2025

25학년도부터 교양 분류가 변경되면서 기존 재학생들이 들어야 하는 교양 찾기가 어려워져서 제안된 기능입니다
수강스누 배치에 같이 돌아가게 되어 있고 엑셀 파일은 컴공 홈페이지에서 제공하는 구글 드라이브 링크로 받아오고 있어요

@asp345 asp345 requested review from a team and PFCJeong as code owners January 23, 2025 10:26
@asp345 asp345 requested review from Hank-Choi, SeonghaeJo and davin111 and removed request for a team January 23, 2025 10:26
@SeonghaeJo
Copy link
Contributor

oldCategory로 네이밍했는데 나중에 분류 기준이 또 바뀔 수 있으니깐 categoryUntil2024 같은 네이밍이 나을 듯

try {
val currentCourseNumber = row.getCell(7).stringCellValue
val oldCategory = row.getCell(1).stringCellValue
if (currentCourseNumber.isBlank() || oldCategory.isBlank()) {
Copy link
Contributor

@SeonghaeJo SeonghaeJo Jan 27, 2025

Choose a reason for hiding this comment

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

위에 isNotBlank로 필터링하는 로직이 있어서 로직이 중복되는 것 같아요.
아래 filter 부분은 없어도 될 것 같아요

.filter { row ->
    row.getCell(7).stringCellValue.isNotBlank() && row.getCell(1).stringCellValue.isNotBlank()
}

@asp345
Copy link
Member Author

asp345 commented Jan 28, 2025

categoryPre2025로 이름 바꾸고 리뷰해주신 내용 수정했습니다
연휴 중에 되면 좋을거 같아서 오늘 중으로 머지할게요

@asp345 asp345 merged commit 31df080 into develop Jan 29, 2025
2 checks passed
@asp345 asp345 deleted the feature/old-category branch January 29, 2025 02:49
) : SugangSnuSyncService {
override suspend fun updateCoursebook(coursebook: Coursebook): List<UserLectureSyncResult> {
val newLectures = sugangSnuFetchService.getSugangSnuLectures(coursebook.year, coursebook.semester)
val courseNumberCategoryPre2025Map = categoryPre2025FetchService.getCategoriesPre2025()
Copy link
Member

Choose a reason for hiding this comment

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

sync쪽에 들어있는것보다 sugangSnuFetchService 에 들어있는게 어떨지?

Comment on lines +11 to +36
@Component
class CategoryPre2025Repository(
private val googleDocsApi: GoogleDocsApi,
) {
companion object {
const val SPREADSHEET_PATH = "/spreadsheets/d"
const val SPREADSHEET_KEY = "/1Ok2gu7rW1VYlKmC_zSjNmcljef0kstm19P9zJ_5s_QA"
}

suspend fun fetchCategoriesPre2025(): PooledDataBuffer =
googleDocsApi.get().uri { builder ->
builder.run {
path(SPREADSHEET_PATH)
path(SPREADSHEET_KEY)
path("/export")
queryParam("format", "xlsx")
build()
}
}.accept(MediaType.TEXT_HTML).awaitExchange {
if (it.statusCode().is2xxSuccessful) {
it.awaitBody()
} else {
throw it.createExceptionAndAwait()
}
}
}
Copy link
Member

Choose a reason for hiding this comment

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

이거 그냥 엑셀로 다운받아서 resources 폴더에 두는건 어떨까요?

Copy link
Member Author

@asp345 asp345 Feb 3, 2025

Choose a reason for hiding this comment

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

컴공 홈페이지에 있는 링크를 가져온 거라 변경사항 있을때 그쪽에서 바꾸면 반영되게 하려고 이렇게 했어요
변경이 아마도 안될거 같긴 해요

혹시 이게 내려가거나 하더라도 다시 개인이 전체 공개로 올려두면 사라질 일은 없어서 저는 괜찮을거 같아요

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.

3 participants