go-common/app/interface/openplatform/article/http/cards.go

24 lines
404 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"
"strings"
)
func card(c *bm.Context) {
c.JSON(artSrv.FindCard(c, c.Request.Form.Get("id")))
}
func cards(c *bm.Context) {
var (
params = c.Request.Form
)
ids := strings.Split(params.Get("ids"), ",")
if len(ids) > 100 {
c.JSON(nil, ecode.RequestErr)
return
}
c.JSON(artSrv.FindCards(c, ids))
}