You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
694 B
37 lines
694 B
package http |
|
|
|
import ( |
|
"go-common/app/interface/main/tv/model" |
|
"go-common/library/ecode" |
|
bm "go-common/library/net/http/blademaster" |
|
) |
|
|
|
func zoneIdx(c *bm.Context) { |
|
var ( |
|
req = c.Request.Form |
|
typeStr string |
|
typeV int |
|
pageStr string |
|
pageV int |
|
) |
|
takeBuild(req) // take build number |
|
if typeStr = req.Get("season_type"); typeStr == "" { |
|
c.JSON(nil, ecode.RequestErr) |
|
return |
|
} |
|
typeV = atoi(typeStr) |
|
if pageStr = req.Get("page"); pageStr == "" { |
|
pageV = 1 |
|
} else { |
|
pageV = atoi(pageStr) |
|
} |
|
seasons, pager, err := tvSvc.LoadZoneIdx(pageV, typeV) |
|
if err != nil { |
|
c.JSON(nil, err) |
|
return |
|
} |
|
c.JSON(model.IdxData{ |
|
List: seasons, |
|
Pager: pager, |
|
}, nil) |
|
}
|
|
|