add new dao impl

This commit is contained in:
Jay
2019-09-17 10:08:41 +00:00
parent 9936519c70
commit f438be5771
9 changed files with 331 additions and 4 deletions
+16
View File
@@ -0,0 +1,16 @@
package public
import (
pubmodel "dorisbot/database/models/public"
)
// CommandDAO -
type CommandDAO interface {
Create(c *pubmodel.Command) error
Delete(key, platform, binding string) error
GetByKey(key string) ([]pubmodel.Command, error)
GetByKeyPlatform(key, platform string) ([]pubmodel.Command, error)
GetByKeyPlatformBinding(key, platform, binding string) ([]pubmodel.Command, error)
GetByPlatformBinding(platform, binding string) ([]pubmodel.Command, error)
GetByKeyBinding(key, binding string) ([]pubmodel.Command, error)
}
+2 -2
View File
@@ -9,8 +9,8 @@ import (
type FacebookDAO interface {
Create(fb *pubmodel.FacebookPage) error
UpdatePost(fb *pubmodel.FacebookPage, postID string) error
GetByID(id string) (pubmodel.FacebookPage, error)
GetByID(id string) (pubmodel.FacebookPage, bool, error)
GetAll() ([]pubmodel.FacebookPage, error)
Delete(id string) error
GetChannels() ([]dsmodel.Channel, error)
GetChannels(id string) ([]dsmodel.Channel, error)
}
+16
View File
@@ -0,0 +1,16 @@
package public
import (
dsmodel "dorisbot/database/models/discord"
pubmodel "dorisbot/database/models/public"
)
// InstagramDAO -
type InstagramDAO interface {
Create(ig *pubmodel.Instagram) error
UpdatePost(ig *pubmodel.Instagram, postID string) error
GetByID(id string) (pubmodel.Instagram, bool, error)
GetAll() ([]pubmodel.Instagram, error)
Delete(id string) error
GetChannels(id string) ([]dsmodel.Channel, error)
}