From f13f5da1c505d4efa3e13680a6d176b77a113856 Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Tue, 21 Jun 2022 13:50:56 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pb=20tag=E6=A0=87=E7=AD=BE?= =?UTF-8?q?=E5=A4=84=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/friend/api_applylist.go | 2 +- modules/friend/api_blacklist.go | 2 +- modules/friend/api_list.go | 2 +- modules/pack/pack_test.go | 7 +++---- pb/pack_db.pb.go | 2 +- pb/proto/pack/pack_db.proto | 2 +- 6 files changed, 8 insertions(+), 9 deletions(-) diff --git a/modules/friend/api_applylist.go b/modules/friend/api_applylist.go index bbeb4c5d7..215b261c1 100644 --- a/modules/friend/api_applylist.go +++ b/modules/friend/api_applylist.go @@ -8,7 +8,7 @@ import ( func (this *ApiComp) ApplyList_Check(session comm.IUserSession, req *pb.Friend_ApplyList_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) self := &pb.DB_FriendData{UserId: session.GetUserId()} - err := this.module.model_friend.GetObj(session.GetUserId(), self) + err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} return diff --git a/modules/friend/api_blacklist.go b/modules/friend/api_blacklist.go index 1715d7bbf..24a560f50 100644 --- a/modules/friend/api_blacklist.go +++ b/modules/friend/api_blacklist.go @@ -8,7 +8,7 @@ import ( func (this *ApiComp) Blacklist_Check(session comm.IUserSession, req *pb.Friend_BlackList_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) self := &pb.DB_FriendData{UserId: session.GetUserId()} - err := this.module.model_friend.GetObj(session.GetUserId(), self) + err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} return diff --git a/modules/friend/api_list.go b/modules/friend/api_list.go index 7bd6d5055..639c3f36e 100644 --- a/modules/friend/api_list.go +++ b/modules/friend/api_list.go @@ -8,7 +8,7 @@ import ( func (this *ApiComp) List_Check(session comm.IUserSession, req *pb.Friend_List_Req) (chk map[string]interface{}, code comm.ErrorCode) { chk = make(map[string]interface{}) self := &pb.DB_FriendData{UserId: session.GetUserId()} - err := this.module.model_friend.GetObj(session.GetUserId(), self) + err := this.module.model_friend.Get(session.GetUserId(), self) if self == nil || err != nil { code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} return diff --git a/modules/pack/pack_test.go b/modules/pack/pack_test.go index 8d8817c48..97db5a364 100644 --- a/modules/pack/pack_test.go +++ b/modules/pack/pack_test.go @@ -75,10 +75,9 @@ func TestMain(m *testing.M) { func Test_Log(t *testing.T) { // data, _ := ptypes.MarshalAny(&pb.Pack_Getlist_Req{}) // s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{Method: "pack.getlist", Message: data}, &pb.RPCMessageReply{}) - // itmes := make([]*pb.DB_UserItemData, 0) - // err := module.model_pack_comp.GetList("0_62a9afd994fe03b7aaee6773", &itmes) - // log.Debugf("item:%v err:%v", itmes, err) - // module.model_pack_comp.Get() + itmes := make([]*pb.DB_UserItemData, 0) + err := module.model_pack_comp.GetList("0_62a9afd994fe03b7aaee6773", &itmes) + log.Debugf("item:%v err:%v", itmes, err) } func Test_Pack_UpdateGridToUserPack(t *testing.T) { diff --git a/pb/pack_db.pb.go b/pb/pack_db.pb.go index 40abbf07f..f014b399f 100644 --- a/pb/pack_db.pb.go +++ b/pb/pack_db.pb.go @@ -27,7 +27,7 @@ type DB_UserItemData struct { unknownFields protoimpl.UnknownFields GridId string `protobuf:"bytes,1,opt,name=gridId,proto3" json:"gridId" bson:"_id"` // 背包格子Id - UId string `protobuf:"bytes,2,opt,name=uId,proto3" json:"uId" bson:"uId"` // 用户id + UId string `protobuf:"bytes,2,opt,name=uId,proto3" json:"uId" bson:"uid"` // 用户id IsEmpty bool `protobuf:"varint,3,opt,name=isEmpty,proto3" json:"isEmpty" bson:"isEmpty"` // 是否是空格子 ItemId int32 `protobuf:"varint,4,opt,name=itemId,proto3" json:"itemId" bson:"itemId"` // 存放物品的Id Amount uint32 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount" bson:"amount"` // 存放物品的数量 diff --git a/pb/proto/pack/pack_db.proto b/pb/proto/pack/pack_db.proto index 3c1816722..b68505424 100644 --- a/pb/proto/pack/pack_db.proto +++ b/pb/proto/pack/pack_db.proto @@ -5,7 +5,7 @@ option go_package = ".;pb"; //背包格子 message DB_UserItemData { string gridId = 1; //@go_tags(`bson:"_id"`) 背包格子Id - string uId = 2; //@go_tags(`bson:"uId"`) 用户id + string uId = 2; //@go_tags(`bson:"uid"`) 用户id bool isEmpty = 3; //@go_tags(`bson:"isEmpty"`) 是否是空格子 int32 itemId = 4; //@go_tags(`bson:"itemId"`) 存放物品的Id uint32 amount = 5; //@go_tags(`bson:"amount"`) 存放物品的数量