1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586 |
- //
- // TSAIListHistoryBaseVM.swift
- // AIEmoji
- //
- // Created by 100Years on 2025/4/9.
- //
- import Alamofire
- import ObjectMapper
- class TSAIListHistoryBaseVM {
- var colDataArray:[TSComponent] = [TSComponent]()
- lazy var historySeciton: TSGenmojiCoLSectionModel = {
- debugPrint("123")
- let sectionModel = TSGenmojiCoLSectionModel()
- sectionModel.style = .changeAgeHistory
- sectionModel.name = "History".localized
- for model in listModelArray {
- let itemModel = TSGenmojiCoLItemModel()
- itemModel.style = sectionModel.style
- itemModel.dataModel = model
- sectionModel.items.append(itemModel)
- }
- debugPrint("456")
- return sectionModel
- }()
-
- var generatorStyle:TSGeneratorImageStyle
- init(generatorStyle:TSGeneratorImageStyle) {
- self.generatorStyle = generatorStyle
- self.combinedData()
- }
-
- func combinedData(){
- colDataArray.removeAll()
-
- if historySeciton.items.count > 0 {
- colDataArray.append(historySeciton)
- }
- }
-
- func removeAllHistoryList(){
- switch generatorStyle {
- case .ageOld:
- TSChangeOldAgeHistory.shared.removeALLModel()
- case .ageChild:
- TSChangeBabyAgeHistory.shared.removeALLModel()
- case .oldPhoto:
- TSChangeOldPhotoHistory.shared.removeALLModel()
- case .eyeOpen:
- TSAIEyeOpenHistory.shared.removeALLModel()
- case .pretty:
- TSAIPhotoPrettyHistory.shared.removeALLModel()
- case .photoLive:
- TSAIPhotoLiveHistory.shared.removeALLModel()
- case .photoExpand:
- TSAIPhotoExpandHistory.shared.removeALLModel()
- }
-
- colDataArray.removeAll()
- }
-
- }
-
- extension TSAIListHistoryBaseVM {
- var listModelArray:[TSActionInfoModel]{
- switch generatorStyle {
- case .ageOld:
- TSChangeOldAgeHistory.shared.listModels
- case .ageChild:
- TSChangeBabyAgeHistory.shared.listModels
- case .oldPhoto:
- TSChangeOldPhotoHistory.shared.listModels
- case .eyeOpen:
- TSAIEyeOpenHistory.shared.listModels
- case .pretty:
- TSAIPhotoPrettyHistory.shared.listModels
- case .photoLive:
- TSAIPhotoLiveHistory.shared.listModels
- case .photoExpand:
- TSAIPhotoExpandHistory.shared.listModels
- }
- }
- }
|