models.go 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142
  1. package schedule
  2. type TypeRow uint8
  3. const (
  4. IsCycleTR = 0
  5. IsStartTR = 1
  6. IsPmTR = 2
  7. IsSubTR = 3
  8. )
  9. type Schedule struct {
  10. Day DayType
  11. Group string
  12. Table []Row
  13. }
  14. type Row struct {
  15. Subject [ALL]string
  16. Teacher [ALL]string
  17. Cabinet [ALL]string
  18. }
  19. type PlanXLSX struct {
  20. ProgramCode string `json:"program_code"`
  21. NameCode string `json:"name_code"`
  22. PeriodOfStudy string `json:"period_of_study"`
  23. GroupNumber string `json:"group_number"`
  24. Lines []LineXLSX `json:"lines"`
  25. }
  26. type LineXLSX struct {
  27. ID string `json:"id"`
  28. Name string `json:"name"`
  29. CertForm string `json:"cert_form"`
  30. StudyLoad StudyLoadXLSX `json:"study_load"`
  31. Course [4][2]int `json:"course"`
  32. TypeRow TypeRow `json:"typerow"`
  33. }
  34. type StudyLoadXLSX struct {
  35. Max int `json:"max"`
  36. SelfStudy int `json:"self_study"`
  37. AllStudy int `json:"all_study"`
  38. Lectures int `json:"lectures"`
  39. Labs int `json:"labs"`
  40. Projects int `json:"projects"`
  41. Consultation int `json:"consultation"`
  42. }
  43. type DayType uint8
  44. const (
  45. SUNDAY DayType = 0
  46. MONDAY DayType = 1
  47. TUESDAY DayType = 2
  48. WEDNESDAY DayType = 3
  49. THURSDAY DayType = 4
  50. FRIDAY DayType = 5
  51. SATURDAY DayType = 6
  52. )
  53. type SubgroupType uint8
  54. const (
  55. A SubgroupType = 0
  56. B SubgroupType = 1
  57. ALL SubgroupType = 2
  58. )
  59. type SubjectType uint8
  60. const (
  61. THEORETICAL SubjectType = 0
  62. PRACTICAL SubjectType = 1
  63. )
  64. type Generator struct {
  65. Day DayType
  66. Debug bool
  67. Groups map[string]*Group
  68. Teachers map[string]*Teacher
  69. Cabinets map[string]*Cabinet
  70. // Blocked map[string]bool
  71. Reserved Reserved
  72. }
  73. type Reserved struct {
  74. Teachers map[string][]bool
  75. Cabinets map[string][]bool
  76. }
  77. type Teacher struct {
  78. Name string `json:"name"`
  79. Cabinets []Cabinet `json:"cabinets"`
  80. }
  81. type Cabinet struct {
  82. Name string `json:"name"`
  83. IsComputer bool `json:"is_computer"`
  84. }
  85. type Group struct {
  86. Name string
  87. Quantity uint // students count
  88. Subjects map[string]*Subject
  89. }
  90. type Subject struct {
  91. Name string
  92. IsComputer bool
  93. Teacher string
  94. Teacher2 string
  95. SaveWeek uint
  96. Lessons Lessons
  97. }
  98. type Lessons struct {
  99. Theory uint
  100. Practice Subgroup
  101. Week Subgroup
  102. }
  103. type Subgroup struct {
  104. A uint
  105. B uint
  106. }
  107. type GroupJSON struct {
  108. Name string `json:"name"`
  109. Quantity uint `json:"quantity"`
  110. Subjects []SubjectJSON `json:"subjects"`
  111. }
  112. type SubjectJSON struct {
  113. Name string `json:"name"`
  114. Teacher string `json:"teacher"`
  115. IsComputer bool `json:"is_computer"`
  116. Lessons LessonsJSON `json:"lessons"`
  117. }
  118. type LessonsJSON struct {
  119. Theory uint `json:"theory"`
  120. Practice uint `json:"practice"`
  121. Week uint `json:"week"`
  122. }