package contactusapi import ( "videoweb/app/api/proto" "videoweb/app/service/contactusser" "videoweb/pub/common" "videoweb/pub/common/srvdef" "github.com/gin-gonic/gin" ) // AddContactUs 提交联系我们 // @Tags 联系我们相关接口 // @Summary 提交联系我们 -- by 旺鸣 // @Description 用户提交联系我们表单,问题类型:1-订单问题、2-账号问题、3-功能问题、4-体验问题、5-其他 // @Accept json // @Produce json // @Param param body proto.ContactUsAddReq true "联系我们请求" // @Success 200 {object} proto.ContactUsAddResp "成功" // @Failure 400 {string} string "失败" // @Security ApiKeyAuth // @Router /api/app/contactus/add [post] func AddContactUs(ctx *gin.Context) { var req proto.ContactUsAddReq if err := ctx.ShouldBindJSON(&req); err != nil { common.ServerJSON(ctx, srvdef.ErrParamError, nil) return } userId := common.GetUserId(ctx) resp, err := contactusser.AddContactUs(ctx, userId, &req) if err != nil { common.ServerJSON(ctx, err.Code, err.Tips) return } common.ServerJSON(ctx, srvdef.Success, resp) }