Generate Vapor project.

This commit is contained in:
Andrew Glaze
2025-05-14 18:38:30 -04:00
commit a94752a799
17 changed files with 463 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
import Fluent
import struct Foundation.UUID
/// Property wrappers interact poorly with `Sendable` checking, causing a warning for the `@ID` property
/// It is recommended you write your model with sendability checking on and then suppress the warning
/// afterwards with `@unchecked Sendable`.
final class Todo: Model, @unchecked Sendable {
static let schema = "todos"
@ID(key: .id)
var id: UUID?
@Field(key: "title")
var title: String
init() { }
init(id: UUID? = nil, title: String) {
self.id = id
self.title = title
}
func toDTO() -> TodoDTO {
.init(
id: self.id,
title: self.$title.value
)
}
}