+88
@@ -0,0 +1,88 @@
|
||||
package aitemplatemodulectrl
|
||||
|
||||
import (
|
||||
"91porn-server/app/service/aitemplatemoduleser"
|
||||
"91porn-server/common"
|
||||
"91porn-server/common/stderr"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// List doc
|
||||
//
|
||||
// @Summary 获取AI模版模块列表列表接口
|
||||
// @Description 获取AI模版模块列表列表
|
||||
// @Tags 移动端-AI模版模块列表
|
||||
// @Accept mpfd,json
|
||||
// @Produce json
|
||||
// @Param q query aitemplatemoduleser.AppQueryListReq false "请求参数"
|
||||
// @Success 200 object aitemplatemoduleser.AppListRes "成功"
|
||||
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
||||
// @Router /api/app/ai_template_module/list [get]
|
||||
func List(ctx *gin.Context) {
|
||||
p := &aitemplatemoduleser.AppQueryListReq{}
|
||||
if err := ctx.ShouldBind(&p); err != nil {
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
|
||||
// 获取用户当前配置
|
||||
// var err error
|
||||
// p.Uid, err = common.GetUID(ctx)
|
||||
// if err != nil {
|
||||
// common.ServeJSON(ctx, stderr.ErrNoToken, err)
|
||||
// return
|
||||
// }
|
||||
|
||||
list := p.GetList()
|
||||
common.ServeJSON(ctx, stderr.Success, list)
|
||||
}
|
||||
|
||||
// AllList doc
|
||||
//
|
||||
// @Summary 获取AI模版模块列表列表接口
|
||||
// @Description 获取AI模版模块列表列表
|
||||
// @Tags 移动端-AI模版模块列表
|
||||
// @Accept mpfd,json
|
||||
// @Produce json
|
||||
// @Param q query aitemplatemoduleser.AppQueryAllListReq false "请求参数"
|
||||
// @Success 200 object aitemplatemoduleser.AppAllListRes "成功"
|
||||
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
||||
// @Router /api/app/ai_template_module/all [get]
|
||||
func AllList(ctx *gin.Context) {
|
||||
p := &aitemplatemoduleser.AppQueryAllListReq{}
|
||||
if err := ctx.ShouldBind(&p); err != nil {
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
|
||||
list := p.GetList()
|
||||
common.ServeJSON(ctx, stderr.Success, list)
|
||||
}
|
||||
|
||||
// Info doc
|
||||
//
|
||||
// @Summary 获取AI模版模块列表详情接口
|
||||
// @Description 获取AI模版模块列表详情
|
||||
// @Tags 移动端-AI模版模块列表
|
||||
// @Accept mpfd,json
|
||||
// @Produce json
|
||||
// @Param q query aitemplatemoduleser.AppQueryInfoReq false "请求参数"
|
||||
// @Success 200 object aitemplatemoduleser.AppQueryInfoRes "成功"
|
||||
// @Failure 400 {string} json "{"msg": "操作失败"}"
|
||||
// @Router /api/app/ai_template_module/info [get]
|
||||
func Info(ctx *gin.Context) {
|
||||
p := &aitemplatemoduleser.AppQueryInfoReq{}
|
||||
if err := ctx.ShouldBind(&p); err != nil {
|
||||
common.ServeJSON(ctx, stderr.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
|
||||
data, err := p.GetInfo()
|
||||
if err != nil {
|
||||
common.ServeJSON(ctx, stderr.Failure, err.Error())
|
||||
return
|
||||
}
|
||||
|
||||
common.ServeJSON(ctx, stderr.Success, data)
|
||||
}
|
||||
Reference in New Issue
Block a user