更新website

This commit is contained in:
2026-09-17 23:42:41 +08:00
parent 67e819c629
commit 1a4471e34d
18 changed files with 1922 additions and 187 deletions
+8 -3
View File
@@ -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)