From 8bf1cad94113d5c604e95e370cf068efdea87d27 Mon Sep 17 00:00:00 2001
From: wangpengfei <274878379@qq.com>
Date: 星期三, 30 八月 2023 09:43:49 +0800
Subject: [PATCH] fix
---
api/v1/faq.go | 8 +++++++-
1 files changed, 7 insertions(+), 1 deletions(-)
diff --git a/api/v1/faq.go b/api/v1/faq.go
index 9995d36..350dae2 100644
--- a/api/v1/faq.go
+++ b/api/v1/faq.go
@@ -71,6 +71,10 @@
if !ok {
return
}
+ if params.Id == 0 {
+ ctx.Fail(ecode.ParamsErr)
+ }
+ params.Faq.Id = params.Id
errCode := service.NewFaqService().UpdateFaq(¶ms.Faq)
if errCode != ecode.OK {
@@ -85,10 +89,12 @@
// @Tags 甯歌闂绠$悊
// @Summary 鑾峰彇甯歌闂鍒楄〃
// @Produce application/json
+// @Param object body request.GetFaqList true "鍙傛暟"
// @Success 200 {object} response.ListResponse{data=[]model.Faq}
// @Router /api/faq/list [get]
func (s *FaqApi) List(c *gin.Context) {
- ctx, ok := contextx.NewContext(c, nil)
+ var params request.GetFaqList
+ ctx, ok := contextx.NewContext(c, params)
if !ok {
return
}
--
Gitblit v1.8.0