package com.xw.yunwei.model
|
|
import com.google.gson.annotations.SerializedName
|
|
data class NoticeModel(
|
/**
|
* 记录创建人,前端忽略
|
*/
|
@SerializedName("createBy")
|
val createBy: String? = null,
|
|
/**
|
* 记录创建时间,前端忽略
|
*/
|
@SerializedName("createTime")
|
val createTime: String? = null,
|
|
/**
|
* 数据id,根据通知类型区分具体业务数据
|
*/
|
@SerializedName("dataId")
|
val dataId: Long? = null,
|
|
/**
|
* 是否删除
|
* false=未删除(0) true=已删除(1)
|
*/
|
@SerializedName("deleted")
|
val deleted: Boolean? = null,
|
|
/**
|
* 自增id,通知记录唯一标识
|
*/
|
@SerializedName("id")
|
val id: Long? = null,
|
|
/**
|
* 通知内容
|
*/
|
@SerializedName("notificationContent")
|
val notificationContent: String? = null,
|
|
/**
|
* 通知类型
|
* 1=新增事故,2=事故即将超时提示,3=事故超时提示,4=排班信息变动,
|
* 5=事故状态变更,6=新增任务,7=任务过期提示,8=版本更新提示,
|
* 9=变更协议政策内容,10=变更协议内容并需用户授权,11=打卡成功通知
|
* 12=强制升级
|
*/
|
@SerializedName("notificationType")
|
val notificationType: Int? = null,
|
|
/**
|
* 消息拓展字段
|
*/
|
@SerializedName("notificationExt")
|
val notificationExt: String? = null,
|
|
/**
|
* 是否已读 0-未读 1-已读
|
*/
|
@SerializedName("readStatus")
|
var readStatus: Int? = null,
|
|
/**
|
* 通知人员id,接收该通知的用户ID
|
*/
|
@SerializedName("operationsUserId")
|
val operationsUserId: Long? = null,
|
|
/**
|
* 记录修改人,前端忽略
|
*/
|
@SerializedName("updateBy")
|
val updateBy: String? = null,
|
|
/**
|
* 记录修改时间,前端忽略
|
*/
|
@SerializedName("updateTime")
|
val updateTime: String? = null
|
) {
|
|
/**
|
* 通知类型枚举
|
* 对应 notificationType 字段的所有可能值
|
*/
|
enum class NotificationType(val value: Int, val description: String) {
|
/** 1=车辆事故告警 */
|
NEW_ACCIDENT(1, "车辆事故告警"),
|
|
/** 2=事故即将超时提示 */
|
ACCIDENT_SOON_TIMEOUT(2, "事故即将超时提示"),
|
|
/** 3=事故超时提示 */
|
ACCIDENT_TIMEOUT(3, "事故超时警示"),
|
|
/** 4=排班信息变动 */
|
SCHEDULE_CHANGE(4, "排班变更提示"),
|
|
/** 5=任务状态变更 */
|
ACCIDENT_STATUS_CHANGE(5, "任务状态变更"),
|
|
/** 6=新增任务 */
|
NEW_TASK(6, "待完成日常任务提示"),
|
|
/** 7=任务过期提示 */
|
TASK_EXPIRED(7, "日常任务过期提示"),
|
|
/** 8=版本更新提示 */
|
VERSION_UPDATE(8, "APP版本更新提示"),
|
|
/** 9=变更协议政策内容 */
|
POLICY_CHANGE(9, "协议政策内容更新提示"),
|
|
/** 10=变更协议内容并需用户授权 */
|
POLICY_CHANGE_NEED_AUTH(10, "协议政策内容更新授权"),
|
|
/** 11=打卡成功通知 */
|
CLOCK_IN_SUCCESS(11, "打卡成功通知"),
|
|
/** 12=强制升级 */
|
FORCE_UPGRADE(12, "APP版本更新提示");
|
|
companion object {
|
/**
|
* 根据值获取枚举
|
*/
|
fun fromValue(value: Int?): NotificationType? {
|
return entries.find { it.value == value }
|
}
|
}
|
}
|
|
/**
|
* 获取通知类型枚举
|
*/
|
fun getNotificationTypeEnum(): NotificationType? {
|
return NotificationType.fromValue(notificationType)
|
}
|
}
|