Last active
December 20, 2019 19:37
-
-
Save hsharghi/4b04dd98f3075017e643ce5daa5e609e to your computer and use it in GitHub Desktop.
virgool-blog-0005
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vapor | |
import FluentMySQL // 1 | |
final class Post: MySQLModel { // 2 | |
var id: Int? | |
var title: String | |
var body: String // 3 | |
init(id: Int? = nil, title: String, body: String) { // 4 | |
self.id = id | |
self.title = title | |
self.body = body | |
} | |
} | |
extension Post: Migration { } // 5 | |
extension Post: Content { } // 6 | |
extension Post: Parameter { } // 7 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment