/* Options: Date: 2025-12-06 13:07:17 SwiftVersion: 5.0 Version: 6.110 Tip: To override a DTO option, remove "//" prefix before updating BaseUrl: https://etc-api.vsmlab.vn //BaseClass: //AddModelExtensions: True //AddServiceStackTypes: True IncludeTypes: AuditLogRequest.* //ExcludeTypes: //ExcludeGenericBaseTypes: False //AddResponseStatus: False //AddImplicitVersion: //AddDescriptionAsComments: True //InitializeCollections: True //TreatTypesAsStrings: //DefaultImports: Foundation,ServiceStack */ import Foundation import ServiceStack // @Route("/audits", "GET") public class AuditLogRequest : PagingRequest, IReturn { public typealias Return = PageResponse public var userName:String public var userId:Int public var documentId:Int public var action:String public var Description:String public var ipAddress:String public var startDate:Date public var endDate:Date required public init(){ super.init() } private enum CodingKeys : String, CodingKey { case userName case userId case documentId case action case Description case ipAddress case startDate case endDate } required public init(from decoder: Decoder) throws { try super.init(from: decoder) let container = try decoder.container(keyedBy: CodingKeys.self) userName = try container.decodeIfPresent(String.self, forKey: .userName) userId = try container.decodeIfPresent(Int.self, forKey: .userId) documentId = try container.decodeIfPresent(Int.self, forKey: .documentId) action = try container.decodeIfPresent(String.self, forKey: .action) Description = try container.decodeIfPresent(String.self, forKey: .Description) ipAddress = try container.decodeIfPresent(String.self, forKey: .ipAddress) startDate = try container.decodeIfPresent(Date.self, forKey: .startDate) endDate = try container.decodeIfPresent(Date.self, forKey: .endDate) } public override func encode(to encoder: Encoder) throws { try super.encode(to: encoder) var container = encoder.container(keyedBy: CodingKeys.self) if userName != nil { try container.encode(userName, forKey: .userName) } if userId != nil { try container.encode(userId, forKey: .userId) } if documentId != nil { try container.encode(documentId, forKey: .documentId) } if action != nil { try container.encode(action, forKey: .action) } if Description != nil { try container.encode(Description, forKey: .Description) } if ipAddress != nil { try container.encode(ipAddress, forKey: .ipAddress) } if startDate != nil { try container.encode(startDate, forKey: .startDate) } if endDate != nil { try container.encode(endDate, forKey: .endDate) } } } public class PageResponse : IResponseRequest, Codable { public var code:Int public var message:String public var data:[AuditLog] = [] public var pagination:Pagination required public init(){} } public class PagingRequest : Codable { public var page:Int public var limit:Int required public init(){} }