|
| 1 | +import Foundation |
| 2 | + |
| 3 | +public struct BlogPostListObject: Codable { |
| 4 | + public let id: UUID |
| 5 | + public let title: String |
| 6 | + public let slug: String |
| 7 | + public let image: String |
| 8 | + public let excerpt: String |
| 9 | + public let date: Date |
| 10 | + |
| 11 | + public init(id: UUID, title: String, slug: String, image: String, excerpt: String, date: Date) { |
| 12 | + self.id = id |
| 13 | + self.title = title |
| 14 | + self.slug = slug |
| 15 | + self.image = image |
| 16 | + self.excerpt = excerpt |
| 17 | + self.date = date |
| 18 | + } |
| 19 | +} |
| 20 | + |
| 21 | +public struct BlogPostGetObject: Codable { |
| 22 | + public var id: UUID |
| 23 | + public var title: String |
| 24 | + public var slug: String |
| 25 | + public var image: String |
| 26 | + public var excerpt: String |
| 27 | + public var date: Date |
| 28 | + public var content: String |
| 29 | + |
| 30 | + public init(id: UUID, title: String, slug: String, image: String, excerpt: String, date: Date, content: String) { |
| 31 | + self.id = id |
| 32 | + self.title = title |
| 33 | + self.slug = slug |
| 34 | + self.image = image |
| 35 | + self.excerpt = excerpt |
| 36 | + self.date = date |
| 37 | + self.content = content |
| 38 | + } |
| 39 | +} |
| 40 | + |
| 41 | +public struct BlogPostUpsertObject: Codable { |
| 42 | + public var title: String |
| 43 | + public var slug: String |
| 44 | + public var image: String |
| 45 | + public var excerpt: String |
| 46 | + public var date: Date |
| 47 | + public var content: String |
| 48 | + public var categoryId: String |
| 49 | + |
| 50 | + public init(title: String, slug: String, image: String, excerpt: String, date: Date, content: String, categoryId: String) { |
| 51 | + self.title = title |
| 52 | + self.slug = slug |
| 53 | + self.image = image |
| 54 | + self.excerpt = excerpt |
| 55 | + self.date = date |
| 56 | + self.content = content |
| 57 | + self.categoryId = categoryId |
| 58 | + } |
| 59 | +} |
| 60 | + |
| 61 | +public struct BlogPostPatchObject: Codable { |
| 62 | + public var title: String? |
| 63 | + public var slug: String? |
| 64 | + public var image: String? |
| 65 | + public var excerpt: String? |
| 66 | + public var date: Date? |
| 67 | + public var content: String? |
| 68 | + public var categoryId: String? |
| 69 | + |
| 70 | + public init(title: String? = nil, slug: String? = nil, image: String? = nil, excerpt: String? = nil, date: Date? = nil, content: String? = nil, categoryId: String? = nil) { |
| 71 | + self.title = title |
| 72 | + self.slug = slug |
| 73 | + self.image = image |
| 74 | + self.excerpt = excerpt |
| 75 | + self.date = date |
| 76 | + self.content = content |
| 77 | + self.categoryId = categoryId |
| 78 | + } |
| 79 | +} |
0 commit comments