diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 8322bfa..28c6f31 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 65F2E04126B1724900179EBD /* EventViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E03F26B1724900179EBD /* EventViewController.xib */; }; 65F2E04426B2392600179EBD /* ListCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04226B2392600179EBD /* ListCustomCell.swift */; }; 65F2E04526B2392600179EBD /* ListCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E04326B2392600179EBD /* ListCustomCell.xib */; }; + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04626B25B5D00179EBD /* EventListModel.swift */; }; 9C82F906203FB8735A689DE4 /* Pods_LaserMethane.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */; }; /* End PBXBuildFile section */ @@ -86,6 +87,7 @@ 65F2E03F26B1724900179EBD /* EventViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventViewController.xib; sourceTree = ""; }; 65F2E04226B2392600179EBD /* ListCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCustomCell.swift; sourceTree = ""; }; 65F2E04326B2392600179EBD /* ListCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListCustomCell.xib; sourceTree = ""; }; + 65F2E04626B25B5D00179EBD /* EventListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListModel.swift; sourceTree = ""; }; 9D62480C27D0BD75CD9B2998 /* Pods-LaserMethane.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaserMethane.debug.xcconfig"; path = "Target Support Files/Pods-LaserMethane/Pods-LaserMethane.debug.xcconfig"; sourceTree = ""; }; C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -203,6 +205,7 @@ 65F2DFFF26B0129100179EBD /* LoginResultModel.swift */, 65F2E00026B0129100179EBD /* UserInfoModel.swift */, 65F2DFFD26B0128C00179EBD /* ActionResultModel.swift */, + 65F2E04626B25B5D00179EBD /* EventListModel.swift */, ); path = Model; sourceTree = ""; @@ -431,6 +434,7 @@ 65F2E02126B1242200179EBD /* DefaultTableViewCell.swift in Sources */, 65F2E00426B0129100179EBD /* UserInfoModel.swift in Sources */, 65F2E03226B164CC00179EBD /* LogViewController.swift in Sources */, + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */, 65F2DFCA26AFF2A900179EBD /* Constant.swift in Sources */, 65BF7C1C26AFDDCD000FEC82 /* AppDelegate.swift in Sources */, 65F2DFC526AFF1A300179EBD /* AppCoordinator.swift in Sources */, diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 8322bfa..28c6f31 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 65F2E04126B1724900179EBD /* EventViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E03F26B1724900179EBD /* EventViewController.xib */; }; 65F2E04426B2392600179EBD /* ListCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04226B2392600179EBD /* ListCustomCell.swift */; }; 65F2E04526B2392600179EBD /* ListCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E04326B2392600179EBD /* ListCustomCell.xib */; }; + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04626B25B5D00179EBD /* EventListModel.swift */; }; 9C82F906203FB8735A689DE4 /* Pods_LaserMethane.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */; }; /* End PBXBuildFile section */ @@ -86,6 +87,7 @@ 65F2E03F26B1724900179EBD /* EventViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventViewController.xib; sourceTree = ""; }; 65F2E04226B2392600179EBD /* ListCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCustomCell.swift; sourceTree = ""; }; 65F2E04326B2392600179EBD /* ListCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListCustomCell.xib; sourceTree = ""; }; + 65F2E04626B25B5D00179EBD /* EventListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListModel.swift; sourceTree = ""; }; 9D62480C27D0BD75CD9B2998 /* Pods-LaserMethane.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaserMethane.debug.xcconfig"; path = "Target Support Files/Pods-LaserMethane/Pods-LaserMethane.debug.xcconfig"; sourceTree = ""; }; C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -203,6 +205,7 @@ 65F2DFFF26B0129100179EBD /* LoginResultModel.swift */, 65F2E00026B0129100179EBD /* UserInfoModel.swift */, 65F2DFFD26B0128C00179EBD /* ActionResultModel.swift */, + 65F2E04626B25B5D00179EBD /* EventListModel.swift */, ); path = Model; sourceTree = ""; @@ -431,6 +434,7 @@ 65F2E02126B1242200179EBD /* DefaultTableViewCell.swift in Sources */, 65F2E00426B0129100179EBD /* UserInfoModel.swift in Sources */, 65F2E03226B164CC00179EBD /* LogViewController.swift in Sources */, + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */, 65F2DFCA26AFF2A900179EBD /* Constant.swift in Sources */, 65BF7C1C26AFDDCD000FEC82 /* AppDelegate.swift in Sources */, 65F2DFC526AFF1A300179EBD /* AppCoordinator.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index 0da8420..423982f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 8322bfa..28c6f31 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 65F2E04126B1724900179EBD /* EventViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E03F26B1724900179EBD /* EventViewController.xib */; }; 65F2E04426B2392600179EBD /* ListCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04226B2392600179EBD /* ListCustomCell.swift */; }; 65F2E04526B2392600179EBD /* ListCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E04326B2392600179EBD /* ListCustomCell.xib */; }; + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04626B25B5D00179EBD /* EventListModel.swift */; }; 9C82F906203FB8735A689DE4 /* Pods_LaserMethane.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */; }; /* End PBXBuildFile section */ @@ -86,6 +87,7 @@ 65F2E03F26B1724900179EBD /* EventViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventViewController.xib; sourceTree = ""; }; 65F2E04226B2392600179EBD /* ListCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCustomCell.swift; sourceTree = ""; }; 65F2E04326B2392600179EBD /* ListCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListCustomCell.xib; sourceTree = ""; }; + 65F2E04626B25B5D00179EBD /* EventListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListModel.swift; sourceTree = ""; }; 9D62480C27D0BD75CD9B2998 /* Pods-LaserMethane.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaserMethane.debug.xcconfig"; path = "Target Support Files/Pods-LaserMethane/Pods-LaserMethane.debug.xcconfig"; sourceTree = ""; }; C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -203,6 +205,7 @@ 65F2DFFF26B0129100179EBD /* LoginResultModel.swift */, 65F2E00026B0129100179EBD /* UserInfoModel.swift */, 65F2DFFD26B0128C00179EBD /* ActionResultModel.swift */, + 65F2E04626B25B5D00179EBD /* EventListModel.swift */, ); path = Model; sourceTree = ""; @@ -431,6 +434,7 @@ 65F2E02126B1242200179EBD /* DefaultTableViewCell.swift in Sources */, 65F2E00426B0129100179EBD /* UserInfoModel.swift in Sources */, 65F2E03226B164CC00179EBD /* LogViewController.swift in Sources */, + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */, 65F2DFCA26AFF2A900179EBD /* Constant.swift in Sources */, 65BF7C1C26AFDDCD000FEC82 /* AppDelegate.swift in Sources */, 65F2DFC526AFF1A300179EBD /* AppCoordinator.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index 0da8420..423982f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Model/EventListModel.swift b/LaserMethane/Model/EventListModel.swift new file mode 100644 index 0000000..bb8b4b0 --- /dev/null +++ b/LaserMethane/Model/EventListModel.swift @@ -0,0 +1,66 @@ +// +// EventListModel.swift +// LaserMethane +// +// Created by 203 on 2021/7/29. +// + +import Foundation +import SwiftyJSON + +struct EventListModel { + var code: Int + var data: EventDataModel + var message: String + var success: Bool + + init(respJson: JSON) { + code = respJson["code"].intValue + data = EventDataModel(respJson: respJson["data"]) + message = respJson["message"].stringValue + success = respJson["success"].boolValue + } +} + +struct EventDataModel { + var total: Int + var rows: [EventRowModel] + + init(respJson: JSON) { + total = respJson["total"].intValue + rows = [EventRowModel]() + let rowsArray = respJson["rows"].arrayValue + for rowsJson in rowsArray { + let value = EventRowModel(respJson: rowsJson) + rows.append(value) + } + } +} + +struct EventRowModel { + var createTime: String + var data: Int + var description: String + var id: String + var images: String + var inspectionId: String + var lat: Double + var lng: Double + var name: String + var type: String + var user: String + + init(respJson: JSON) { + createTime = respJson["createTime"].stringValue + data = respJson["data"].intValue + description = respJson["description"].stringValue + id = respJson["id"].stringValue + images = respJson["images"].stringValue + inspectionId = respJson["inspectionId"].stringValue + lat = respJson["lat"].doubleValue + lng = respJson["lng"].doubleValue + name = respJson["name"].stringValue + type = respJson["type"].stringValue + user = respJson["user"].stringValue + } +} diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 8322bfa..28c6f31 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 65F2E04126B1724900179EBD /* EventViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E03F26B1724900179EBD /* EventViewController.xib */; }; 65F2E04426B2392600179EBD /* ListCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04226B2392600179EBD /* ListCustomCell.swift */; }; 65F2E04526B2392600179EBD /* ListCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E04326B2392600179EBD /* ListCustomCell.xib */; }; + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04626B25B5D00179EBD /* EventListModel.swift */; }; 9C82F906203FB8735A689DE4 /* Pods_LaserMethane.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */; }; /* End PBXBuildFile section */ @@ -86,6 +87,7 @@ 65F2E03F26B1724900179EBD /* EventViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventViewController.xib; sourceTree = ""; }; 65F2E04226B2392600179EBD /* ListCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCustomCell.swift; sourceTree = ""; }; 65F2E04326B2392600179EBD /* ListCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListCustomCell.xib; sourceTree = ""; }; + 65F2E04626B25B5D00179EBD /* EventListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListModel.swift; sourceTree = ""; }; 9D62480C27D0BD75CD9B2998 /* Pods-LaserMethane.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaserMethane.debug.xcconfig"; path = "Target Support Files/Pods-LaserMethane/Pods-LaserMethane.debug.xcconfig"; sourceTree = ""; }; C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -203,6 +205,7 @@ 65F2DFFF26B0129100179EBD /* LoginResultModel.swift */, 65F2E00026B0129100179EBD /* UserInfoModel.swift */, 65F2DFFD26B0128C00179EBD /* ActionResultModel.swift */, + 65F2E04626B25B5D00179EBD /* EventListModel.swift */, ); path = Model; sourceTree = ""; @@ -431,6 +434,7 @@ 65F2E02126B1242200179EBD /* DefaultTableViewCell.swift in Sources */, 65F2E00426B0129100179EBD /* UserInfoModel.swift in Sources */, 65F2E03226B164CC00179EBD /* LogViewController.swift in Sources */, + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */, 65F2DFCA26AFF2A900179EBD /* Constant.swift in Sources */, 65BF7C1C26AFDDCD000FEC82 /* AppDelegate.swift in Sources */, 65F2DFC526AFF1A300179EBD /* AppCoordinator.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index 0da8420..423982f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Model/EventListModel.swift b/LaserMethane/Model/EventListModel.swift new file mode 100644 index 0000000..bb8b4b0 --- /dev/null +++ b/LaserMethane/Model/EventListModel.swift @@ -0,0 +1,66 @@ +// +// EventListModel.swift +// LaserMethane +// +// Created by 203 on 2021/7/29. +// + +import Foundation +import SwiftyJSON + +struct EventListModel { + var code: Int + var data: EventDataModel + var message: String + var success: Bool + + init(respJson: JSON) { + code = respJson["code"].intValue + data = EventDataModel(respJson: respJson["data"]) + message = respJson["message"].stringValue + success = respJson["success"].boolValue + } +} + +struct EventDataModel { + var total: Int + var rows: [EventRowModel] + + init(respJson: JSON) { + total = respJson["total"].intValue + rows = [EventRowModel]() + let rowsArray = respJson["rows"].arrayValue + for rowsJson in rowsArray { + let value = EventRowModel(respJson: rowsJson) + rows.append(value) + } + } +} + +struct EventRowModel { + var createTime: String + var data: Int + var description: String + var id: String + var images: String + var inspectionId: String + var lat: Double + var lng: Double + var name: String + var type: String + var user: String + + init(respJson: JSON) { + createTime = respJson["createTime"].stringValue + data = respJson["data"].intValue + description = respJson["description"].stringValue + id = respJson["id"].stringValue + images = respJson["images"].stringValue + inspectionId = respJson["inspectionId"].stringValue + lat = respJson["lat"].doubleValue + lng = respJson["lng"].doubleValue + name = respJson["name"].stringValue + type = respJson["type"].stringValue + user = respJson["user"].stringValue + } +} diff --git a/LaserMethane/Util/Constant.swift b/LaserMethane/Util/Constant.swift index 7115400..e099a69 100644 --- a/LaserMethane/Util/Constant.swift +++ b/LaserMethane/Util/Constant.swift @@ -21,4 +21,5 @@ case userInfo = "/user/info" case loginOut = "/user/logout" case inspectList = "/inspection/search" + case eventList = "/task/search" } diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 8322bfa..28c6f31 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 65F2E04126B1724900179EBD /* EventViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E03F26B1724900179EBD /* EventViewController.xib */; }; 65F2E04426B2392600179EBD /* ListCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04226B2392600179EBD /* ListCustomCell.swift */; }; 65F2E04526B2392600179EBD /* ListCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E04326B2392600179EBD /* ListCustomCell.xib */; }; + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04626B25B5D00179EBD /* EventListModel.swift */; }; 9C82F906203FB8735A689DE4 /* Pods_LaserMethane.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */; }; /* End PBXBuildFile section */ @@ -86,6 +87,7 @@ 65F2E03F26B1724900179EBD /* EventViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventViewController.xib; sourceTree = ""; }; 65F2E04226B2392600179EBD /* ListCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCustomCell.swift; sourceTree = ""; }; 65F2E04326B2392600179EBD /* ListCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListCustomCell.xib; sourceTree = ""; }; + 65F2E04626B25B5D00179EBD /* EventListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListModel.swift; sourceTree = ""; }; 9D62480C27D0BD75CD9B2998 /* Pods-LaserMethane.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaserMethane.debug.xcconfig"; path = "Target Support Files/Pods-LaserMethane/Pods-LaserMethane.debug.xcconfig"; sourceTree = ""; }; C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -203,6 +205,7 @@ 65F2DFFF26B0129100179EBD /* LoginResultModel.swift */, 65F2E00026B0129100179EBD /* UserInfoModel.swift */, 65F2DFFD26B0128C00179EBD /* ActionResultModel.swift */, + 65F2E04626B25B5D00179EBD /* EventListModel.swift */, ); path = Model; sourceTree = ""; @@ -431,6 +434,7 @@ 65F2E02126B1242200179EBD /* DefaultTableViewCell.swift in Sources */, 65F2E00426B0129100179EBD /* UserInfoModel.swift in Sources */, 65F2E03226B164CC00179EBD /* LogViewController.swift in Sources */, + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */, 65F2DFCA26AFF2A900179EBD /* Constant.swift in Sources */, 65BF7C1C26AFDDCD000FEC82 /* AppDelegate.swift in Sources */, 65F2DFC526AFF1A300179EBD /* AppCoordinator.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index 0da8420..423982f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Model/EventListModel.swift b/LaserMethane/Model/EventListModel.swift new file mode 100644 index 0000000..bb8b4b0 --- /dev/null +++ b/LaserMethane/Model/EventListModel.swift @@ -0,0 +1,66 @@ +// +// EventListModel.swift +// LaserMethane +// +// Created by 203 on 2021/7/29. +// + +import Foundation +import SwiftyJSON + +struct EventListModel { + var code: Int + var data: EventDataModel + var message: String + var success: Bool + + init(respJson: JSON) { + code = respJson["code"].intValue + data = EventDataModel(respJson: respJson["data"]) + message = respJson["message"].stringValue + success = respJson["success"].boolValue + } +} + +struct EventDataModel { + var total: Int + var rows: [EventRowModel] + + init(respJson: JSON) { + total = respJson["total"].intValue + rows = [EventRowModel]() + let rowsArray = respJson["rows"].arrayValue + for rowsJson in rowsArray { + let value = EventRowModel(respJson: rowsJson) + rows.append(value) + } + } +} + +struct EventRowModel { + var createTime: String + var data: Int + var description: String + var id: String + var images: String + var inspectionId: String + var lat: Double + var lng: Double + var name: String + var type: String + var user: String + + init(respJson: JSON) { + createTime = respJson["createTime"].stringValue + data = respJson["data"].intValue + description = respJson["description"].stringValue + id = respJson["id"].stringValue + images = respJson["images"].stringValue + inspectionId = respJson["inspectionId"].stringValue + lat = respJson["lat"].doubleValue + lng = respJson["lng"].doubleValue + name = respJson["name"].stringValue + type = respJson["type"].stringValue + user = respJson["user"].stringValue + } +} diff --git a/LaserMethane/Util/Constant.swift b/LaserMethane/Util/Constant.swift index 7115400..e099a69 100644 --- a/LaserMethane/Util/Constant.swift +++ b/LaserMethane/Util/Constant.swift @@ -21,4 +21,5 @@ case userInfo = "/user/info" case loginOut = "/user/logout" case inspectList = "/inspection/search" + case eventList = "/task/search" } diff --git a/LaserMethane/View/ListCustomCell.swift b/LaserMethane/View/ListCustomCell.swift index ac95b8a..a9581bd 100644 --- a/LaserMethane/View/ListCustomCell.swift +++ b/LaserMethane/View/ListCustomCell.swift @@ -8,16 +8,16 @@ import UIKit class ListCustomCell: UITableViewCell { - @IBOutlet var inspectNameLabel: UILabel! - @IBOutlet var inspectDateLabel: UILabel! - @IBOutlet var inspectUserLabel: UILabel! + @IBOutlet var nameLabel: UILabel! + @IBOutlet var dateLabel: UILabel! + @IBOutlet var userLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code - inspectNameLabel.lineBreakMode = .byWordWrapping - inspectNameLabel.lineBreakMode = .byTruncatingTail - inspectNameLabel.numberOfLines = 1 + nameLabel.lineBreakMode = .byWordWrapping + nameLabel.lineBreakMode = .byTruncatingTail + nameLabel.numberOfLines = 1 } override func setSelected(_ selected: Bool, animated: Bool) { diff --git a/LaserMethane.xcodeproj/project.pbxproj b/LaserMethane.xcodeproj/project.pbxproj index 8322bfa..28c6f31 100644 --- a/LaserMethane.xcodeproj/project.pbxproj +++ b/LaserMethane.xcodeproj/project.pbxproj @@ -43,6 +43,7 @@ 65F2E04126B1724900179EBD /* EventViewController.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E03F26B1724900179EBD /* EventViewController.xib */; }; 65F2E04426B2392600179EBD /* ListCustomCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04226B2392600179EBD /* ListCustomCell.swift */; }; 65F2E04526B2392600179EBD /* ListCustomCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = 65F2E04326B2392600179EBD /* ListCustomCell.xib */; }; + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 65F2E04626B25B5D00179EBD /* EventListModel.swift */; }; 9C82F906203FB8735A689DE4 /* Pods_LaserMethane.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */; }; /* End PBXBuildFile section */ @@ -86,6 +87,7 @@ 65F2E03F26B1724900179EBD /* EventViewController.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EventViewController.xib; sourceTree = ""; }; 65F2E04226B2392600179EBD /* ListCustomCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ListCustomCell.swift; sourceTree = ""; }; 65F2E04326B2392600179EBD /* ListCustomCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = ListCustomCell.xib; sourceTree = ""; }; + 65F2E04626B25B5D00179EBD /* EventListModel.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventListModel.swift; sourceTree = ""; }; 9D62480C27D0BD75CD9B2998 /* Pods-LaserMethane.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-LaserMethane.debug.xcconfig"; path = "Target Support Files/Pods-LaserMethane/Pods-LaserMethane.debug.xcconfig"; sourceTree = ""; }; C9815BBE258D836DD4067F80 /* Pods_LaserMethane.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = Pods_LaserMethane.framework; sourceTree = BUILT_PRODUCTS_DIR; }; /* End PBXFileReference section */ @@ -203,6 +205,7 @@ 65F2DFFF26B0129100179EBD /* LoginResultModel.swift */, 65F2E00026B0129100179EBD /* UserInfoModel.swift */, 65F2DFFD26B0128C00179EBD /* ActionResultModel.swift */, + 65F2E04626B25B5D00179EBD /* EventListModel.swift */, ); path = Model; sourceTree = ""; @@ -431,6 +434,7 @@ 65F2E02126B1242200179EBD /* DefaultTableViewCell.swift in Sources */, 65F2E00426B0129100179EBD /* UserInfoModel.swift in Sources */, 65F2E03226B164CC00179EBD /* LogViewController.swift in Sources */, + 65F2E04726B25B5D00179EBD /* EventListModel.swift in Sources */, 65F2DFCA26AFF2A900179EBD /* Constant.swift in Sources */, 65BF7C1C26AFDDCD000FEC82 /* AppDelegate.swift in Sources */, 65F2DFC526AFF1A300179EBD /* AppCoordinator.swift in Sources */, diff --git a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate index 0da8420..423982f 100644 --- a/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate +++ b/LaserMethane.xcworkspace/xcuserdata/a203.xcuserdatad/UserInterfaceState.xcuserstate Binary files differ diff --git a/LaserMethane/Model/EventListModel.swift b/LaserMethane/Model/EventListModel.swift new file mode 100644 index 0000000..bb8b4b0 --- /dev/null +++ b/LaserMethane/Model/EventListModel.swift @@ -0,0 +1,66 @@ +// +// EventListModel.swift +// LaserMethane +// +// Created by 203 on 2021/7/29. +// + +import Foundation +import SwiftyJSON + +struct EventListModel { + var code: Int + var data: EventDataModel + var message: String + var success: Bool + + init(respJson: JSON) { + code = respJson["code"].intValue + data = EventDataModel(respJson: respJson["data"]) + message = respJson["message"].stringValue + success = respJson["success"].boolValue + } +} + +struct EventDataModel { + var total: Int + var rows: [EventRowModel] + + init(respJson: JSON) { + total = respJson["total"].intValue + rows = [EventRowModel]() + let rowsArray = respJson["rows"].arrayValue + for rowsJson in rowsArray { + let value = EventRowModel(respJson: rowsJson) + rows.append(value) + } + } +} + +struct EventRowModel { + var createTime: String + var data: Int + var description: String + var id: String + var images: String + var inspectionId: String + var lat: Double + var lng: Double + var name: String + var type: String + var user: String + + init(respJson: JSON) { + createTime = respJson["createTime"].stringValue + data = respJson["data"].intValue + description = respJson["description"].stringValue + id = respJson["id"].stringValue + images = respJson["images"].stringValue + inspectionId = respJson["inspectionId"].stringValue + lat = respJson["lat"].doubleValue + lng = respJson["lng"].doubleValue + name = respJson["name"].stringValue + type = respJson["type"].stringValue + user = respJson["user"].stringValue + } +} diff --git a/LaserMethane/Util/Constant.swift b/LaserMethane/Util/Constant.swift index 7115400..e099a69 100644 --- a/LaserMethane/Util/Constant.swift +++ b/LaserMethane/Util/Constant.swift @@ -21,4 +21,5 @@ case userInfo = "/user/info" case loginOut = "/user/logout" case inspectList = "/inspection/search" + case eventList = "/task/search" } diff --git a/LaserMethane/View/ListCustomCell.swift b/LaserMethane/View/ListCustomCell.swift index ac95b8a..a9581bd 100644 --- a/LaserMethane/View/ListCustomCell.swift +++ b/LaserMethane/View/ListCustomCell.swift @@ -8,16 +8,16 @@ import UIKit class ListCustomCell: UITableViewCell { - @IBOutlet var inspectNameLabel: UILabel! - @IBOutlet var inspectDateLabel: UILabel! - @IBOutlet var inspectUserLabel: UILabel! + @IBOutlet var nameLabel: UILabel! + @IBOutlet var dateLabel: UILabel! + @IBOutlet var userLabel: UILabel! override func awakeFromNib() { super.awakeFromNib() // Initialization code - inspectNameLabel.lineBreakMode = .byWordWrapping - inspectNameLabel.lineBreakMode = .byTruncatingTail - inspectNameLabel.numberOfLines = 1 + nameLabel.lineBreakMode = .byWordWrapping + nameLabel.lineBreakMode = .byTruncatingTail + nameLabel.numberOfLines = 1 } override func setSelected(_ selected: Bool, animated: Bool) { diff --git a/LaserMethane/View/ListCustomCell.xib b/LaserMethane/View/ListCustomCell.xib index dba756d..4aaba46 100644 --- a/LaserMethane/View/ListCustomCell.xib +++ b/LaserMethane/View/ListCustomCell.xib @@ -17,7 +17,7 @@