@@ -0,0 +1,60 @@
|
||||
package web_contactus
|
||||
|
||||
import (
|
||||
"videoweb/pub/common"
|
||||
"videoweb/pub/common/srvdef"
|
||||
"videoweb/web/api/proto"
|
||||
"videoweb/web/service/srv_contactus"
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
// List web端联系我们列表
|
||||
// @Tags web联系我们相关接口
|
||||
// @Summary web端联系我们列表 -- by 旺鸣
|
||||
// @Description 分页查询联系我们列表
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param params query proto.ContactUsListReq true "web端联系我们列表请求"
|
||||
// @Success 200 {object} proto.ContactUsListPageResp{list=[]proto.ContactUsListResp} "成功"
|
||||
// @Failure 400 {string} string "失败"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/contactus/list [get]
|
||||
func List(ctx *gin.Context) {
|
||||
var req proto.ContactUsListReq
|
||||
if err := ctx.ShouldBindQuery(&req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
resp, err := srv_contactus.ListContactUs(ctx, &req)
|
||||
if err != nil {
|
||||
common.ServerJSON(ctx, err.Code, err.Tips)
|
||||
return
|
||||
}
|
||||
common.ServerJSON(ctx, srvdef.Success, resp)
|
||||
}
|
||||
|
||||
// Handle web端处理联系我们
|
||||
// @Tags web联系我们相关接口
|
||||
// @Summary web端处理联系我们 -- by 旺鸣
|
||||
// @Description 批量更新联系我们处理状态
|
||||
// @Accept json
|
||||
// @Produce json
|
||||
// @Param params body proto.ContactUsHandleReq true "web端联系我们处理请求"
|
||||
// @Success 200 {object} proto.ContactUsHandleResp "成功"
|
||||
// @Failure 400 {string} string "失败"
|
||||
// @Security ApiKeyAuth
|
||||
// @Router /api/web/contactus/handle [post]
|
||||
func Handle(ctx *gin.Context) {
|
||||
var req proto.ContactUsHandleReq
|
||||
if err := ctx.ShouldBindJSON(&req); err != nil {
|
||||
common.ServerJSON(ctx, srvdef.ErrParamError, nil)
|
||||
return
|
||||
}
|
||||
resp, err := srv_contactus.HandleContactUs(ctx, &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