Modified models to support a DB
This commit is contained in:
parent
3591e0c723
commit
ebaec3d296
33 changed files with 675 additions and 64 deletions
14
models/posts.go
Normal file
14
models/posts.go
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
|
||||
type Post struct {
|
||||
ID int64
|
||||
SiteID int64
|
||||
GUID string
|
||||
Title string
|
||||
Body string
|
||||
Slug string
|
||||
CreatedAt time.Time
|
||||
PublishedAt time.Time
|
||||
}
|
||||
9
models/pubmodel/sites.go
Normal file
9
models/pubmodel/sites.go
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
package pubmodel
|
||||
|
||||
import "lmika.dev/lmika/weiro/models"
|
||||
|
||||
type Site struct {
|
||||
models.Site
|
||||
BaseURL string
|
||||
Posts []*models.Post
|
||||
}
|
||||
|
|
@ -1,12 +1,29 @@
|
|||
package models
|
||||
|
||||
import "time"
|
||||
const (
|
||||
PublishTargetTypeNone int = iota
|
||||
PublishTargetTypeNetlify
|
||||
)
|
||||
|
||||
type Site struct {
|
||||
Meta SiteMeta
|
||||
Posts []*Post
|
||||
ID int64
|
||||
OwnerID int64
|
||||
Title string
|
||||
Tagline string
|
||||
//Meta SiteMeta
|
||||
//Posts []*Post
|
||||
}
|
||||
|
||||
type SitePublishTarget struct {
|
||||
ID int64
|
||||
SiteID int64
|
||||
PublishTargetType int
|
||||
BaseURL string
|
||||
TargetSiteID string
|
||||
TargetPublishKey string
|
||||
}
|
||||
|
||||
/*
|
||||
type SiteMeta struct {
|
||||
Title string `yaml:"title"`
|
||||
Tagline string `yaml:"tagline"`
|
||||
|
|
@ -25,3 +42,4 @@ type Post struct {
|
|||
Meta PostMeta
|
||||
Content string
|
||||
}
|
||||
*/
|
||||
|
|
|
|||
7
models/users.go
Normal file
7
models/users.go
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
package models
|
||||
|
||||
type User struct {
|
||||
ID int64
|
||||
Username string
|
||||
PasswordHashed []byte
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue