package com.dayu.general.tool
|
|
/**
|
* 卡片操作类型
|
* 用于区分不同的卡片操作
|
*/
|
sealed class CardOperationType(val code: Int, val description: String) {
|
object OpenCard : CardOperationType(1, "开卡")
|
object Recharge : CardOperationType(2, "充值")
|
object CancelCard : CardOperationType(3, "销卡")
|
object ReplaceCard : CardOperationType(4, "补卡")
|
object DeductCard : CardOperationType(5, "补扣")
|
object CleanCard : CardOperationType(6, "清零卡")
|
object CheckCard : CardOperationType(7, "检查卡")
|
|
companion object {
|
fun fromCode(code: Int): CardOperationType? {
|
return when (code) {
|
1 -> OpenCard
|
2 -> Recharge
|
3 -> CancelCard
|
4 -> ReplaceCard
|
5 -> DeductCard
|
else -> null
|
}
|
}
|
}
|
}
|