Files
huangguo_server/app/api/officialctrl/officialCtrl.go
T
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

35 lines
1021 B
Go

package officialctrl
import (
"91porn-server/app/service/officialser"
"91porn-server/common"
"91porn-server/common/stderr"
"91porn-server/models/v/officialmod"
"github.com/gin-gonic/gin"
)
// List doc
// @Summary 官方列表
// @Description APP-官方列表
// @Tags 官方列表
// @Accept mpfd,json
// @Produce json,html
// @Param type query integer true "类型,1:下载 2:社区"
// @Success 200 {string} json "{"msg": "操作成功", "data":[]}"
// @Failure 400 {string} json "{"msg": "操作失败"}"
// @Router /app/official/list [get]
func List(ctx *gin.Context) {
var in *officialmod.QueryCond
if err := ctx.ShouldBind(&in); err != nil {
common.ServeJSON(ctx, stderr.ErrParamError, err)
return
}
ua, _ := common.GetUA(ctx)
data, code := officialser.QueryAll(in, ua.Ver, ua.SysType)
if code != stderr.Success {
common.ServeJSON(ctx, code, nil)
return
}
common.ServeJSON(ctx, stderr.Success, data)
}