فهرست منبع

清理废弃LCache模块,统一各模块README文档规范

Your Name 8 ماه پیش
والد
کامیت
d5db520c3f

+ 3 - 0
app/Module/AppGame/README.md

@@ -0,0 +1,3 @@
+# AppGame 模块
+
+> AppGame模块,是一个适配模块,将游戏逻辑适配App的输入/输出,不负责具体逻辑

+ 1 - 0
app/Module/Article/README.md

@@ -0,0 +1 @@
+# 文章模块

+ 3 - 1
app/Module/China/README.md

@@ -1 +1,3 @@
-# Chine模块
+# China模块
+
+> 中国特殊内容模块

+ 3 - 0
app/Module/Dev/README.md

@@ -0,0 +1,3 @@
+# Dev开发者模块
+
+> 一些开发者工具

+ 1 - 0
app/Module/File/README.md

@@ -0,0 +1 @@
+# 文件模块

+ 1 - 24
app/Module/Game/README.md

@@ -1,28 +1,5 @@
 # Game模块
 
 ## 模块说明
-Game模块是一个示例模块,用于展示模块化开发的最佳实践。
-
-## 目录结构
-```
-├── AdminControllers/    # 后台控制器
-├── Commands/            # 命令目录
-├── Config/              # 配置目录
-├── Database/            # 数据库目录
-│   └── create.sql       # 创建数据表的SQL
-└── Enums/               # 枚举(枚举的名和Case全大写)
-├── Models/              # 模型目录
-├── Providers/           # Providers
-├── Events/              # 事件目录
-├── Logic/               # Logic目录/逻辑目录
-├── Listeners/           # 监听器目录 
-├── Queues/              # 队列目录
-├── Repositorys/         # 仓库目录(后台控制器专用,其他场景不要用)
-├── Services/            # 服务目录(供其他模块使用)
-│   └──  TestService.php       # 服务之一
-├── Validations/         # Validation 目录(不是Laravel的Validation规则)
-├── Validators/          # Validator目录
-└── Tests/               # 测试目录
-```
-
+Game模块是游戏的统筹模块,不现实具体的游戏逻辑,对逻辑进行统筹管理
 

+ 0 - 100
app/Module/LCache/Cache.php

@@ -1,100 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-use UCore\Helper\CacheTag;
-use UCore\Helper\Logger;
-
-
-class Cache
-{
-
-    /**
-     * 回调函数的缓存
-     *
-     * @param $key
-     * @param callable $callable
-     * @param $param_arr
-     * @param $exp
-     * @return mixed
-     *
-     */
-    static public function cacheCall($key2, callable $callable, $param_arr, $exp = 60, $tags = [])
-    {
-        $key = self::getKey($key2);
-        $old = \Illuminate\Support\Facades\Cache::get($key);
-        if (!is_null($old)) {
-            return $old;
-        }
-        $new = call_user_func_array($callable, $param_arr);
-        \Illuminate\Support\Facades\Cache::put($key, $new, $exp);
-        if ($tags) {
-            CacheTag::key_tags($key, $tags, null);
-        }
-        return $new;
-    }
-
-
-    /**
-     * 设置数据
-     *
-     * @param $key
-     * @param $data
-     * @param $exp
-     * @param $tags
-     * @return void
-     */
-    static public function put($key, $data, $exp = 60, $tags = [])
-    {
-        $key = self::getKey($key);
-        \Illuminate\Support\Facades\Cache::put($key, $data, $exp);
-        if ($tags) {
-            CacheTag::key_tags($key, $tags, null);
-        }
-
-    }
-
-    /**
-     * 获取数据
-     *
-     * @param $key
-     * @param $default
-     * @return mixed
-     */
-    static public function get($key, $default = null)
-    {
-        $key = self::getKey($key);
-        Logger::debug("Cache-get".$key);
-        return \Illuminate\Support\Facades\Cache::get($key,$default);
-    }
-
-
-    /**
-     * has数据
-     * @param $key
-     * @return bool
-     */
-    static public function has($key)
-    {
-        $key = self::getKey($key);
-
-        return \Illuminate\Support\Facades\Cache::has($key);
-    }
-
-    static public function getTags($key)
-    {
-        $key = self::getKey($key);
-
-    }
-    /**
-     * 获取键名
-     * @param $data
-     * @return string
-     */
-    static public function getKey($data)
-    {
-        return md5(serialize($data));
-    }
-
-
-}

