go-common/app/interface/main/up-rating/http/rating.go

25 lines
446 B
Go
Raw Normal View History

2019-04-22 10:49:16 +00:00
package http
import (
"go-common/library/ecode"
"go-common/library/log"
bm "go-common/library/net/http/blademaster"
)
func upRating(c *bm.Context) {
midI, ok := c.Get("mid")
if !ok {
log.Error("error get mid")
c.JSON(nil, ecode.NoLogin)
return
}
mid, _ := midI.(int64)
rating, err := svc.UpRating(c, mid)
if err != nil {
log.Error("svc.UpRating mid(%v) err(%v)", mid, err)
c.JSON(nil, err)
return
}
c.JSON(rating, err)
}