From 9bc8638fc65b3ab62fdd24f94d7b22ddcac3ce6b Mon Sep 17 00:00:00 2001 From: AndrewZuo01 <59896149+AndrewZuo01@users.noreply.github.com> Date: Wed, 10 Jan 2024 12:07:15 +0800 Subject: [PATCH] add gin check for resgister user info (#360) * update component check * update component check * update component check * update component check * update component check * update component check * update component check * update component check * update mysql check * update register user info check * update register user info check --- pkg/proto/chat/chat.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/pkg/proto/chat/chat.go b/pkg/proto/chat/chat.go index fc6c49312..bd6519eaf 100644 --- a/pkg/proto/chat/chat.go +++ b/pkg/proto/chat/chat.go @@ -115,6 +115,9 @@ func (x *RegisterUserReq) Check() error { //if x.VerifyCode == "" { // return errs.ErrArgs.Wrap("VerifyCode is empty") //} + if x.User.Nickname == "" { + return errs.ErrArgs.Wrap("Nickname is nil") + } if x.Platform < constant2.IOSPlatformID || x.Platform > constant2.AdminPlatformID { return errs.ErrArgs.Wrap("platform is invalid") }