init: web_hgdjc_server
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
package feedbackapi
|
||||
|
||||
import (
|
||||
"videoweb/app/api/proto"
|
||||
"videoweb/app/service/feedbackser"
|
||||
"videoweb/pub/common"
|
||||
"videoweb/pub/common/srvdef"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// AddFeedback 提交意见反馈
|
||||
// @Tags 意见反馈相关接口
|
||||
// @Summary 提交意见反馈 -- by 旺鸣
|
||||
// @Description 用户提交意见反馈,问题类型,1-功能建议、2-播放问题、3-账号问题、4-其他
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param param body proto.FeedbackReq true "意见反馈请求"
|
||||
// @Success 200 {object} proto.FeedbackResp "成功"
|
||||
// @Failure 400 {string} string "失败"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/app/feedback/add [post]
|
||||
func AddFeedback(ctx *gin.Context) {
|
||||
var req proto.FeedbackReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
userId := common.GetUserId(ctx)
|
||||
resp, err := feedbackser.AddFeedback(ctx, userId, &req)
|
||||
if err != nil {
|
||||
common.ServerJSON(ctx, err.Code, err.Tips)
|
||||
return
|
||||
}
|
||||
common.ServerJSON(ctx, srvdef.Success, resp)
|
||||
}
|
||||
Reference in New Issue
Block a user