更新website
This commit is contained in:
@@ -62,9 +62,9 @@ func websiteID(c *beego.Controller) (uint64, bool) {
|
||||
return id, true
|
||||
}
|
||||
|
||||
// websiteStatusParam 解析 status 查询参数,未传时返回 -1(表示不过滤)
|
||||
func websiteStatusParam(c *beego.Controller) int {
|
||||
raw := strings.TrimSpace(c.GetString("status"))
|
||||
// websiteIntParam 解析整型查询参数,未传或非法时返回 -1(表示不过滤)
|
||||
func websiteIntParam(c *beego.Controller, key string) int {
|
||||
raw := strings.TrimSpace(c.GetString(key))
|
||||
if raw == "" {
|
||||
return -1
|
||||
}
|
||||
@@ -75,6 +75,11 @@ func websiteStatusParam(c *beego.Controller) int {
|
||||
return v
|
||||
}
|
||||
|
||||
// websiteStatusParam 解析 status 查询参数,未传时返回 -1(表示不过滤)
|
||||
func websiteStatusParam(c *beego.Controller) int {
|
||||
return websiteIntParam(c, "status")
|
||||
}
|
||||
|
||||
// websiteBind 解析 JSON 请求体到 target,失败时已写出 400
|
||||
func websiteBind(c *beego.Controller, target interface{}) bool {
|
||||
body, err := io.ReadAll(c.Ctx.Request.Body)
|
||||
|
||||
Reference in New Issue
Block a user