From 70543fbcb0840da1b080a431773caafe2ecc3486 Mon Sep 17 00:00:00 2001 From: zzw <1464003642@qq.com> Date: Tue, 27 Oct 2026 10:34:12 +0800 Subject: [PATCH] feat: analysis user improve --- rpc/analysis/analysis.pb | Bin 20762 -> 20708 bytes rpc/analysis/analysis.proto | 4 +-- rpc/analysis/pb/analysis.pb.go | 32 ++++-------------- .../logic/analysisuser/userImproveLogic.go | 4 +-- services/analysis/validator/user.go | 4 +-- 5 files changed, 11 insertions(+), 33 deletions(-) diff --git a/rpc/analysis/analysis.pb b/rpc/analysis/analysis.pb index c66c38e0397f12b3cfc634a901f2a3b752c4f447..3d9d667e1d11c7557b8a7621bd7272071bae34d5 100644 GIT binary patch delta 27 jcmbQWi1Eon#tlxUj0-k9o2oK0u9=)^wsy0R`8i1dmct5$ delta 82 zcmaE|ka5-`#tlxUjMp|ho2oK0KAN0qw$@BYii;y9v$&)vGr2^9U4c=9GYHNXlHg)b WOi3w9EiRVe087ERo5jq}Ndf>_EE$;q diff --git a/rpc/analysis/analysis.proto b/rpc/analysis/analysis.proto index be2bbb7..05915dc 100644 --- a/rpc/analysis/analysis.proto +++ b/rpc/analysis/analysis.proto @@ -318,13 +318,11 @@ message InternalSetRegisteredData { message UserImproveReq { string avatar = 1; - string nickname = 2; + string name = 2; string birthday = 3; string mobile = 4; int32 gender = 5; string password = 6; - string district = 7; - string address = 8; } message FaceBindReq { diff --git a/rpc/analysis/pb/analysis.pb.go b/rpc/analysis/pb/analysis.pb.go index 3195050..3c6e37a 100644 --- a/rpc/analysis/pb/analysis.pb.go +++ b/rpc/analysis/pb/analysis.pb.go @@ -253,13 +253,11 @@ func (x *InternalSetRegisteredData) GetOk() bool { type UserImproveReq struct { state protoimpl.MessageState `protogen:"open.v1"` Avatar string `protobuf:"bytes,1,opt,name=avatar,proto3" json:"avatar,omitempty"` - Nickname string `protobuf:"bytes,2,opt,name=nickname,proto3" json:"nickname,omitempty"` + Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` Birthday string `protobuf:"bytes,3,opt,name=birthday,proto3" json:"birthday,omitempty"` Mobile string `protobuf:"bytes,4,opt,name=mobile,proto3" json:"mobile,omitempty"` Gender int32 `protobuf:"varint,5,opt,name=gender,proto3" json:"gender,omitempty"` Password string `protobuf:"bytes,6,opt,name=password,proto3" json:"password,omitempty"` - District string `protobuf:"bytes,7,opt,name=district,proto3" json:"district,omitempty"` - Address string `protobuf:"bytes,8,opt,name=address,proto3" json:"address,omitempty"` unknownFields protoimpl.UnknownFields sizeCache protoimpl.SizeCache } @@ -301,9 +299,9 @@ func (x *UserImproveReq) GetAvatar() string { return "" } -func (x *UserImproveReq) GetNickname() string { +func (x *UserImproveReq) GetName() string { if x != nil { - return x.Nickname + return x.Name } return "" } @@ -336,20 +334,6 @@ func (x *UserImproveReq) GetPassword() string { return "" } -func (x *UserImproveReq) GetDistrict() string { - if x != nil { - return x.District - } - return "" -} - -func (x *UserImproveReq) GetAddress() string { - if x != nil { - return x.Address - } - return "" -} - type FaceBindReq struct { state protoimpl.MessageState `protogen:"open.v1"` FacePath string `protobuf:"bytes,1,opt,name=face_path,json=facePath,proto3" json:"face_path,omitempty"` @@ -2201,16 +2185,14 @@ const file_analysis_analysis_proto_rawDesc = "" + "\x18InternalSetRegisteredReq\x12\x0e\n" + "\x02id\x18\x01 \x01(\x03R\x02id\"+\n" + "\x19InternalSetRegisteredData\x12\x0e\n" + - "\x02ok\x18\x01 \x01(\bR\x02ok\"\xe2\x01\n" + + "\x02ok\x18\x01 \x01(\bR\x02ok\"\xa4\x01\n" + "\x0eUserImproveReq\x12\x16\n" + - "\x06avatar\x18\x01 \x01(\tR\x06avatar\x12\x1a\n" + - "\bnickname\x18\x02 \x01(\tR\bnickname\x12\x1a\n" + + "\x06avatar\x18\x01 \x01(\tR\x06avatar\x12\x12\n" + + "\x04name\x18\x02 \x01(\tR\x04name\x12\x1a\n" + "\bbirthday\x18\x03 \x01(\tR\bbirthday\x12\x16\n" + "\x06mobile\x18\x04 \x01(\tR\x06mobile\x12\x16\n" + "\x06gender\x18\x05 \x01(\x05R\x06gender\x12\x1a\n" + - "\bpassword\x18\x06 \x01(\tR\bpassword\x12\x1a\n" + - "\bdistrict\x18\a \x01(\tR\bdistrict\x12\x18\n" + - "\aaddress\x18\b \x01(\tR\aaddress\"*\n" + + "\bpassword\x18\x06 \x01(\tR\bpassword\"*\n" + "\vFaceBindReq\x12\x1b\n" + "\tface_path\x18\x01 \x01(\tR\bfacePath\"&\n" + "\x10AgreementInfoReq\x12\x12\n" + diff --git a/services/analysis/internal/logic/analysisuser/userImproveLogic.go b/services/analysis/internal/logic/analysisuser/userImproveLogic.go index f8107e0..3439bb8 100644 --- a/services/analysis/internal/logic/analysisuser/userImproveLogic.go +++ b/services/analysis/internal/logic/analysisuser/userImproveLogic.go @@ -51,7 +51,7 @@ func (l *UserImproveLogic) UserImprove(in *analysis.UserImproveReq) (*analysis.R return common.FailResponse(utils.ErrorNotFund), nil } - if req.Nickname != utils.StringEmpty || req.Avatar != utils.StringEmpty || + if req.Name != utils.StringEmpty || req.Avatar != utils.StringEmpty || req.Birthday != utils.StringEmpty || req.Gender > utils.NumberZero || req.Mobile != utils.StringEmpty || req.Password != utils.StringEmpty { if st := l.updatePlatformUser(loginUser, bizId, req); st.Code != utils.Ok.Code { @@ -106,7 +106,7 @@ func (l *UserImproveLogic) updatePlatformUser(loginUser utils.UserInfo, bizId in return utils.ErrorParams } - name := req.Nickname + name := req.Name if name == utils.StringEmpty { name = info.Name } diff --git a/services/analysis/validator/user.go b/services/analysis/validator/user.go index 8edef84..1d59785 100644 --- a/services/analysis/validator/user.go +++ b/services/analysis/validator/user.go @@ -4,13 +4,11 @@ import "lone-services/pkg/validate" type UserImproveValidator struct { Avatar string - Nickname string + Name string Birthday string Mobile string Gender int32 `validate:"omitempty,oneof=0 1 2 3"` Password string - District string - Address string } func (p UserImproveValidator) GetMessage() validate.ValidatorMessages {