+ 0 - 169
app/Module/LCache/CacheItem.php

@@ -1,169 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-use Psr\Cache\CacheItemInterface;
-use \DateTimeInterface;
-
-class CacheItem implements CacheItemInterface
-{
-
-    public int $ttl;
-    public int $create_ts;
-    public int $expire_ts = 0;
-
-    public string $key;
-
-
-    public mixed $value;
-
-    public $isHit;
-
-
-    public function __construct(string $key, mixed $value = null, int $create_ts = 0, int $ttl = 0)
-    {
-        $this->key   = $key;
-        $this->value = $value;
-        if ($create_ts) {
-            $this->create_ts = time();
-        } else {
-            $this->create_ts = $create_ts;
-        }
-
-        if ($ttl) {
-            $this->expire_ts = $this->create_ts + $ttl;
-            $this->ttl       = $ttl;
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function getKey(): string
-    {
-        return $this->key;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function get(): mixed
-    {
-        if (!$this->isHit()) {
-            return null;
-        }
-
-        return $this->value;
-    }
-
-    public function getValue()
-    {
-        return $this->value;
-    }
-
-    /**
-     * A cache hit occurs when a Calling Library requests an Item by key
-     * and a matching value is found for that key, and that value has
-     * not expired, and the value is not invalid for some other reason.
-     *
-     * Calling Libraries SHOULD make sure to verify isHit() on all get() calls.
-     *
-     * {@inheritdoc}
-     */
-    public function isHit($force = false): bool
-    {
-        if (isset($this->isHit) && $force === false) {
-            return $this->isHit;
-        }
-        if ($this->expire_ts) {
-            if ($this->expire_ts < time()) {
-                $this->isHit = false;
-
-                return false;
-            }
-        }
-        $this->isHit = true;
-
-        return true;
-    }
-
-    public function setHit($hit)
-    {
-        $this->isHit = $hit;
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function set(mixed $value): static
-    {
-        $this->value = $value;
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function expiresAt(?\DateTimeInterface $expires): static
-    {
-        if ($expires instanceof DateTimeInterface && !$expires instanceof \DateTimeImmutable) {
-            $timezone = $expires->getTimezone();
-            $expires  = \DateTimeImmutable::createFromFormat('U', (string)$expires->getTimestamp(), $timezone);
-            if ($expires) {
-                $expires = $expires->setTimezone($timezone);
-            }
-        }
-
-        if ($expires instanceof DateTimeInterface) {
-            $this->expires = $expires;
-            $this->expire_ts = $expires->getTimestamp();
-        } else {
-            $this->expires = null;
-        }
-
-        return $this;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    public function expiresAfter(int|\DateInterval|null $time): static
-    {
-        if ($time === null) {
-            $this->expires = null;
-
-            return $this;
-        }
-
-        $this->expires = new \DateTimeImmutable();
-
-        if (!$time instanceof \DateInterval) {
-            $time2 = new \DateInterval(sprintf('PT%sS', abs($time)));
-        }
-        if($time > 0){
-            $this->expires   = $this->expires->add($time2);
-        }else{
-            $this->expires   = $this->expires->sub($time2);
-        }
-
-        $this->expire_ts = $this->expires->getTimestamp();
-
-        return $this;
-    }
-
-    public function getExpiresAt(): DateTimeInterface
-    {
-        if (!$this->expires) {
-            $this->expires = new \DateTimeImmutable();
-            $time          = new \DateInterval(sprintf('PT%sS', $this->ttl));
-
-            $this->expires->add($time);
-        }
-
-        return $this->expires;
-    }
-
-
-}

+ 0 - 54
app/Module/LCache/DQueueJob.php

@@ -1,54 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-
-use App\Module\DelayQueue\Redis;
-use UCore\Helper\Logger;
-
-abstract class DQueueJob  implements QueueJobInterface,DQueueJobInterface
-{
-    use QueueCache;
-
-
-    static public function getDelay(): int
-    {
-        return 2;
-    }
-
-    /**
-     * 事件监听
-     * @param  $user
-     *
-     */
-    static public function eventListen($user)
-    {
-        $arg2   = [];
-        $indexs = static::getRequiredArgIndex();
-        foreach ($indexs as $index) {
-            if (!isset($user->$index)) {
-                Logger::error("Cache-error", [ $user, $indexs, $index ]);
-                throw new \InvalidArgumentException("参数错误");
-            }
-            $arg2[$index] = $user->$index;
-        }
-
-        static::jobUpdate($arg2);
-    }
-
-    /**
-     * 使用任务更新
-     *
-     * @param $arg
-     * @return void
-     */
-    static protected function jobUpdate($parameter)
-    {
-
-        Redis::addQueue([static::class, 'updateSync'], $parameter, static::getDelay());
-
-    }
-
-
-
-}

+ 0 - 24
app/Module/LCache/DQueueJobInterface.php

@@ -1,24 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-interface DQueueJobInterface
-{
-
-
-
-
-    /**
-     * 获取延迟时间
-     *
-     * @return int
-     */
-    static public function getDelay(): int;
-
-
-
-
-
-
-
-}

+ 0 - 12
app/Module/LCache/ItemInterface.php

@@ -1,12 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-use Psr\Cache\CacheItemInterface;
-
-interface ItemInterface
-{
-    public function get();
-
-    public function update($data,$ttl=60):CacheItemInterface;
-}

+ 0 - 104
app/Module/LCache/QueueCache.php

@@ -1,104 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-use UCore\Helper\Logger;
-
-use function Laravel\Prompts\select;
-
-trait QueueCache
-{
-
-    public function run(): bool
-    {
-        $indexs = static::getRequiredArgIndex();
-        foreach ($indexs as $index) {
-            if (!isset($this->arg[$index])) {
-                Logger::error("Cache-error", [ $this->arg, $indexs, $index ]);
-
-                return false;
-            }
-        }
-//        dump($this->arg);
-        $key  = self::getKey($this->arg);
-        $key2 = $key . '_PD';// 防止重复执行
-        $pd   = SCache::get($key2);
-        if ($pd->isHit()) {
-            // 重复执行
-            return true;
-        }
-        $d = static::getNewData($this->arg);
-        self::updateData($key, $d);
-
-        return true;
-    }
-
-    public static function updateData($key, $d)
-    {
-        $key2 = $key . '_PD';// 防止重复执行
-//        dump($key,$d);
-        $data = new CacheItem($key, $d, 0, static::getTtl());
-        SCache::put($key, $data, null);
-        SCache::put($key2, 1, static::getPreventDuplication());
-
-        return $data;
-    }
-
-    /**
-     * 更新数据,同步,强制
-     *
-     * @param $arg
-     * @return void
-     */
-    static public function updateSync($parameter)
-    {
-        $key  = static::getKey($parameter);
-        $d    = static::getNewData($parameter);
-        $data = new CacheItem($key, $d, time(), static::getTtl());
-        SCache::put($key, $data, null);
-
-        return $key;
-    }
-
-
-    /**
-     * 获取缓存key
-     *
-     * @param $parameter
-     * @return string
-     */
-    static protected function getKey($parameter)
-    {
-        return md5(serialize([ static::class, $parameter ]));
-    }
-
-
-    /**
-     * 获取数据
-     *
-     * @return mixed|null
-     */
-    static public function getData($parameter = [], $force = false)
-    {
-        $key = static::getKey($parameter);
-
-
-        $item = SCache::get($key);
-//        var_dump($key);
-        // 3ee2d37c91b4abcf418bd24c0c0e1dea
-        // 3ee2d37c91b4abcf418bd24c0c0e1dea
-//        dump($key,$parameter);
-
-        if (!$item->isHit()) {
-            $force = true;
-        }
-        if ($force) {
-            $d    = static::getNewData($parameter);
-            $item = self::updateData($key, $d);
-        }
-
-        return $item->getValue();
-    }
-
-
-}

+ 0 - 58
app/Module/LCache/QueueJob.php

@@ -1,58 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-
-use UCore\Helper\Logger;
-
-abstract class QueueJob extends \UCore\Queue\QueueJob implements QueueJobInterface
-{
-
-    use QueueCache;
-
-    public function __construct(public array $arg = [])
-    {
-        Logger::info('队列任务创建', [
-            'job_class' => static::class,
-            'args' => $arg
-        ]);
-    }
-
-
-
-
-    public function payload()
-    {
-        Logger::info('队列任务准备执行', [
-            'job_class' => static::class,
-            'payload' => $this->arg
-        ]);
-        return $this->arg;
-    }
-
-
-    /**
-     * 使用任务更新
-     *
-     * @param $arg
-     * @return void
-     */
-    static protected function jobUpdate($parameter)
-    {
-        Logger::info('队列任务更新', [
-            'job_class' => static::class,
-            'parameter' => $parameter
-        ]);
-
-        $queue = env('CACHE_QUEUE', null);
-        if ($queue) {
-            self::dispatch($parameter)->delay(2)->onQueue($queue);
-        } else {
-            self::dispatch($parameter)->delay(2);
-        }
-    }
-
-
-
-
-}

+ 0 - 37
app/Module/LCache/QueueJobInterface.php

@@ -1,37 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-interface QueueJobInterface
-{
-
-    /**
-     * 获取数据
-     *
-     * @param $parameter
-     * @return mixed
-     */
-    static public function getNewData(array $parameter = []);
-
-    /**
-     * 缓存时间
-     *
-     * @return int
-     */
-    static public function getTtl(): int;
-
-    /**
-     * 缓存时间,防止重复执行
-     *
-     * @return int
-     */
-    static public function getPreventDuplication(): int;
-
-    /**
-     * 获取必填参数索引
-     * @return array
-     */
-    static public function getRequiredArgIndex(): array;
-
-
-}

+ 0 - 1
app/Module/LCache/README.md

@@ -1 +0,0 @@
-

+ 0 - 114
app/Module/LCache/SCache.php

@@ -1,114 +0,0 @@
-<?php
-
-namespace App\Module\LCache;
-
-
-use UCore\Helper\CacheTag;
-use UCore\Helper\Logger;
-
-/**
- * symfony/cache使用laravel的配置的封装
- *
- *
- */
-class SCache
-{
-
-
-    /**
-     * 设置数据
-     *
-     * @param $key
-     * @param $data
-     * @param $exp
-     * @param $tags
-     * @return void
-     */
-    static public function put($key, $data, $exp = 60, $tags = [])
-    {
-        $key = self::getKey($key);
-        if ($data instanceof CacheItem) {
-            $d2 = $data;
-        } else {
-            $d2 = new CacheItem($key, $data, 0, $exp);
-        }
-
-        \Illuminate\Support\Facades\Cache::put($key, $d2, $exp);
-        if ($tags) {
-            CacheTag::key_tags($key, $tags, null);
-        }
-
-        return $d2;
-
-    }
-
-    /**
-     * 获取数据
-     *
-     * @param $key
-     * @param $default
-     * @return CacheItem
-     */
-    static public function get($key, $default = null)
-    {
-
-        $key = self::getKey($key);
-        Logger::debug("Cache-get" . $key);
-        $res = \Illuminate\Support\Facades\Cache::get($key, $default);
-        if ($res instanceof CacheItem) {
-            return $res;
-        }
-        $res = new CacheItem($key, $default, 0);
-        $res->setHit(false)->expiresAfter(-1);
-        return $res;
-    }
-
-
-    /**
-     * 获取数据
-     * @param $key
-     * @param $default
-     * @return mixed|null
-     */
-    static public function getValue($key, $default = null)
-    {
-        $item = self::get($key, $default);
-
-        return $item->getValue();
-    }
-
-    /**
-     * has数据
-     *
-     * @param $key
-     * @return bool
-     */
-    static public function has($key)
-    {
-        $key = self::getKey($key);
-
-        return \Illuminate\Support\Facades\Cache::has($key);
-    }
-
-    static public function getTags($key)
-    {
-        $key = self::getKey($key);
-
-    }
-
-    /**
-     * 获取键名
-     *
-     * @param $data
-     * @return string
-     */
-    static public function getKey($data)
-    {
-        if(is_string($data)){
-            return $data;
-        }
-        return md5(serialize($data));
-    }
-
-
-}

+ 376 - 0
app/Module/ModulePlanning.md

@@ -0,0 +1,376 @@
+# 开心农场系统模块规划
+
+根据系统需求和现有模块分析,以下是缺失模块的规划建议。
+
+## 1. 农场模块 (Farm)
+
+### 功能概述
+农场模块是开心农场系统的核心,负责管理用户的农场、土地、作物种植和收获等核心玩法。
+
+### 目录结构
+```
+app/Module/Farm/
+├── AdminControllers/        # 后台管理控制器
+│   ├── Helper/              # 控制器辅助类
+│   ├── Actions/             # 控制器动作类
+│   └── LazyRenderable/      # 懒加载渲染类
+├── Commands/                # 命令行工具
+├── Casts/                   # 自定义类型转换器
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Exceptions/              # 异常类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **FarmUser** - 用户农场信息
+2. **FarmLand** - 农场土地信息
+3. **FarmCrop** - 农场作物信息
+4. **FarmDisaster** - 农场灾害记录
+5. **FarmHarvestLog** - 收获记录
+6. **FarmLevelConfig** - 农场等级配置
+
+### 主要功能
+- 土地管理(普通、红土、黑土、特殊土地)
+- 作物种植与生长周期管理
+- 灾害系统(干旱、虫害、杂草)
+- 收获系统
+- 农场等级系统
+- 土地升级系统
+
+## 2. 房屋模块 (House)
+
+### 功能概述
+房屋模块负责管理用户的房屋等级、升级和相关属性,影响土地产出和其他游戏机制。
+
+### 目录结构
+```
+app/Module/House/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **HouseUser** - 用户房屋信息
+2. **HouseLevelConfig** - 房屋等级配置
+3. **HouseUpgradeLog** - 房屋升级记录
+4. **HouseUpgradeMaterial** - 升级所需材料配置
+
+### 主要功能
+- 房屋等级管理(共12级)
+- 房屋升级系统
+- 房屋降级机制
+- 房屋对土地产出的影响计算
+
+## 3. 种子模块 (Seed)
+
+### 功能概述
+种子模块负责管理游戏中的各类种子,包括普通种子、神秘种子和巨化种子等。
+
+### 目录结构
+```
+app/Module/Seed/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **SeedBase** - 种子基础信息
+2. **SeedCategory** - 种子分类
+3. **SeedGrowthConfig** - 种子生长配置
+4. **SeedUser** - 用户种子关联
+5. **SeedMysteryConfig** - 神秘种子配置
+
+### 主要功能
+- 种子类型管理(普通、神秘、巨化)
+- 种子生长周期配置
+- 种子产量计算
+- 神秘种子随机产出逻辑
+
+## 4. 团队模块 (Team)
+
+### 功能概述
+团队模块负责管理用户的推荐关系、团队结构和相关奖励机制。
+
+### 目录结构
+```
+app/Module/Team/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **TeamUser** - 用户团队信息
+2. **TeamRelation** - 团队关系表
+3. **TeamReward** - 团队奖励记录
+4. **TeamLevelConfig** - 团队等级配置
+5. **TeamAchievement** - 团队成就记录
+
+### 主要功能
+- 推荐关系管理
+- 团队结构维护
+- 直推/间推奖励计算
+- 达人等级系统
+- 团队奖励分成机制
+
+## 5. 兑换中心模块 (Exchange)
+
+### 功能概述
+兑换中心模块负责管理游戏中的物品兑换、礼包系统和相关功能。
+
+### 目录结构
+```
+app/Module/Exchange/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **ExchangeItem** - 可兑换物品配置
+2. **ExchangeLog** - 兑换记录
+3. **ExchangePackage** - 礼包配置
+4. **ExchangePackageItem** - 礼包内容配置
+5. **ExchangePackageLog** - 礼包领取记录
+
+### 主要功能
+- 物品兑换系统
+- 礼包系统(推荐礼包、补偿礼包、新人礼包等)
+- 自定义奖励池配置
+- 奖励发放方式(全部/随机)
+
+## 6. 争霸赛模块 (Battle)
+
+### 功能概述
+争霸赛模块负责管理松狮争霸赛相关的功能,包括赛季、队伍、战斗等。
+
+### 目录结构
+```
+app/Module/Battle/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **BattleSeason** - 争霸赛赛季
+2. **BattleTeam** - 争霸赛队伍
+3. **BattleTeamMember** - 队伍成员
+4. **BattleBoss** - Boss配置
+5. **BattleLog** - 战斗记录
+6. **BattleReward** - 奖励配置
+
+### 主要功能
+- 赛季管理
+- 队伍组建与管理
+- Boss战斗机制
+- 奖池分配机制
+- 战斗记录与排名
+
+## 7. 安全模块 (Security)
+
+### 功能概述
+安全模块负责管理系统的安全机制,包括防爆破、反作弊、安全验证等功能。
+
+### 目录结构
+```
+app/Module/Security/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **SecurityLog** - 安全日志
+2. **SecurityBlock** - 封禁记录
+3. **SecurityVerification** - 验证记录
+4. **SecurityConfig** - 安全配置
+
+### 主要功能
+- 登录错误限制
+- 验证码错误限制
+- 前端版本号校验
+- 非法请求标记
+- 非APP端登录检测
+- 累计标记机制
+
+## 8. 用户模块 (User)
+
+### 功能概述
+用户模块负责管理用户的基本信息、认证、状态等功能。
+
+### 目录结构
+```
+app/Module/User/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **User** - 用户基本信息
+2. **UserAuth** - 用户认证信息
+3. **UserStatus** - 用户状态
+4. **UserProfile** - 用户详细资料
+5. **UserLog** - 用户操作日志
+
+### 主要功能
+- 用户注册与登录
+- 实名认证
+- 密码管理
+- 用户状态管理(冻结、解冻等)
+- 用户日志记录
+
+## 9. 任务模块 (Task)
+
+### 功能概述
+任务模块负责管理游戏中的各类任务,包括日常任务、成就任务等。
+
+### 目录结构
+```
+app/Module/Task/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **TaskBase** - 任务基础信息
+2. **TaskCategory** - 任务分类
+3. **TaskCondition** - 任务条件
+4. **TaskReward** - 任务奖励
+5. **TaskUser** - 用户任务进度
+6. **TaskLog** - 任务完成记录
+
+### 主要功能
+- 任务类型管理
+- 任务条件配置
+- 任务奖励配置
+- 任务进度追踪
+- 任务完成与奖励发放
+
+## 10. 商店模块 (Shop)
+
+### 功能概述
+商店模块负责管理游戏内的商店系统,包括商品、购买、支付等功能。
+
+### 目录结构
+```
+app/Module/Shop/
+├── AdminControllers/        # 后台管理控制器
+├── Commands/                # 命令行工具
+├── Databases/               # 数据库相关文件
+│   └── createsql/           # 表创建SQL文件
+├── Enums/                   # 枚举类型定义
+├── Events/                  # 事件类
+├── Logics/                  # 业务逻辑类
+├── Models/                  # 数据模型
+├── Providers/               # 服务提供者
+├── Repositorys/             # 数据仓库
+├── Services/                # 服务类
+└── README.md                # 模块文档
+```
+
+### 核心数据模型
+1. **ShopItem** - 商店商品
+2. **ShopCategory** - 商品分类
+3. **ShopOrder** - 购买订单
+4. **ShopDiscount** - 折扣配置
+5. **ShopLimitConfig** - 限购配置
+6. **ShopPayment** - 支付记录
+
+### 主要功能
+- 商品管理
+- 商品分类
+- 限购机制
+- 折扣系统
+- 订单处理
+- 支付集成
+
+## 总结
+
+以上规划的10个模块涵盖了开心农场系统的主要功能需求。每个模块都遵循相同的目录结构规范,保持了代码组织的一致性。模块之间通过事件系统和服务接口进行通信,保持了低耦合高内聚的设计原则。
+
+在实际开发中,可以根据业务需求的优先级和资源情况,分阶段实施这些模块的开发。建议先完成核心的农场、种子、物品和用户模块,然后再逐步实现其他功能模块。

+ 2 - 0
app/Module/Pet/README.md

@@ -1,5 +1,7 @@
 # 宠物模块开发文档
 
+> 宠物模块,宠物属性、技能、战斗、宠物争霸赛
+
 ## 1. 宠物系统功能
 ### 1.1 宠物属性系统
 - **品阶体系**:4个品阶(FIRST 60%/SECOND 25%/THIRD 10%/FOURTH 5%)