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

core:model 생성 #311

Merged
merged 37 commits into from
Jul 20, 2024

Conversation

eastshine2741
Copy link
Collaborator

드디어!

  • Lecture 관련
    • 오랜 고민 끝에... CustomLecture 클래스를 따로 만들지 않았다.
      • 상속 관계가 너무 복잡해진다.
      • custom 강의에선 존재하지 않는 필드는 Lecture에 null로 두었다. 강의 상세 페이지에서는 null이 아닌 필드만을 보여주면 된다.
  • ModelExt에 있는 함수들 확인 필요
  • :app에서 아직 발견 못한 굴지의 model이 있는지 확인 필요

@eastshine2741 eastshine2741 requested a review from a team as a code owner July 7, 2024 12:10
@eastshine2741 eastshine2741 changed the base branch from develop to refactor/multi-module-base-branch July 7, 2024 12:10
@eastshine2741 eastshine2741 changed the title 모델 생성 :core:model 생성 Jul 7, 2024
@eastshine2741 eastshine2741 changed the title :core:model 생성 core:model 생성 Jul 7, 2024
@JuTaK97
Copy link
Collaborator

JuTaK97 commented Jul 20, 2024

7/20 논의 반영 완료!
https://www.notion.so/wafflestudio/7-20-dcbe6381adce423c90fdede4d2e68d25?pvs=4

주요 내용 정리

  • PlaceTime.place -> PlaceTime.placeName 으로 변경, 타입도 Place -> String 으로 변경 87422e
  • Color 필드는 다크모드 맥락을 포함하도록 변경한다. 다크/라이트, 백/포워드로 총 4개의 필드를 갖게 된다. dca0bc8
  • BuildInTheme와 CustomTheme 는 통합한다. Theme는 List<LectureColor>를 갖고, 기존의 BuiltInTheme들은 Theme.BuiltIn.Autumn 과 같이 사용할 수 있는 named object로 변경한다. 6221f59
  • Lecture 는 OriginLecture, TimetableLecture 의 하위 클래스를 갖도록 확정하고, OriginLecture, TimeTableLecture 클래스의 생성자에서 필요없는 필드는 받지 않도록 하고 null 로 값을 고정시킨다. 또한 Lecture에서 colorIndex 필드를 제거하고, 오직 Color? 만 가지도록 한다. OriginLecture은 생성자 단에서 color를 설정할 수 없고 무조건 null로 설정되며, TimeTableLecture만 생성자에 color 파라미터를 받는다. 1c22719
  • TimeTableLecture은 네트워크 모델로부터 직접 변환되지 않고(color를 몰라서 변환 불가능!), TimetableDTO의 변환 함수 속에서, Timetable.theme, TimetableDTO.lectures 의 LectureDTO.color, LectureDTO.colorIndex 로 계산되는 로직에 의해 color 필드가 할당된다.

Comment on lines 89 to 99

override fun hashCode(): Int {
return listOf(
id, originalLectureId, title, instructor, department,
academicYear, credit, classification, category, courseNumber, lectureNumber,
quota, freshmanQuota, remark, placeTimes, color, registrationCount, wasFull,
).fold(0) { current, value ->
current * 31 + (value?.hashCode() ?: 0)
}
}
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

헉 이런 방법이

Copy link
Collaborator

@JuTaK97 JuTaK97 left a comment

Choose a reason for hiding this comment

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

GOGO

@JuTaK97 JuTaK97 merged commit c91e3ae into refactor/multi-module-base-branch Jul 20, 2024
@JuTaK97 JuTaK97 deleted the eastshine2741/create-model branch July 20, 2024 14:03
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.

None yet

3 participants