上传协议规范格式

This commit is contained in:
liwei1dao 2022-06-16 16:05:39 +08:00
parent 2a4c3d97ea
commit 58555cd808
7 changed files with 111 additions and 108 deletions

View File

@ -15,7 +15,7 @@ func (r *Robot) handlePackMsg(msg *pb.UserMessage) {
//添加好友
func (r *Robot) QueryUserPack() {
req := &pb.GetlistReq{IType: 1}
req := &pb.Pack_Getlist_Req{IType: 1}
head := &pb.UserMessage{MainType: "pack", SubType: "queryuserpackreq"}
defer traceFunc(head.MainType, head.SubType, r.user.GetUid(), req)
err := r.SendToClient(head, req)
@ -25,7 +25,7 @@ func (r *Robot) QueryUserPack() {
}
func (r *Robot) handleQueryUserPack(msg *pb.UserMessage) {
rsp := &pb.GetlistResp{}
rsp := &pb.Pack_Getlist_Resp{}
if !comm.ProtoDecode(msg, rsp) {
return
}

View File

@ -8,13 +8,13 @@ import (
)
//参数校验
func (this *Api_Comp) Getlist_Check(session comm.IUserSession, req *pb.GetlistReq) (result map[string]interface{}, code comm.ErrorCode) {
func (this *Api_Comp) Getlist_Check(session comm.IUserSession, req *pb.Pack_Getlist_Req) (result map[string]interface{}, code comm.ErrorCode) {
result = map[string]interface{}{"ce": 123}
return
}
///获取用户道具
func (this *Api_Comp) Getlist(session comm.IUserSession, agrs map[string]interface{}, req *pb.GetlistReq) (code pb.ErrorCode) {
func (this *Api_Comp) Getlist(session comm.IUserSession, agrs map[string]interface{}, req *pb.Pack_Getlist_Req) (code pb.ErrorCode) {
var (
err error
items []*pb.DB_UserItemData
@ -25,7 +25,7 @@ func (this *Api_Comp) Getlist(session comm.IUserSession, agrs map[string]interfa
dels []string
)
defer func() {
session.SendMsg(string(this.module.GetType()), GetlistResp, &pb.GetlistResp{Grids: grids})
session.SendMsg(string(this.module.GetType()), GetlistResp, &pb.Pack_Getlist_Resp{Grids: grids})
if code == pb.ErrorCode_Success {
go func() { //异步处理修改数据
this.module.cache_comp.Pack_UpdateUserPack(session.GetUserId(), modifys...)

View File

@ -6,15 +6,15 @@ import (
)
//参数校验
func (this *Api_Comp) SellItem_Check(session comm.IUserSession, req *pb.SellItemReq) (result map[string]interface{}, code comm.ErrorCode) {
func (this *Api_Comp) SellItem_Check(session comm.IUserSession, req *pb.Pack_SellItem_Req) (result map[string]interface{}, code comm.ErrorCode) {
return
}
//出售道具
func (this *Api_Comp) SellItem(session comm.IUserSession, agrs map[string]interface{}, req *pb.SellItemReq) (code pb.ErrorCode) {
func (this *Api_Comp) SellItem(session comm.IUserSession, agrs map[string]interface{}, req *pb.Pack_SellItem_Req) (code pb.ErrorCode) {
defer func() {
session.SendMsg(string(this.module.GetType()), SellItemResp, &pb.SellItemResp{})
session.SendMsg(string(this.module.GetType()), SellItemResp, &pb.Pack_SellItem_Resp{})
}()
return
}

View File

@ -6,15 +6,15 @@ import (
)
//参数校验
func (this *Api_Comp) Useitem_Check(session comm.IUserSession, req *pb.UseItemReq) (result map[string]interface{}, code comm.ErrorCode) {
func (this *Api_Comp) Useitem_Check(session comm.IUserSession, req *pb.Pack_UseItem_Req) (result map[string]interface{}, code comm.ErrorCode) {
return
}
//使用道具
func (this *Api_Comp) Useitem(session comm.IUserSession, agrs map[string]interface{}, req *pb.UseItemReq) (code pb.ErrorCode) {
func (this *Api_Comp) Useitem(session comm.IUserSession, agrs map[string]interface{}, req *pb.Pack_UseItem_Resp) (code pb.ErrorCode) {
defer func() {
session.SendMsg(string(this.module.GetType()), UseItemResp, &pb.UseItemResp{})
session.SendMsg(string(this.module.GetType()), UseItemResp, &pb.Pack_UseItem_Resp{})
}()
return

View File

@ -74,7 +74,7 @@ func TestMain(m *testing.M) {
}
func Test_Log(t *testing.T) {
data, _ := ptypes.MarshalAny(&pb.GetlistReq{})
data, _ := ptypes.MarshalAny(&pb.Pack_Getlist_Req{})
s_gateComp.ReceiveMsg(context.Background(), &pb.AgentMessage{Method: "pack.getlist", Message: data}, &pb.RPCMessageReply{})
// items, err := module.db_comp.Pack_QueryUserPack("liwei1dao")
// log.Debugf("item:%v err:%v", items, err)

View File

@ -21,7 +21,7 @@ const (
)
//查询用户背包请求
type GetlistReq struct {
type Pack_Getlist_Req struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -29,8 +29,8 @@ type GetlistReq struct {
IType int32 `protobuf:"varint,1,opt,name=IType,proto3" json:"IType"` //道具类型
}
func (x *GetlistReq) Reset() {
*x = GetlistReq{}
func (x *Pack_Getlist_Req) Reset() {
*x = Pack_Getlist_Req{}
if protoimpl.UnsafeEnabled {
mi := &file_pack_pack_msg_proto_msgTypes[0]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -38,13 +38,13 @@ func (x *GetlistReq) Reset() {
}
}
func (x *GetlistReq) String() string {
func (x *Pack_Getlist_Req) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetlistReq) ProtoMessage() {}
func (*Pack_Getlist_Req) ProtoMessage() {}
func (x *GetlistReq) ProtoReflect() protoreflect.Message {
func (x *Pack_Getlist_Req) ProtoReflect() protoreflect.Message {
mi := &file_pack_pack_msg_proto_msgTypes[0]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -56,12 +56,12 @@ func (x *GetlistReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use GetlistReq.ProtoReflect.Descriptor instead.
func (*GetlistReq) Descriptor() ([]byte, []int) {
// Deprecated: Use Pack_Getlist_Req.ProtoReflect.Descriptor instead.
func (*Pack_Getlist_Req) Descriptor() ([]byte, []int) {
return file_pack_pack_msg_proto_rawDescGZIP(), []int{0}
}
func (x *GetlistReq) GetIType() int32 {
func (x *Pack_Getlist_Req) GetIType() int32 {
if x != nil {
return x.IType
}
@ -69,7 +69,7 @@ func (x *GetlistReq) GetIType() int32 {
}
//查询用户背包请求 回应
type GetlistResp struct {
type Pack_Getlist_Resp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -77,8 +77,8 @@ type GetlistResp struct {
Grids []*DB_UserItemData `protobuf:"bytes,1,rep,name=Grids,proto3" json:"Grids"` //用户背包列表
}
func (x *GetlistResp) Reset() {
*x = GetlistResp{}
func (x *Pack_Getlist_Resp) Reset() {
*x = Pack_Getlist_Resp{}
if protoimpl.UnsafeEnabled {
mi := &file_pack_pack_msg_proto_msgTypes[1]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -86,13 +86,13 @@ func (x *GetlistResp) Reset() {
}
}
func (x *GetlistResp) String() string {
func (x *Pack_Getlist_Resp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetlistResp) ProtoMessage() {}
func (*Pack_Getlist_Resp) ProtoMessage() {}
func (x *GetlistResp) ProtoReflect() protoreflect.Message {
func (x *Pack_Getlist_Resp) ProtoReflect() protoreflect.Message {
mi := &file_pack_pack_msg_proto_msgTypes[1]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -104,12 +104,12 @@ func (x *GetlistResp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use GetlistResp.ProtoReflect.Descriptor instead.
func (*GetlistResp) Descriptor() ([]byte, []int) {
// Deprecated: Use Pack_Getlist_Resp.ProtoReflect.Descriptor instead.
func (*Pack_Getlist_Resp) Descriptor() ([]byte, []int) {
return file_pack_pack_msg_proto_rawDescGZIP(), []int{1}
}
func (x *GetlistResp) GetGrids() []*DB_UserItemData {
func (x *Pack_Getlist_Resp) GetGrids() []*DB_UserItemData {
if x != nil {
return x.Grids
}
@ -117,7 +117,7 @@ func (x *GetlistResp) GetGrids() []*DB_UserItemData {
}
//使用物品请求
type UseItemReq struct {
type Pack_UseItem_Req struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -127,8 +127,8 @@ type UseItemReq struct {
Amount uint32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount"` //使用数量
}
func (x *UseItemReq) Reset() {
*x = UseItemReq{}
func (x *Pack_UseItem_Req) Reset() {
*x = Pack_UseItem_Req{}
if protoimpl.UnsafeEnabled {
mi := &file_pack_pack_msg_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -136,13 +136,13 @@ func (x *UseItemReq) Reset() {
}
}
func (x *UseItemReq) String() string {
func (x *Pack_UseItem_Req) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UseItemReq) ProtoMessage() {}
func (*Pack_UseItem_Req) ProtoMessage() {}
func (x *UseItemReq) ProtoReflect() protoreflect.Message {
func (x *Pack_UseItem_Req) ProtoReflect() protoreflect.Message {
mi := &file_pack_pack_msg_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -154,26 +154,26 @@ func (x *UseItemReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use UseItemReq.ProtoReflect.Descriptor instead.
func (*UseItemReq) Descriptor() ([]byte, []int) {
// Deprecated: Use Pack_UseItem_Req.ProtoReflect.Descriptor instead.
func (*Pack_UseItem_Req) Descriptor() ([]byte, []int) {
return file_pack_pack_msg_proto_rawDescGZIP(), []int{2}
}
func (x *UseItemReq) GetGridId() int32 {
func (x *Pack_UseItem_Req) GetGridId() int32 {
if x != nil {
return x.GridId
}
return 0
}
func (x *UseItemReq) GetItemId() int32 {
func (x *Pack_UseItem_Req) GetItemId() int32 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *UseItemReq) GetAmount() uint32 {
func (x *Pack_UseItem_Req) GetAmount() uint32 {
if x != nil {
return x.Amount
}
@ -181,14 +181,14 @@ func (x *UseItemReq) GetAmount() uint32 {
}
//使用物品请求 回应
type UseItemResp struct {
type Pack_UseItem_Resp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *UseItemResp) Reset() {
*x = UseItemResp{}
func (x *Pack_UseItem_Resp) Reset() {
*x = Pack_UseItem_Resp{}
if protoimpl.UnsafeEnabled {
mi := &file_pack_pack_msg_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -196,13 +196,13 @@ func (x *UseItemResp) Reset() {
}
}
func (x *UseItemResp) String() string {
func (x *Pack_UseItem_Resp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UseItemResp) ProtoMessage() {}
func (*Pack_UseItem_Resp) ProtoMessage() {}
func (x *UseItemResp) ProtoReflect() protoreflect.Message {
func (x *Pack_UseItem_Resp) ProtoReflect() protoreflect.Message {
mi := &file_pack_pack_msg_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -214,13 +214,13 @@ func (x *UseItemResp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use UseItemResp.ProtoReflect.Descriptor instead.
func (*UseItemResp) Descriptor() ([]byte, []int) {
// Deprecated: Use Pack_UseItem_Resp.ProtoReflect.Descriptor instead.
func (*Pack_UseItem_Resp) Descriptor() ([]byte, []int) {
return file_pack_pack_msg_proto_rawDescGZIP(), []int{3}
}
//出售道具请求sailitem
type SellItemReq struct {
type Pack_SellItem_Req struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -230,8 +230,8 @@ type SellItemReq struct {
Amount uint32 `protobuf:"varint,3,opt,name=Amount,proto3" json:"Amount"` //使用数量
}
func (x *SellItemReq) Reset() {
*x = SellItemReq{}
func (x *Pack_SellItem_Req) Reset() {
*x = Pack_SellItem_Req{}
if protoimpl.UnsafeEnabled {
mi := &file_pack_pack_msg_proto_msgTypes[4]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -239,13 +239,13 @@ func (x *SellItemReq) Reset() {
}
}
func (x *SellItemReq) String() string {
func (x *Pack_SellItem_Req) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SellItemReq) ProtoMessage() {}
func (*Pack_SellItem_Req) ProtoMessage() {}
func (x *SellItemReq) ProtoReflect() protoreflect.Message {
func (x *Pack_SellItem_Req) ProtoReflect() protoreflect.Message {
mi := &file_pack_pack_msg_proto_msgTypes[4]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -257,26 +257,26 @@ func (x *SellItemReq) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use SellItemReq.ProtoReflect.Descriptor instead.
func (*SellItemReq) Descriptor() ([]byte, []int) {
// Deprecated: Use Pack_SellItem_Req.ProtoReflect.Descriptor instead.
func (*Pack_SellItem_Req) Descriptor() ([]byte, []int) {
return file_pack_pack_msg_proto_rawDescGZIP(), []int{4}
}
func (x *SellItemReq) GetGridId() int32 {
func (x *Pack_SellItem_Req) GetGridId() int32 {
if x != nil {
return x.GridId
}
return 0
}
func (x *SellItemReq) GetItemId() int32 {
func (x *Pack_SellItem_Req) GetItemId() int32 {
if x != nil {
return x.ItemId
}
return 0
}
func (x *SellItemReq) GetAmount() uint32 {
func (x *Pack_SellItem_Req) GetAmount() uint32 {
if x != nil {
return x.Amount
}
@ -284,14 +284,14 @@ func (x *SellItemReq) GetAmount() uint32 {
}
//出售道具请求 回应
type SellItemResp struct {
type Pack_SellItem_Resp struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
}
func (x *SellItemResp) Reset() {
*x = SellItemResp{}
func (x *Pack_SellItem_Resp) Reset() {
*x = Pack_SellItem_Resp{}
if protoimpl.UnsafeEnabled {
mi := &file_pack_pack_msg_proto_msgTypes[5]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -299,13 +299,13 @@ func (x *SellItemResp) Reset() {
}
}
func (x *SellItemResp) String() string {
func (x *Pack_SellItem_Resp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SellItemResp) ProtoMessage() {}
func (*Pack_SellItem_Resp) ProtoMessage() {}
func (x *SellItemResp) ProtoReflect() protoreflect.Message {
func (x *Pack_SellItem_Resp) ProtoReflect() protoreflect.Message {
mi := &file_pack_pack_msg_proto_msgTypes[5]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -317,8 +317,8 @@ func (x *SellItemResp) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use SellItemResp.ProtoReflect.Descriptor instead.
func (*SellItemResp) Descriptor() ([]byte, []int) {
// Deprecated: Use Pack_SellItem_Resp.ProtoReflect.Descriptor instead.
func (*Pack_SellItem_Resp) Descriptor() ([]byte, []int) {
return file_pack_pack_msg_proto_rawDescGZIP(), []int{5}
}
@ -327,26 +327,29 @@ var File_pack_pack_msg_proto protoreflect.FileDescriptor
var file_pack_pack_msg_proto_rawDesc = []byte{
0x0a, 0x13, 0x70, 0x61, 0x63, 0x6b, 0x2f, 0x70, 0x61, 0x63, 0x6b, 0x5f, 0x6d, 0x73, 0x67, 0x2e,
0x70, 0x72, 0x6f, 0x74, 0x6f, 0x1a, 0x12, 0x70, 0x61, 0x63, 0x6b, 0x2f, 0x70, 0x61, 0x63, 0x6b,
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x22, 0x0a, 0x0a, 0x47, 0x65, 0x74,
0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a, 0x05, 0x49, 0x54, 0x79, 0x70, 0x65,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x49, 0x54, 0x79, 0x70, 0x65, 0x22, 0x35, 0x0a,
0x0b, 0x47, 0x65, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x05,
0x47, 0x72, 0x69, 0x64, 0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42,
0x5f, 0x55, 0x73, 0x65, 0x72, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x47,
0x72, 0x69, 0x64, 0x73, 0x22, 0x54, 0x0a, 0x0a, 0x55, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x52,
0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18, 0x01, 0x20, 0x01,
0x28, 0x05, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74, 0x65, 0x6d,
0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03, 0x20, 0x01,
0x28, 0x0d, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x0d, 0x0a, 0x0b, 0x55, 0x73,
0x65, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70, 0x22, 0x55, 0x0a, 0x0b, 0x53, 0x65, 0x6c,
0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64,
0x49, 0x64, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64,
0x12, 0x16, 0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05,
0x52, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75,
0x6e, 0x74, 0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x22, 0x0e, 0x0a, 0x0c, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x52, 0x65, 0x73, 0x70,
0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x33,
0x5f, 0x64, 0x62, 0x2e, 0x70, 0x72, 0x6f, 0x74, 0x6f, 0x22, 0x28, 0x0a, 0x10, 0x50, 0x61, 0x63,
0x6b, 0x5f, 0x47, 0x65, 0x74, 0x6c, 0x69, 0x73, 0x74, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x14, 0x0a,
0x05, 0x49, 0x54, 0x79, 0x70, 0x65, 0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x05, 0x49, 0x54,
0x79, 0x70, 0x65, 0x22, 0x3b, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x5f, 0x47, 0x65, 0x74, 0x6c,
0x69, 0x73, 0x74, 0x5f, 0x52, 0x65, 0x73, 0x70, 0x12, 0x26, 0x0a, 0x05, 0x47, 0x72, 0x69, 0x64,
0x73, 0x18, 0x01, 0x20, 0x03, 0x28, 0x0b, 0x32, 0x10, 0x2e, 0x44, 0x42, 0x5f, 0x55, 0x73, 0x65,
0x72, 0x49, 0x74, 0x65, 0x6d, 0x44, 0x61, 0x74, 0x61, 0x52, 0x05, 0x47, 0x72, 0x69, 0x64, 0x73,
0x22, 0x5a, 0x0a, 0x10, 0x50, 0x61, 0x63, 0x6b, 0x5f, 0x55, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d,
0x5f, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x18, 0x01,
0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06,
0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x49, 0x74,
0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x18, 0x03,
0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x13, 0x0a, 0x11,
0x50, 0x61, 0x63, 0x6b, 0x5f, 0x55, 0x73, 0x65, 0x49, 0x74, 0x65, 0x6d, 0x5f, 0x52, 0x65, 0x73,
0x70, 0x22, 0x5b, 0x0a, 0x11, 0x50, 0x61, 0x63, 0x6b, 0x5f, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74,
0x65, 0x6d, 0x5f, 0x52, 0x65, 0x71, 0x12, 0x16, 0x0a, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64,
0x18, 0x01, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06, 0x47, 0x72, 0x69, 0x64, 0x49, 0x64, 0x12, 0x16,
0x0a, 0x06, 0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x18, 0x02, 0x20, 0x01, 0x28, 0x05, 0x52, 0x06,
0x49, 0x74, 0x65, 0x6d, 0x49, 0x64, 0x12, 0x16, 0x0a, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74,
0x18, 0x03, 0x20, 0x01, 0x28, 0x0d, 0x52, 0x06, 0x41, 0x6d, 0x6f, 0x75, 0x6e, 0x74, 0x22, 0x14,
0x0a, 0x12, 0x50, 0x61, 0x63, 0x6b, 0x5f, 0x53, 0x65, 0x6c, 0x6c, 0x49, 0x74, 0x65, 0x6d, 0x5f,
0x52, 0x65, 0x73, 0x70, 0x42, 0x06, 0x5a, 0x04, 0x2e, 0x3b, 0x70, 0x62, 0x62, 0x06, 0x70, 0x72,
0x6f, 0x74, 0x6f, 0x33,
}
var (
@ -363,16 +366,16 @@ func file_pack_pack_msg_proto_rawDescGZIP() []byte {
var file_pack_pack_msg_proto_msgTypes = make([]protoimpl.MessageInfo, 6)
var file_pack_pack_msg_proto_goTypes = []interface{}{
(*GetlistReq)(nil), // 0: GetlistReq
(*GetlistResp)(nil), // 1: GetlistResp
(*UseItemReq)(nil), // 2: UseItemReq
(*UseItemResp)(nil), // 3: UseItemResp
(*SellItemReq)(nil), // 4: SellItemReq
(*SellItemResp)(nil), // 5: SellItemResp
(*DB_UserItemData)(nil), // 6: DB_UserItemData
(*Pack_Getlist_Req)(nil), // 0: Pack_Getlist_Req
(*Pack_Getlist_Resp)(nil), // 1: Pack_Getlist_Resp
(*Pack_UseItem_Req)(nil), // 2: Pack_UseItem_Req
(*Pack_UseItem_Resp)(nil), // 3: Pack_UseItem_Resp
(*Pack_SellItem_Req)(nil), // 4: Pack_SellItem_Req
(*Pack_SellItem_Resp)(nil), // 5: Pack_SellItem_Resp
(*DB_UserItemData)(nil), // 6: DB_UserItemData
}
var file_pack_pack_msg_proto_depIdxs = []int32{
6, // 0: GetlistResp.Grids:type_name -> DB_UserItemData
6, // 0: Pack_Getlist_Resp.Grids:type_name -> DB_UserItemData
1, // [1:1] is the sub-list for method output_type
1, // [1:1] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@ -388,7 +391,7 @@ func file_pack_pack_msg_proto_init() {
file_pack_pack_db_proto_init()
if !protoimpl.UnsafeEnabled {
file_pack_pack_msg_proto_msgTypes[0].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetlistReq); i {
switch v := v.(*Pack_Getlist_Req); i {
case 0:
return &v.state
case 1:
@ -400,7 +403,7 @@ func file_pack_pack_msg_proto_init() {
}
}
file_pack_pack_msg_proto_msgTypes[1].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*GetlistResp); i {
switch v := v.(*Pack_Getlist_Resp); i {
case 0:
return &v.state
case 1:
@ -412,7 +415,7 @@ func file_pack_pack_msg_proto_init() {
}
}
file_pack_pack_msg_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UseItemReq); i {
switch v := v.(*Pack_UseItem_Req); i {
case 0:
return &v.state
case 1:
@ -424,7 +427,7 @@ func file_pack_pack_msg_proto_init() {
}
}
file_pack_pack_msg_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*UseItemResp); i {
switch v := v.(*Pack_UseItem_Resp); i {
case 0:
return &v.state
case 1:
@ -436,7 +439,7 @@ func file_pack_pack_msg_proto_init() {
}
}
file_pack_pack_msg_proto_msgTypes[4].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SellItemReq); i {
switch v := v.(*Pack_SellItem_Req); i {
case 0:
return &v.state
case 1:
@ -448,7 +451,7 @@ func file_pack_pack_msg_proto_init() {
}
}
file_pack_pack_msg_proto_msgTypes[5].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SellItemResp); i {
switch v := v.(*Pack_SellItem_Resp); i {
case 0:
return &v.state
case 1:

View File

@ -3,35 +3,35 @@ option go_package = ".;pb";
import "pack/pack_db.proto";
//
message GetlistReq {
message Pack_Getlist_Req {
int32 IType = 1; //
}
//
message GetlistResp {
message Pack_Getlist_Resp {
repeated DB_UserItemData Grids = 1; //
}
//使
message UseItemReq {
message Pack_UseItem_Req {
int32 GridId = 1; //Id
int32 ItemId = 2; //Id
uint32 Amount = 3; //使
}
//使
message UseItemResp {
message Pack_UseItem_Resp {
}
//sailitem
message SellItemReq {
message Pack_SellItem_Req {
int32 GridId = 1; //Id
int32 ItemId = 2; //Id
uint32 Amount = 3; //使
}
//
message SellItemResp {
message Pack_SellItem_Resp {
}