Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

object CODE {
const val SCHOOL_CODE = 1

Expand Down Expand Up @@ -31,4 +30,6 @@ object CODE {
const val HOTEL_TOURISM_CODE = 604
const val MANAGEMENT_INFORMATION_CODE = 605
const val BIG_DATA_MANAGEMENT_CODE = 606

const val UNDECLARED_MAJOR_CODE = 701
Copy link
Contributor

Choose a reason for hiding this comment

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

UNDECLARED_MAJOR_CODE는 오류 코드처럼 보일 수도 있을거 같아요!
처음 보고서 오류 코드를 추가하신 불 알았어요.
LIBERAL_MAJOR_CODE, INTERDISCIPLINARY_CODE,
EXPLORATORY_MAJOR_CODE가 더 명확하지 않을까 제안해봅니다!

}
Original file line number Diff line number Diff line change
@@ -1,19 +1,18 @@
package com.dongyang.android.youdongknowme.standard.util

sealed class Department(
var name: String,
var code: Int
var name: String, var code: Int
) {
object Mechanical : Department("기계공학과", CODE.MECHANICAL_ENGINE_CODE)
object MechanicalDesign : Department("기계설계공학과", CODE.MECHANICAL_DESIGN_CODE)
object Automation : Department("자동화공학과", CODE.AUTOMATION_ENGINE_CODE)
object Robot : Department("로봇공학과", CODE.ROBOT_ENGINE_CODE)
object Robot : Department("로봇소프트웨어과", CODE.ROBOT_ENGINE_CODE)
object Electrical : Department("전기공학과", CODE.ELECTRICAL_ENGINE_CODE)
object InfoElectrical : Department("정보전자공학과", CODE.INFO_ELECTRONIC_ENGINE_CODE)
object Semiconductor : Department("반도체전자공학과", CODE.SEMICONDUCTOR_ENGINE_CODE)
object InfoCommunication : Department("정보통신공학과", CODE.INFO_COMMUNICATION_ENGINE_CODE)
object FireManagement : Department("소방안전관리과", CODE.FIRE_MANAGEMENT_CODE)
object ComputerInfo : Department("컴퓨터정보공학과", CODE.COMPUTER_INFO_ENGINE_CODE)
object ComputerInfo : Department("웹응용소프트웨어공학과", CODE.COMPUTER_INFO_ENGINE_CODE)
Copy link
Contributor

Choose a reason for hiding this comment

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

바뀐 학과명에 맞춰서 object명과 CODE를 변경해야 나중에 혼선이 없을거 같아요
아래처럼 바꾸면 어떨까요?

ROBOT_ENGINE_CODE -> ROBOT_SOFTWARE_CODE
ComputerInfo -> WebAppSofware
COMPUTER_INFO_ENGINE_CODE -> WEB_APP_SOFTWARE_ENGINE_CODE

object ComputerSoftware : Department("컴퓨터소프트웨어공학과", CODE.COMPUTER_SOFTWARE_ENGINE_CODE)
object Artificial : Department("인공지능소프트웨어학과", CODE.ARTIFICIAL_ENGINE_CODE)
object Biochemical : Department("생명화학공학과", CODE.BIOCHEMICAL_ENGINE_CODE)
Expand All @@ -28,20 +27,21 @@ sealed class Department(
object HotelTourism : Department("호텔관광학과", CODE.HOTEL_TOURISM_CODE)
object BusinessInfo : Department("경영정보학과", CODE.MANAGEMENT_INFORMATION_CODE)
object BigDataManagement : Department("빅데이터경영과", CODE.BIG_DATA_MANAGEMENT_CODE)
object UndeclaredMajor : Department("자유전공학과", CODE.UNDECLARED_MAJOR_CODE)

companion object {
fun getDepartment(department: String): Department {
return when (department) {
"기계공학과" -> Mechanical
"기계설계공학과" -> MechanicalDesign
"로봇공학과" -> Robot
"로봇소프트웨어과" -> Robot
"자동화공학과" -> Automation
"전기공학과" -> Electrical
"정보전자공학과" -> InfoElectrical
"반도체전자공학과" -> Semiconductor
"정보통신공학과" -> InfoCommunication
"소방안전관리과" -> FireManagement
"컴퓨터정보공학과" -> ComputerInfo
"웹응용소프트웨어공학과" -> ComputerInfo
"컴퓨터소프트웨어공학과" -> ComputerSoftware
"인공지능소프트웨어학과" -> Artificial
"생명화학공학과" -> Biochemical
Expand All @@ -56,38 +56,9 @@ sealed class Department(
"호텔관광학과" -> HotelTourism
"경영정보학과" -> BusinessInfo
"빅데이터경영과" -> BigDataManagement
"자유전공학과" -> UndeclaredMajor
Copy link
Contributor

Choose a reason for hiding this comment

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

위에 코드명을 바꾸게 된다면 같이 수정해야합니다!

Copy link
Contributor

Choose a reason for hiding this comment

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

여기도 수정이요!

Suggested change
"자유전공학과" -> UndeclaredMajor
"자유전공학과" -> LiberalMajor

else -> throw IllegalArgumentException("올바른 타입이 아닙니다.")
}
}

fun getDepartmentList(): ArrayList<Department> {
return arrayListOf(
Mechanical,
MechanicalDesign,
Automation,
Robot,
Electrical,
InfoElectrical,
Semiconductor,
InfoCommunication,
FireManagement,
ComputerInfo,
ComputerSoftware,
Artificial,
Biochemical,
BioConvergence,
Architecture,
InteriorDesign,
VisualDesign,
ArVrContents,
Business,
TaxAccounting,
DistributionMarketing,
HotelTourism,
BusinessInfo,
BigDataManagement
)
}
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,7 @@ class DepartActivity : BaseActivity<ActivityDepartBinding, DepartViewModel>(), D
override fun initStartView() {
// 학과 리스트
items =
resources.getStringArray(R.array.dmu_department_list).toCollection(ArrayList<String>())
items.sort()
resources.getStringArray(R.array.dmu_department_list).toCollection(ArrayList())
Copy link
Contributor

Choose a reason for hiding this comment

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

👍


adapter = DepartAdapter().apply {
submitList(items)
Expand Down
5 changes: 3 additions & 2 deletions app/src/main/res/values/arrays.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
<string-array name="dmu_department_list">
<item>기계공학과</item>
<item>기계설계공학과</item>
<item>로봇공학과</item>
<item>로봇소프트웨어과</item>
<item>자동화공학과</item>
<item>전기공학과</item>
<item>정보전자공학과</item>
<item>반도체전자공학과</item>
<item>정보통신공학과</item>
<item>소방안전관리과</item>
<item>컴퓨터소프트웨어공학과</item>
<item>컴퓨터정보공학과</item>
<item>웹응용소프트웨어공학과</item>
<item>인공지능소프트웨어학과</item>
<item>생명화학공학과</item>
<item>바이오융합공학과</item>
Expand All @@ -25,5 +25,6 @@
<item>호텔관광학과</item>
<item>경영정보학과</item>
<item>빅데이터경영과</item>
<item>자유전공학과</item>
</string-array>
</resources>
Loading