package nakedchatctrl import ( "91porn-server/app/service/nakedchatser" "91porn-server/common" "91porn-server/common/stderr" "github.com/gin-gonic/gin" ) // List doc // // @Summary 获取裸聊列表接口 // @Description 获取裸聊列表 // @Tags 移动端-裸聊 // @Accept mpfd,json // @Produce json // @Param q query nakedchatser.AppQueryListReq false "请求参数" // @Success 200 object nakedchatser.AppListRes "成功" // @Failure 400 {string} json "{"msg": "操作失败"}" // @Router /api/app/nakedchat/list [get] func List(ctx *gin.Context) { p := &nakedchatser.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) } // Info doc // // @Summary 获取裸聊详情接口 // @Description 获取裸聊详情 // @Tags 移动端-裸聊 // @Accept mpfd,json // @Produce json // @Param q query nakedchatser.AppQueryInfoReq false "请求参数" // @Success 200 object nakedchatser.AppQueryInfoRes "成功" // @Failure 400 {string} json "{"msg": "操作失败"}" // @Router /api/app/nakedchat/info [get] func Info(ctx *gin.Context) { p := &nakedchatser.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) }