Skip to content

Instantly share code, notes, and snippets.

@hsharghi
Last active December 20, 2019 19:37
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hsharghi/4b04dd98f3075017e643ce5daa5e609e to your computer and use it in GitHub Desktop.
Save hsharghi/4b04dd98f3075017e643ce5daa5e609e to your computer and use it in GitHub Desktop.
virgool-blog-0005
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