use dao pattern

This commit is contained in:
Jay
2019-09-16 14:06:23 +00:00
parent 4f8749a969
commit 9936519c70
9 changed files with 184 additions and 0 deletions
+13
View File
@@ -0,0 +1,13 @@
package discord
import "time"
// Channel -
type Channel struct {
ID string `db:"id"`
Server string `db:"server"`
EnableCMD bool `db:"enable_cmd"`
EnableNotify bool `db:"enable_notify"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
+39
View File
@@ -0,0 +1,39 @@
package discord
import "time"
// ChannelFacebookRT -
type ChannelFacebookRT struct {
Channel string `db:"channel"`
Facebook string `db:"facebook"`
Tmpl string `db:"tmpl"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
// ChannelInstagramRT -
type ChannelInstagramRT struct {
Channel string `db:"channel"`
Instagram string `db:"instagram"`
Tmpl string `db:"tmpl"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
// ChannelYoutubeRT -
type ChannelYoutubeRT struct {
Channel string `db:"channel"`
Youtube string `db:"youtube"`
Tmpl string `db:"tmpl"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
// ChannelTwitchRT -
type ChannelTwitchRT struct {
Channel string `db:"channel"`
Twitch string `db:"twitch"`
Tmpl string `db:"tmpl"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
+13
View File
@@ -0,0 +1,13 @@
package discord
import "time"
// Server -
type Server struct {
ID string `db:"id"`
Name string `db:"name"`
Permission int `db:"permission"`
Owner string `db:"owner"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
+15
View File
@@ -0,0 +1,15 @@
package public
import "time"
// Commands -
type Command struct {
Key string `db:"key"`
Platform string `db:"platform"`
Binding string `db:"binding"`
RequireManage bool `db:"require_manage"`
RequireInit bool `db:"require_init"`
Value string `db:"value"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
+11
View File
@@ -0,0 +1,11 @@
package public
import "time"
// FacebookPage -
type FacebookPage struct {
ID string `db:"id"`
LastPost string `db:"lastpost"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}
+11
View File
@@ -0,0 +1,11 @@
package public
import "time"
// Instagram -
type Instagram struct {
ID string `db:"id"`
LastPost string `db:"lastpost"`
Ctime time.Time `db:"ctime"`
Mtime time.Time `db:"mtime"`
}