From ea667a3cc3a101103b57777a6afd62c2642986a7 Mon Sep 17 00:00:00 2001 From: aozhiwei Date: Wed, 27 Nov 2024 17:00:19 +0800 Subject: [PATCH] 1 --- bin/wheelserver/res/item@item.json | 60 +++++---- bin/wheelserver/res/shopGoods@shopGoods.json | 123 +++++++++++++++++- .../api/v1/inapp_shop/inapp_shop.go | 9 ++ 3 files changed, 169 insertions(+), 23 deletions(-) diff --git a/bin/wheelserver/res/item@item.json b/bin/wheelserver/res/item@item.json index c97cd509..5be2df70 100644 --- a/bin/wheelserver/res/item@item.json +++ b/bin/wheelserver/res/item@item.json @@ -1,115 +1,115 @@ [ { - "name": "AA", + "name": "Vision", "level": 1, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV1 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10001, - "icon": "" + "icon": "chip/chip01" }, { - "name": "BB", + "name": "Vision", "level": 2, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV2 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10002, - "icon": "" + "icon": "chip/chip01" }, { - "name": "CC", + "name": "Vision", "level": 3, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV3 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10003, - "icon": "" + "icon": "chip/chip01" }, { - "name": "DD", + "name": "Vision", "level": 4, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV4 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10004, - "icon": "" + "icon": "chip/chip01" }, { - "name": "EE", + "name": "Vision", "level": 5, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV5 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10005, - "icon": "" + "icon": "chip/chip01" }, { - "name": "FF", + "name": "Vision", "level": 6, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV6 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10006, - "icon": "" + "icon": "chip/chip01" }, { - "name": "GG", + "name": "Vision", "level": 7, "price_type": 1, "price": 100, "produce_type": 1, "accelerate_price": 100, - "introduce": "\u4ecb\u7ecd\u6587\u5b57", + "introduce": "LV7 Vision Chip", "accelerate_type": 1, "item_type": 1, "produce": 500, "time": 1000, "buff_list": "", "id": 10007, - "icon": "" + "icon": "chip/chip01" }, { "name": "score", @@ -150,7 +150,7 @@ "price": "", "produce_type": "", "accelerate_price": "", - "introduce": "\u79ef\u5206\u53cc\u500d\u5361", + "introduce": "\u79ef\u52063\u500d\u5361", "accelerate_type": "", "item_type": 4, "produce": "", @@ -190,5 +190,21 @@ "buff_list": "", "id": 20005, "icon": "" + }, + { + "name": "", + "level": 1, + "price_type": "", + "price": "", + "produce_type": "", + "accelerate_price": "", + "introduce": "\u666e\u901a\u8272\u5b50", + "accelerate_type": "", + "item_type": 7, + "produce": "", + "time": "", + "buff_list": "", + "id": 20006, + "icon": "" } ] \ No newline at end of file diff --git a/bin/wheelserver/res/shopGoods@shopGoods.json b/bin/wheelserver/res/shopGoods@shopGoods.json index 0637a088..82bc7527 100644 --- a/bin/wheelserver/res/shopGoods@shopGoods.json +++ b/bin/wheelserver/res/shopGoods@shopGoods.json @@ -1 +1,122 @@ -[] \ No newline at end of file +[ + { + "goods_id": 1001, + "price": 1, + "introduce": "1\u4e2a\u9ab0\u5b50", + "amount": 1, + "shop_id": 1, + "item_id": 20006 + }, + { + "goods_id": 1002, + "price": 1, + "introduce": "2\u4e2a\u9ab0\u5b50", + "amount": 2, + "shop_id": 2, + "item_id": 20006 + }, + { + "goods_id": 1003, + "price": 1, + "introduce": "3\u4e2a\u9ab0\u5b50", + "amount": 3, + "shop_id": 3, + "item_id": 20006 + }, + { + "goods_id": 1004, + "price": 1, + "introduce": "4\u4e2a\u9ab0\u5b50", + "amount": 4, + "shop_id": 4, + "item_id": 20006 + }, + { + "goods_id": 1005, + "price": 1, + "introduce": "1\u4e2aspecify\u9ab0\u5b50", + "amount": 1, + "shop_id": 5, + "item_id": 20002 + }, + { + "goods_id": 1006, + "price": 1, + "introduce": "2\u4e2aspecify\u9ab0\u5b50", + "amount": 2, + "shop_id": 6, + "item_id": 20002 + }, + { + "goods_id": 1007, + "price": 1, + "introduce": "3\u4e2aspecify\u9ab0\u5b50", + "amount": 3, + "shop_id": 7, + "item_id": 20002 + }, + { + "goods_id": 1008, + "price": 1, + "introduce": "1\u5f203\u500d\u79ef\u5206\u5361", + "amount": 4, + "shop_id": 8, + "item_id": 20003 + }, + { + "goods_id": 1009, + "price": 1, + "introduce": "1\u4e2a1\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 9, + "item_id": 10001 + }, + { + "goods_id": 1010, + "price": 1, + "introduce": "1\u4e2a2\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 10, + "item_id": 10002 + }, + { + "goods_id": 1011, + "price": 1, + "introduce": "1\u4e2a3\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 11, + "item_id": 10003 + }, + { + "goods_id": 1012, + "price": 1, + "introduce": "1\u4e2a4\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 12, + "item_id": 10004 + }, + { + "goods_id": 1013, + "price": 1, + "introduce": "1\u4e2a5\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 13, + "item_id": 10005 + }, + { + "goods_id": 1014, + "price": 1, + "introduce": "1\u4e2a6\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 14, + "item_id": 10006 + }, + { + "goods_id": 1015, + "price": 1, + "introduce": "1\u4e2a7\u7ea7\u82af\u7247", + "amount": 1, + "shop_id": 15, + "item_id": 10007 + } +] \ No newline at end of file diff --git a/server/wheelserver/api/v1/inapp_shop/inapp_shop.go b/server/wheelserver/api/v1/inapp_shop/inapp_shop.go index 4ccddf41..d20235d8 100644 --- a/server/wheelserver/api/v1/inapp_shop/inapp_shop.go +++ b/server/wheelserver/api/v1/inapp_shop/inapp_shop.go @@ -40,6 +40,15 @@ func (this *InAppShopApi) Purchase(c *gin.Context) { f5.RspErr(c, 401, "goodsNum params error") return } + nowTime := int32(f5.GetApp().GetRealSeconds()) orderModel := new(model.InAppOrder) orderModel.OrderId = q5.ToString(f5.GetApp().NewLockNodeUuid()) + orderModel.AccountId = s.GetAccountId() + orderModel.GoodsId = reqJson.GoodsId + orderModel.CreateTime = nowTime + orderModel.ModifyTime = nowTime + if err := orderModel.Create(); err != nil { + f5.RspErr(c, 500, "server internal error") + return + } }