Files
2026-10-26 16:28:14 +08:00

35 lines
903 B
Go

package questionnaireapi
import (
"videoweb/app/api/proto"
"videoweb/app/service/questionnaireser"
"videoweb/pub/common"
"videoweb/pub/common/srvdef"
"github.com/gin-gonic/gin"
)
// Submit 提交问卷
// @Tags 问卷调查APP
// @Summary 提交问卷
// @Description 用户提交问题反馈问卷
// @Accept json
// @Produce json
// @Param param body proto.QuestionnaireSubmitReq true "提交参数"
// @Success 200 {string} string "成功"
// @Failure 400 {string} string "失败"
// @Router /api/app/questionnaire/submit [post]
func Submit(ctx *gin.Context) {
var req proto.QuestionnaireSubmitReq
if err := ctx.ShouldBindJSON(&req); err != nil {
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
return
}
serr := questionnaireser.Submit(ctx, ctx.ClientIP(), &req)
if serr != nil {
common.ServerJSON(ctx, serr, serr.Tips)
return
}
common.ServerJSON(ctx, srvdef.Success, nil)
}