Apparently for 2 weeks (yes 2 whole fucking weeks) I was using NamedExec wrong instead of MustExec so inserts haven't worked since then. Other than that, this is a more cleaned up MVC style setup than before.
This commit is contained in:
parent
1785a8e4f5
commit
bac4472c3a
5 changed files with 127 additions and 93 deletions
19
data/models.go
Normal file
19
data/models.go
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
package data
|
||||
|
||||
type Login struct {
|
||||
Username string `db:"username" validate:"required"`
|
||||
Password string `db:"password" validate:"required"`
|
||||
}
|
||||
|
||||
type Link struct {
|
||||
Id int `db:"id" json:"id"`
|
||||
StreamId int `db:"stream_id" json:"stream_id" form:"stream_id" validate:"required,numeric"`
|
||||
Url string `db:"url" json:"url" form:"url" validate:"required,url"`
|
||||
Description string `db:"description" json:"description" form:"description" validate:"required"`
|
||||
}
|
||||
|
||||
type Stream struct {
|
||||
Id int `db:"id" json:"id"`
|
||||
Title string `db:"title" json:"title"`
|
||||
Description string `db:"description" json:"description"`
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue