add youtube background

This commit is contained in:
root committed 2018-09-17 14:30:49 +08:00
1 parent e8db6fdab5
commit cfc1e43192
4 files changed
+46

No files matched your search

+12
View File
@@ -19,6 +19,18 @@ type YoutubeChannel struct {
Groups []*YoutubeGroup `db:"-"`
}
// GetAllYoutubeChannels -
func GetAllYoutubeChannels() (yt []*YoutubeChannel, err error) {
err = x.Select(&yt, `select * from "public"."youtube_channel"`)
return
}
// GetYoutubeChannelsWithExpire -
func GetYoutubeChannelsWithExpire(e int64) (yt []*YoutubeChannel, err error) {
err = x.Select(&yt, `select * from "public"."youtube_channel" where "expire" = -1 or "expire" < $1`, e)
return
}
// GetYoutubeChannelWithID -
func GetYoutubeChannelWithID(id string) (yt *YoutubeChannel, err error) {
err = x.Get(&yt, `select * from "public"."youtube_channel" where "id" = $1`, id)