Преглед на файлове

feat(商店商品): 增加 JSON 配置表逻辑- 参考 GenerateItemsJsonCommand 实现商店商品的 JSON 配置
- 更新后台和 JsonController 相关逻辑
- 移除 ShopGoodItem 和 SHOP_BUY_LIMIT_TYPE 相关代码
- 更新 ResponseShopQuery 结构,添加 last_times 字段

notfff преди 7 месеца
родител
ревизия
7fe44e0ba8

+ 2 - 0
AiWork/WORK.md

@@ -13,6 +13,8 @@ shop_items 的 $max_buy 确认被替代后移除,使用mcp执行sql
 
 ## 待处理任务
 
+商店商品 ,增加json配置表逻辑  参考  GenerateItemsJsonCommand 
+注意关联更新后台 和 JsonController
 
 
 ## 已完成任务(保留最新的10条,多余的删除)

+ 1 - 1
config/proto_route.php

@@ -90,7 +90,7 @@ return array (
       7 => 'query_data',
     ),
   ),
-  'generated_at' => '+08:00 2025-06-01 15:39:35',
+  'generated_at' => '+08:00 2025-06-03 13:53:47',
   'conventions' => 
   array (
     'handler_namespace' => 'App\\Module\\AppGame\\Handler',

+ 7 - 22
protophp/GPBMetadata/Proto/Game.php

@@ -16,7 +16,7 @@ class Game
         }
         $pool->internalAddGeneratedFile(
             '
-…¡
+åž
 proto/game.proto	uraus.kku"„4
 Request
 request_unid (	;
@@ -236,7 +236,7 @@ select_ids (.
 task_id (
 items ()
 RequestTaskClaimReward
-task_id ("†?
+task_id ("æ<
 Response
 run_unid (	
 run_ms (-
@@ -461,18 +461,10 @@ to_user_id (
 ResponseItemQuery
 ResponseItemOpenBox
 ResponseItemCraft
-ResponseItemDismantleD
-ResponseShopQuery/
-items (2 .uraus.kku.Response.ShopGoodItem§
-ShopGoodItem
-
-id (&
-coin (2.uraus.kku.Common.Deduct&
-item (2.uraus.kku.Common.Reward
-category (	
-limit (
-name (	
-desc (	
+ResponseItemDismantle\'
+ResponseShopQuery
+
+last_times (
 ResponseShopBuy
 ResponseTaskData
 ResponseTaskQueryData
@@ -485,14 +477,7 @@ to_user_id (
 APPLYING	
 AGREE
 
-REFUSE"W
-SHOP_BUY_LIMIT_TYPE
-	UNLIMITED
-	PERMANENT	
-DAILY
-
-WEEKLY
-MONTHLY"Í-
+REFUSE"Í-
 Common)
 KeyValue
 kname (	

+ 19 - 12
protophp/Uraus/Kku/Response/ResponseShopQuery.php

@@ -16,9 +16,11 @@ use Google\Protobuf\Internal\GPBUtil;
 class ResponseShopQuery extends \Google\Protobuf\Internal\Message
 {
     /**
-     * Generated from protobuf field <code>repeated .uraus.kku.Response.ShopGoodItem items = 1;</code>
+     * 商品最新配置表 - 更新时间
+     *
+     * Generated from protobuf field <code>int64 last_times = 1;</code>
      */
-    private $items;
+    protected $last_times = 0;
 
     /**
      * Constructor.
@@ -26,7 +28,8 @@ class ResponseShopQuery extends \Google\Protobuf\Internal\Message
      * @param array $data {
      *     Optional. Data for populating the Message object.
      *
-     *     @type \Uraus\Kku\Response\ShopGoodItem[]|\Google\Protobuf\Internal\RepeatedField $items
+     *     @type int|string $last_times
+     *           商品最新配置表 - 更新时间
      * }
      */
     public function __construct($data = NULL) {
@@ -35,23 +38,27 @@ class ResponseShopQuery extends \Google\Protobuf\Internal\Message
     }
 
     /**
-     * Generated from protobuf field <code>repeated .uraus.kku.Response.ShopGoodItem items = 1;</code>
-     * @return \Google\Protobuf\Internal\RepeatedField
+     * 商品最新配置表 - 更新时间
+     *
+     * Generated from protobuf field <code>int64 last_times = 1;</code>
+     * @return int|string
      */
-    public function getItems()
+    public function getLastTimes()
     {
-        return $this->items;
+        return $this->last_times;
     }
 
     /**
-     * Generated from protobuf field <code>repeated .uraus.kku.Response.ShopGoodItem items = 1;</code>
-     * @param \Uraus\Kku\Response\ShopGoodItem[]|\Google\Protobuf\Internal\RepeatedField $var
+     * 商品最新配置表 - 更新时间
+     *
+     * Generated from protobuf field <code>int64 last_times = 1;</code>
+     * @param int|string $var
      * @return $this
      */
-    public function setItems($var)
+    public function setLastTimes($var)
     {
-        $arr = GPBUtil::checkRepeatedField($var, \Google\Protobuf\Internal\GPBType::MESSAGE, \Uraus\Kku\Response\ShopGoodItem::class);
-        $this->items = $arr;
+        GPBUtil::checkInt64($var);
+        $this->last_times = $var;
 
         return $this;
     }

+ 0 - 78
protophp/Uraus/Kku/Response/SHOP_BUY_LIMIT_TYPE.php

@@ -1,78 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: proto/game.proto
-
-namespace Uraus\Kku\Response;
-
-use UnexpectedValueException;
-
-/**
- * 限购类型  永久限购,日限购,周限购,月限购
- *
- * Protobuf type <code>uraus.kku.Response.SHOP_BUY_LIMIT_TYPE</code>
- */
-class SHOP_BUY_LIMIT_TYPE
-{
-    /**
-     * 不限购
-     *
-     * Generated from protobuf enum <code>UNLIMITED = 0;</code>
-     */
-    const UNLIMITED = 0;
-    /**
-     * 永久限购
-     *
-     * Generated from protobuf enum <code>PERMANENT = 1;</code>
-     */
-    const PERMANENT = 1;
-    /**
-     * 日限购
-     *
-     * Generated from protobuf enum <code>DAILY = 2;</code>
-     */
-    const DAILY = 2;
-    /**
-     * 周限购
-     *
-     * Generated from protobuf enum <code>WEEKLY = 3;</code>
-     */
-    const WEEKLY = 3;
-    /**
-     * 月限购
-     *
-     * Generated from protobuf enum <code>MONTHLY = 4;</code>
-     */
-    const MONTHLY = 4;
-
-    private static $valueToName = [
-        self::UNLIMITED => 'UNLIMITED',
-        self::PERMANENT => 'PERMANENT',
-        self::DAILY => 'DAILY',
-        self::WEEKLY => 'WEEKLY',
-        self::MONTHLY => 'MONTHLY',
-    ];
-
-    public static function name($value)
-    {
-        if (!isset(self::$valueToName[$value])) {
-            throw new UnexpectedValueException(sprintf(
-                    'Enum %s has no name defined for value %s', __CLASS__, $value));
-        }
-        return self::$valueToName[$value];
-    }
-
-
-    public static function value($name)
-    {
-        $const = __CLASS__ . '::' . strtoupper($name);
-        if (!defined($const)) {
-            throw new UnexpectedValueException(sprintf(
-                    'Enum %s has no value defined for name %s', __CLASS__, $name));
-        }
-        return constant($const);
-    }
-}
-
-// Adding a class alias for backwards compatibility with the previous class name.
-class_alias(SHOP_BUY_LIMIT_TYPE::class, \Uraus\Kku\Response_SHOP_BUY_LIMIT_TYPE::class);
-

+ 0 - 287
protophp/Uraus/Kku/Response/ShopGoodItem.php

@@ -1,287 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: proto/game.proto
-
-namespace Uraus\Kku\Response;
-
-use Google\Protobuf\Internal\GPBType;
-use Google\Protobuf\Internal\RepeatedField;
-use Google\Protobuf\Internal\GPBUtil;
-
-/**
- * 商品元素
- *
- * Generated from protobuf message <code>uraus.kku.Response.ShopGoodItem</code>
- */
-class ShopGoodItem extends \Google\Protobuf\Internal\Message
-{
-    /**
-     * Generated from protobuf field <code>int64 id = 1;</code>
-     */
-    protected $id = 0;
-    /**
-     * 价格
-     *
-     * Generated from protobuf field <code>.uraus.kku.Common.Deduct coin = 2;</code>
-     */
-    protected $coin = null;
-    /**
-     * 商品
-     *
-     * Generated from protobuf field <code>.uraus.kku.Common.Reward item = 3;</code>
-     */
-    protected $item = null;
-    /**
-     * 分类
-     *
-     * Generated from protobuf field <code>string category = 4;</code>
-     */
-    protected $category = '';
-    /**
-     * 单次购买限制
-     *
-     * Generated from protobuf field <code>int64 limit = 5;</code>
-     */
-    protected $limit = 0;
-    /**
-     * 商品名字
-     *
-     * Generated from protobuf field <code>string name = 6;</code>
-     */
-    protected $name = '';
-    /**
-     * 商品描述
-     *
-     * Generated from protobuf field <code>string desc = 7;</code>
-     */
-    protected $desc = '';
-
-    /**
-     * Constructor.
-     *
-     * @param array $data {
-     *     Optional. Data for populating the Message object.
-     *
-     *     @type int|string $id
-     *     @type \Uraus\Kku\Common\Deduct $coin
-     *           价格
-     *     @type \Uraus\Kku\Common\Reward $item
-     *           商品
-     *     @type string $category
-     *           分类
-     *     @type int|string $limit
-     *           单次购买限制
-     *     @type string $name
-     *           商品名字
-     *     @type string $desc
-     *           商品描述
-     * }
-     */
-    public function __construct($data = NULL) {
-        \GPBMetadata\Proto\Game::initOnce();
-        parent::__construct($data);
-    }
-
-    /**
-     * Generated from protobuf field <code>int64 id = 1;</code>
-     * @return int|string
-     */
-    public function getId()
-    {
-        return $this->id;
-    }
-
-    /**
-     * Generated from protobuf field <code>int64 id = 1;</code>
-     * @param int|string $var
-     * @return $this
-     */
-    public function setId($var)
-    {
-        GPBUtil::checkInt64($var);
-        $this->id = $var;
-
-        return $this;
-    }
-
-    /**
-     * 价格
-     *
-     * Generated from protobuf field <code>.uraus.kku.Common.Deduct coin = 2;</code>
-     * @return \Uraus\Kku\Common\Deduct
-     */
-    public function getCoin()
-    {
-        return isset($this->coin) ? $this->coin : null;
-    }
-
-    public function hasCoin()
-    {
-        return isset($this->coin);
-    }
-
-    public function clearCoin()
-    {
-        unset($this->coin);
-    }
-
-    /**
-     * 价格
-     *
-     * Generated from protobuf field <code>.uraus.kku.Common.Deduct coin = 2;</code>
-     * @param \Uraus\Kku\Common\Deduct $var
-     * @return $this
-     */
-    public function setCoin($var)
-    {
-        GPBUtil::checkMessage($var, \Uraus\Kku\Common\Deduct::class);
-        $this->coin = $var;
-
-        return $this;
-    }
-
-    /**
-     * 商品
-     *
-     * Generated from protobuf field <code>.uraus.kku.Common.Reward item = 3;</code>
-     * @return \Uraus\Kku\Common\Reward
-     */
-    public function getItem()
-    {
-        return isset($this->item) ? $this->item : null;
-    }
-
-    public function hasItem()
-    {
-        return isset($this->item);
-    }
-
-    public function clearItem()
-    {
-        unset($this->item);
-    }
-
-    /**
-     * 商品
-     *
-     * Generated from protobuf field <code>.uraus.kku.Common.Reward item = 3;</code>
-     * @param \Uraus\Kku\Common\Reward $var
-     * @return $this
-     */
-    public function setItem($var)
-    {
-        GPBUtil::checkMessage($var, \Uraus\Kku\Common\Reward::class);
-        $this->item = $var;
-
-        return $this;
-    }
-
-    /**
-     * 分类
-     *
-     * Generated from protobuf field <code>string category = 4;</code>
-     * @return string
-     */
-    public function getCategory()
-    {
-        return $this->category;
-    }
-
-    /**
-     * 分类
-     *
-     * Generated from protobuf field <code>string category = 4;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setCategory($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->category = $var;
-
-        return $this;
-    }
-
-    /**
-     * 单次购买限制
-     *
-     * Generated from protobuf field <code>int64 limit = 5;</code>
-     * @return int|string
-     */
-    public function getLimit()
-    {
-        return $this->limit;
-    }
-
-    /**
-     * 单次购买限制
-     *
-     * Generated from protobuf field <code>int64 limit = 5;</code>
-     * @param int|string $var
-     * @return $this
-     */
-    public function setLimit($var)
-    {
-        GPBUtil::checkInt64($var);
-        $this->limit = $var;
-
-        return $this;
-    }
-
-    /**
-     * 商品名字
-     *
-     * Generated from protobuf field <code>string name = 6;</code>
-     * @return string
-     */
-    public function getName()
-    {
-        return $this->name;
-    }
-
-    /**
-     * 商品名字
-     *
-     * Generated from protobuf field <code>string name = 6;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setName($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->name = $var;
-
-        return $this;
-    }
-
-    /**
-     * 商品描述
-     *
-     * Generated from protobuf field <code>string desc = 7;</code>
-     * @return string
-     */
-    public function getDesc()
-    {
-        return $this->desc;
-    }
-
-    /**
-     * 商品描述
-     *
-     * Generated from protobuf field <code>string desc = 7;</code>
-     * @param string $var
-     * @return $this
-     */
-    public function setDesc($var)
-    {
-        GPBUtil::checkString($var, True);
-        $this->desc = $var;
-
-        return $this;
-    }
-
-}
-
-// Adding a class alias for backwards compatibility with the previous class name.
-class_alias(ShopGoodItem::class, \Uraus\Kku\Response_ShopGoodItem::class);
-

+ 0 - 16
protophp/Uraus/Kku/Response_SHOP_BUY_LIMIT_TYPE.php

@@ -1,16 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: proto/game.proto
-
-namespace Uraus\Kku;
-
-if (false) {
-    /**
-     * This class is deprecated. Use Uraus\Kku\Response\SHOP_BUY_LIMIT_TYPE instead.
-     * @deprecated
-     */
-    class Response_SHOP_BUY_LIMIT_TYPE {}
-}
-class_exists(Response\SHOP_BUY_LIMIT_TYPE::class);
-@trigger_error('Uraus\Kku\Response_SHOP_BUY_LIMIT_TYPE is deprecated and will be removed in the next major release. Use Uraus\Kku\Response\SHOP_BUY_LIMIT_TYPE instead', E_USER_DEPRECATED);
-

+ 0 - 16
protophp/Uraus/Kku/Response_ShopGoodItem.php

@@ -1,16 +0,0 @@
-<?php
-# Generated by the protocol buffer compiler.  DO NOT EDIT!
-# source: proto/game.proto
-
-namespace Uraus\Kku;
-
-if (false) {
-    /**
-     * This class is deprecated. Use Uraus\Kku\Response\ShopGoodItem instead.
-     * @deprecated
-     */
-    class Response_ShopGoodItem {}
-}
-class_exists(Response\ShopGoodItem::class);
-@trigger_error('Uraus\Kku\Response_ShopGoodItem is deprecated and will be removed in the next major release. Use Uraus\Kku\Response\ShopGoodItem instead', E_USER_DEPRECATED);
-