xy 1 dienu atpakaļ
vecāks
revīzija
f4820c9ead

+ 1 - 0
bin/client_msg/common.proto

@@ -239,6 +239,7 @@ message ShopItem{
   string name = 1;
   string id = 2;
   int32 price = 3;
+  int32 num = 4;
 }
 
 //被踢登陆

+ 11 - 2
src/server/msg/common.pb.go

@@ -2118,6 +2118,7 @@ type ShopItem struct {
 	Name          string                 `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
 	Id            string                 `protobuf:"bytes,2,opt,name=id,proto3" json:"id,omitempty"`
 	Price         int32                  `protobuf:"varint,3,opt,name=price,proto3" json:"price,omitempty"`
+	Num           int32                  `protobuf:"varint,4,opt,name=num,proto3" json:"num,omitempty"`
 	unknownFields protoimpl.UnknownFields
 	sizeCache     protoimpl.SizeCache
 }
@@ -2173,6 +2174,13 @@ func (x *ShopItem) GetPrice() int32 {
 	return 0
 }
 
+func (x *ShopItem) GetNum() int32 {
+	if x != nil {
+		return x.Num
+	}
+	return 0
+}
+
 // 被踢登陆
 type BeKickLogin struct {
 	state         protoimpl.MessageState `protogen:"open.v1"`
@@ -2461,11 +2469,12 @@ const file_common_proto_rawDesc = "" +
 	"\fResHeartBeat\x12\x10\n" +
 	"\x03msg\x18\x01 \x01(\tR\x03msg\" \n" +
 	"\fReqHeartBeat\x12\x10\n" +
-	"\x03msg\x18\x01 \x01(\tR\x03msg\"D\n" +
+	"\x03msg\x18\x01 \x01(\tR\x03msg\"V\n" +
 	"\bShopItem\x12\x12\n" +
 	"\x04name\x18\x01 \x01(\tR\x04name\x12\x0e\n" +
 	"\x02id\x18\x02 \x01(\tR\x02id\x12\x14\n" +
-	"\x05price\x18\x03 \x01(\x05R\x05price\"1\n" +
+	"\x05price\x18\x03 \x01(\x05R\x05price\x12\x10\n" +
+	"\x03num\x18\x04 \x01(\x05R\x03num\"1\n" +
 	"\vBeKickLogin\x12\"\n" +
 	"\aerr_msg\x18\x01 \x01(\v2\t.MsgErrorR\x06errMsg\"%\n" +
 	"\aReqShop\x12\x1a\n" +

+ 2 - 1
src/server/webserver/shop.go

@@ -18,7 +18,8 @@ func MakeShop() []*msg.ShopItem {
 		list = append(list, &msg.ShopItem{
 			Id:    fmt.Sprintf("%d", i+1),
 			Name:  fmt.Sprintf("Item:%d", i+1),
-			Price: int32(i * 100),
+			Price: int32((i + 1) * 100),
+			Num:   int32((i + 1) * 50),
 		})
 	}
 	return list