Files
web_huakui_server/web/api/web_contactus/contactus.go
T
rootandClaude Opus 4.7 85c0071fd8 feat: 从黄果 NET hgdjnet-server 9bfbafe 导入 HKDJ 官网后端
来源:hgdjnet-server 9bfbafe10d417deea959bd53117bc88a10e60a83
项目身份 HKDJ / JHA-216,独立官网仓库,Jenkins 守卫键 hkdjnet
测试目录 /server/hkdj_net,App/Web API 30331/30332

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-10-16 11:20:04 +08:00

61 lines
1.8 KiB
Go

package web_contactus
import (
"hkdj-web-server/pub/common"
"hkdj-web-server/pub/common/srvdef"
"hkdj-web-server/web/api/proto"
"hkdj-web-server/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)
}