go-common/app/interface/main/tv/http/history.go

26 lines
483 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package http
import (
"go-common/library/ecode"
bm "go-common/library/net/http/blademaster"
)
// get history
func history(c *bm.Context) {
v := new(struct {
AccessKey string `form:"access_key"`
})
if err := c.Bind(v); err != nil {
return
}
if v.AccessKey == "" {
c.JSON(nil, ecode.NoLogin)
return
}
if mid, ok := c.Get("mid"); !ok { // if not login, we don't call follow data
c.JSON(nil, ecode.NoLogin)
} else {
c.JSON(hisSvc.GetHistory(c, mid.(int64)))
}
}