上传pb tag标签处理

This commit is contained in:
liwei1dao 2022-06-21 13:50:56 +08:00
parent 107ff99562
commit f13f5da1c5
6 changed files with 8 additions and 9 deletions

View File

@ -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) { 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{}) chk = make(map[string]interface{})
self := &pb.DB_FriendData{UserId: session.GetUserId()} 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 { if self == nil || err != nil {
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
return return

View File

@ -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) { 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{}) chk = make(map[string]interface{})
self := &pb.DB_FriendData{UserId: session.GetUserId()} 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 { if self == nil || err != nil {
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
return return

View File

@ -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) { 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{}) chk = make(map[string]interface{})
self := &pb.DB_FriendData{UserId: session.GetUserId()} 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 { if self == nil || err != nil {
code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData} code = comm.ErrorCode{Code: pb.ErrorCode_FriendSelfNoData}
return return

View File

@ -75,10 +75,9 @@ func TestMain(m *testing.M) {
func Test_Log(t *testing.T) { func Test_Log(t *testing.T) {
// data, _ := ptypes.MarshalAny(&pb.Pack_Getlist_Req{}) // data, _ := ptypes.MarshalAny(&pb.Pack_Getlist_Req{})
// s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{Method: "pack.getlist", Message: data}, &pb.RPCMessageReply{}) // s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{Method: "pack.getlist", Message: data}, &pb.RPCMessageReply{})
// itmes := make([]*pb.DB_UserItemData, 0) itmes := make([]*pb.DB_UserItemData, 0)
// err := module.model_pack_comp.GetList("0_62a9afd994fe03b7aaee6773", &itmes) err := module.model_pack_comp.GetList("0_62a9afd994fe03b7aaee6773", &itmes)
// log.Debugf("item:%v err:%v", itmes, err) log.Debugf("item:%v err:%v", itmes, err)
// module.model_pack_comp.Get()
} }
func Test_Pack_UpdateGridToUserPack(t *testing.T) { func Test_Pack_UpdateGridToUserPack(t *testing.T) {

View File

@ -27,7 +27,7 @@ type DB_UserItemData struct {
unknownFields protoimpl.UnknownFields unknownFields protoimpl.UnknownFields
GridId string `protobuf:"bytes,1,opt,name=gridId,proto3" json:"gridId" bson:"_id"` // 背包格子Id 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"` // 是否是空格子 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 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"` // 存放物品的数量 Amount uint32 `protobuf:"varint,5,opt,name=amount,proto3" json:"amount" bson:"amount"` // 存放物品的数量

View File

@ -5,7 +5,7 @@ option go_package = ".;pb";
// //
message DB_UserItemData { message DB_UserItemData {
string gridId = 1; //@go_tags(`bson:"_id"`) Id 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"`) bool isEmpty = 3; //@go_tags(`bson:"isEmpty"`)
int32 itemId = 4; //@go_tags(`bson:"itemId"`) Id int32 itemId = 4; //@go_tags(`bson:"itemId"`) Id
uint32 amount = 5; //@go_tags(`bson:"amount"`) uint32 amount = 5; //@go_tags(`bson:"amount"`)