From aa09e77ab625b80a8ab8a8946a09a4f942b06f6a Mon Sep 17 00:00:00 2001 From: Gordon <1432970085@qq.com> Date: Mon, 20 Mar 2023 20:43:36 +0800 Subject: [PATCH] user update --- internal/api/msg.go | 2 +- pkg/apistruct/manage.go | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/internal/api/msg.go b/internal/api/msg.go index c4eaca706..2783bc13e 100644 --- a/internal/api/msg.go +++ b/internal/api/msg.go @@ -163,7 +163,7 @@ func RequiredIf(fl validator.FieldLevel) bool { default: return true } - return false + return true } func (m *Message) SendMessage(c *gin.Context) { params := apistruct.ManagementSendMsgReq{} diff --git a/pkg/apistruct/manage.go b/pkg/apistruct/manage.go index 79cb1823d..87c5854ea 100644 --- a/pkg/apistruct/manage.go +++ b/pkg/apistruct/manage.go @@ -48,8 +48,8 @@ type ManagementSendMsg struct { type ManagementSendMsgReq struct { SendID string `json:"sendID" binding:"required"` - RecvID string `json:"recvID" binding:"required_if=sessionType 1|required_if=sessionType 4"` - GroupID string `json:"groupID" binding:"required_if=sessionType 2|required_if=sessionType 3"` + RecvID string `json:"recvID" binding:"required_if"` + GroupID string `json:"groupID" binding:"required_if"` SenderNickname string `json:"senderNickname" ` SenderFaceURL string `json:"senderFaceURL" ` SenderPlatformID int32 `json:"senderPlatformID"`