update , refactory model
This commit is contained in:
1 parent
b29a99f400
commit
e4d767373a
2 files changed
+42
No files matched your search
@@ -86,6 +86,21 @@ func GetInstagramByID(id string) (ig *InstagramModel, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
// GetAllInstagram -
|
||||
func GetAllInstagram() (list []Instagram, err error) {
|
||||
db := models.GetConn()
|
||||
query := `
|
||||
select id, lastpost, ctime, mtime
|
||||
from "public"."instagram"
|
||||
order by ctime
|
||||
`
|
||||
err = db.Select(&list, query)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return list, nil
|
||||
}
|
||||
|
||||
// GetInstagramByChannelAndID -
|
||||
func GetInstagramByChannelAndID(id, channel string) (ig *InstagramModel, err error) {
|
||||
if len(channel) == 0 || len(id) == 0 {
|
||||
|
||||
Reference in new issue
Block a user