35 lines
1021 B
Go
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)
|
|
}
|