Visual_Novel_iOS/crush/Crush/Src/Modules/Friend/Model/NoticeModels.swift

58 lines
1.4 KiB
Swift
Raw Normal View History

2025-10-09 10:29:35 +00:00
//
// NoticeModels.swift
// Crush
//
// Created by Leon on 2025/8/28.
//
struct MessageStat: Codable {
var unRead: Int?
var latestContent: String?
///
var latestTime: Int?
}
struct MessageNotice: Codable {
var id: Int? // ID
var sendUserId: Int? // ID
var type: MessageType? //
var bizId: String? // ID
var status: Int? // 01
var title: String? //
var content: String? //
/// "{\"aiId\":439059452002305}"
var extras: String? //
var replaceJson: String? //
var createTime: Int?
func getExtra() -> MessageNoticeExtra?{
guard let extrasString = extras, extrasString.count > 0 else{
return nil
}
return CodableHelper.decode(MessageNoticeExtra.self, from: extrasString)
}
}
struct MessageNoticeExtra: Codable{
var aiId: Int?
}
enum MessageType: Int, Codable{
case loginWelcome = 100
case aiwelcomeGreeting = 101
case vipRenewSuccess = 102
case vipRenewFail = 103
case myAiGifted = 104
case myAiAlbumPhotoUnlock = 105
case heartBeatLevelDown = 106
func hasNoCheckEntrance()-> Bool{
switch self{
case .loginWelcome, .aiwelcomeGreeting:
return true
default:
return false
}
}
}