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

refactor(farm): 重构农场日志处理逻辑

- 将日志处理逻辑从 Repository 移至 Logic 层
- 新增 HarvestLogLogic、TeamProfitLogic 和 UpgradeLogLogic 类
- 更新 CleanExpiredLogsCommand 中的日志处理调用
- 移除 FarmHarvestLogRepository、FarmTeamProfitRepository 和 FarmUpgradeLogRepository 中的冗余方法
notfff преди 8 месеца
родител
ревизия
bf14d1423e

+ 1 - 0
app/Module/AppGame/Handler/User/DataHandler.php

@@ -153,6 +153,7 @@ class DataHandler extends BaseHandler
         $lsc   = [];
         $coins = AccountService::list4user($this->user_id);
         foreach ($coins as $coin) {
+//            dump($coin->fund_id);
             $dC = new DataCoin();
             $dC->setType($coin->fund_id);
             $dC->setQuantity($coin->balance);

+ 1 - 0
app/Module/AppGame/HttpControllers/ProtobufController.php

@@ -64,6 +64,7 @@ class ProtobufController extends Controller
                 $request->mergeFromJsonString(json_encode($jsonData));
             } else {
                 // Protobuf 格式请求
+                Logger::debug('base64: '.base64_encode($rawData));
                 $request->mergeFromString($rawData);
             }
 

+ 17 - 17
app/Module/Farm/Commands/CleanExpiredLogsCommand.php

@@ -2,9 +2,9 @@
 
 namespace App\Module\Farm\Commands;
 
-use App\Module\Farm\Repositories\FarmHarvestLogRepository;
-use App\Module\Farm\Repositories\FarmTeamProfitRepository;
-use App\Module\Farm\Repositories\FarmUpgradeLogRepository;
+use App\Module\Farm\Logics\HarvestLogLogic;
+use App\Module\Farm\Logics\TeamProfitLogic;
+use App\Module\Farm\Logics\UpgradeLogLogic;
 use Illuminate\Console\Command;
 use Illuminate\Support\Facades\Log;
 
@@ -36,26 +36,26 @@ class CleanExpiredLogsCommand extends Command
     {
         $days = $this->option('days');
         $this->info("开始清理 {$days} 天前的日志记录...");
-        
+
         try {
             // 清理收获记录
-            $harvestLogRepository = new FarmHarvestLogRepository();
-            $harvestCount = $harvestLogRepository->cleanupOldLogs($days);
+            $harvestLogLogic = new HarvestLogLogic();
+            $harvestCount = $harvestLogLogic->cleanupOldLogs($days);
             $this->info("清理了 {$harvestCount} 条收获记录");
-            
+
             // 清理升级记录
-            $upgradeLogRepository = new FarmUpgradeLogRepository();
-            $upgradeCount = $upgradeLogRepository->cleanupOldLogs($days);
+            $upgradeLogLogic = new UpgradeLogLogic();
+            $upgradeCount = $upgradeLogLogic->cleanupOldLogs($days);
             $this->info("清理了 {$upgradeCount} 条升级记录");
-            
+
             // 清理团队收益记录
-            $teamProfitRepository = new FarmTeamProfitRepository();
-            $profitCount = $teamProfitRepository->cleanupOldLogs($days);
+            $teamProfitLogic = new TeamProfitLogic();
+            $profitCount = $teamProfitLogic->cleanupOldLogs($days);
             $this->info("清理了 {$profitCount} 条团队收益记录");
-            
+
             $totalCount = $harvestCount + $upgradeCount + $profitCount;
             $this->info("共清理了 {$totalCount} 条日志记录");
-            
+
             Log::info('日志清理成功', [
                 'days' => $days,
                 'harvest_count' => $harvestCount,
@@ -63,17 +63,17 @@ class CleanExpiredLogsCommand extends Command
                 'profit_count' => $profitCount,
                 'total_count' => $totalCount
             ]);
-            
+
             return 0;
         } catch (\Exception $e) {
             $this->error('日志清理失败: ' . $e->getMessage());
-            
+
             Log::error('日志清理失败', [
                 'days' => $days,
                 'error' => $e->getMessage(),
                 'trace' => $e->getTraceAsString()
             ]);
-            
+
             return 1;
         }
     }

+ 140 - 0
app/Module/Farm/Logics/HarvestLogLogic.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace App\Module\Farm\Logics;
+
+use App\Module\Farm\Models\FarmHarvestLog;
+use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Support\Facades\Log;
+
+/**
+ * 收获记录逻辑
+ *
+ * 提供收获记录数据的业务逻辑处理。
+ */
+class HarvestLogLogic
+{
+    /**
+     * 获取用户的收获记录
+     *
+     * @param int $userId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findByUserId(int $userId, int $limit = 100): Collection
+    {
+        try {
+            return FarmHarvestLog::where('user_id', $userId)
+                ->orderByDesc('harvest_time')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户收获记录失败', [
+                'user_id' => $userId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取指定种子的收获记录
+     *
+     * @param int $seedId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findBySeedId(int $seedId, int $limit = 100): Collection
+    {
+        try {
+            return FarmHarvestLog::where('seed_id', $seedId)
+                ->orderByDesc('harvest_time')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取种子收获记录失败', [
+                'seed_id' => $seedId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取指定时间段内的收获记录
+     *
+     * @param string $startTime
+     * @param string $endTime
+     * @return Collection
+     */
+    public function findByTimeRange(string $startTime, string $endTime): Collection
+    {
+        try {
+            return FarmHarvestLog::whereBetween('harvest_time', [$startTime, $endTime])
+                ->orderByDesc('harvest_time')
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取时间段收获记录失败', [
+                'start_time' => $startTime,
+                'end_time' => $endTime,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取用户指定时间段内的收获记录
+     *
+     * @param int $userId
+     * @param string $startTime
+     * @param string $endTime
+     * @return Collection
+     */
+    public function findByUserIdAndTimeRange(int $userId, string $startTime, string $endTime): Collection
+    {
+        try {
+            return FarmHarvestLog::where('user_id', $userId)
+                ->whereBetween('harvest_time', [$startTime, $endTime])
+                ->orderByDesc('harvest_time')
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户时间段收获记录失败', [
+                'user_id' => $userId,
+                'start_time' => $startTime,
+                'end_time' => $endTime,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 清理过期的收获记录
+     *
+     * @param int $days 保留天数
+     * @return int
+     */
+    public function cleanupOldLogs(int $days = 90): int
+    {
+        try {
+            $date = now()->subDays($days);
+            return FarmHarvestLog::where('harvest_time', '<', $date)->delete();
+        } catch (\Exception $e) {
+            Log::error('清理过期收获记录失败', [
+                'days' => $days,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return 0;
+        }
+    }
+}

+ 163 - 0
app/Module/Farm/Logics/TeamProfitLogic.php

@@ -0,0 +1,163 @@
+<?php
+
+namespace App\Module\Farm\Logics;
+
+use App\Module\Farm\Models\FarmTeamProfit;
+use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Support\Facades\Log;
+
+/**
+ * 团队收益记录逻辑
+ *
+ * 提供团队收益记录数据的业务逻辑处理。
+ */
+class TeamProfitLogic
+{
+    /**
+     * 获取用户的团队收益记录
+     *
+     * @param int $userId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findByUserId(int $userId, int $limit = 100): Collection
+    {
+        try {
+            return FarmTeamProfit::where('user_id', $userId)
+                ->orderByDesc('created_at')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户团队收益记录失败', [
+                'user_id' => $userId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取团队成员产生的收益记录
+     *
+     * @param int $teamMemberId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findByTeamMemberId(int $teamMemberId, int $limit = 100): Collection
+    {
+        try {
+            return FarmTeamProfit::where('team_member_id', $teamMemberId)
+                ->orderByDesc('created_at')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取团队成员收益记录失败', [
+                'team_member_id' => $teamMemberId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取指定收获记录产生的团队收益
+     *
+     * @param int $harvestId
+     * @return Collection
+     */
+    public function findByHarvestId(int $harvestId): Collection
+    {
+        try {
+            return FarmTeamProfit::where('harvest_id', $harvestId)
+                ->orderByDesc('created_at')
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取收获记录团队收益失败', [
+                'harvest_id' => $harvestId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取指定时间段内的团队收益记录
+     *
+     * @param string $startTime
+     * @param string $endTime
+     * @return Collection
+     */
+    public function findByTimeRange(string $startTime, string $endTime): Collection
+    {
+        try {
+            return FarmTeamProfit::whereBetween('created_at', [$startTime, $endTime])
+                ->orderByDesc('created_at')
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取时间段团队收益记录失败', [
+                'start_time' => $startTime,
+                'end_time' => $endTime,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取用户指定时间段内的团队收益记录
+     *
+     * @param int $userId
+     * @param string $startTime
+     * @param string $endTime
+     * @return Collection
+     */
+    public function findByUserIdAndTimeRange(int $userId, string $startTime, string $endTime): Collection
+    {
+        try {
+            return FarmTeamProfit::where('user_id', $userId)
+                ->whereBetween('created_at', [$startTime, $endTime])
+                ->orderByDesc('created_at')
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户时间段团队收益记录失败', [
+                'user_id' => $userId,
+                'start_time' => $startTime,
+                'end_time' => $endTime,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 清理过期的团队收益记录
+     *
+     * @param int $days 保留天数
+     * @return int
+     */
+    public function cleanupOldLogs(int $days = 90): int
+    {
+        try {
+            $date = now()->subDays($days);
+            return FarmTeamProfit::where('created_at', '<', $date)->delete();
+        } catch (\Exception $e) {
+            Log::error('清理过期团队收益记录失败', [
+                'days' => $days,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return 0;
+        }
+    }
+}

+ 140 - 0
app/Module/Farm/Logics/UpgradeLogLogic.php

@@ -0,0 +1,140 @@
+<?php
+
+namespace App\Module\Farm\Logics;
+
+use App\Module\Farm\Enums\UPGRADE_TYPE;
+use App\Module\Farm\Models\FarmUpgradeLog;
+use Illuminate\Database\Eloquent\Collection;
+use Illuminate\Support\Facades\Log;
+
+/**
+ * 升级记录逻辑
+ *
+ * 提供升级记录数据的业务逻辑处理。
+ */
+class UpgradeLogLogic
+{
+    /**
+     * 获取用户的升级记录
+     *
+     * @param int $userId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findByUserId(int $userId, int $limit = 100): Collection
+    {
+        try {
+            return FarmUpgradeLog::where('user_id', $userId)
+                ->orderByDesc('upgrade_time')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户升级记录失败', [
+                'user_id' => $userId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取用户的房屋升级记录
+     *
+     * @param int $userId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findHouseUpgradesByUserId(int $userId, int $limit = 100): Collection
+    {
+        try {
+            return FarmUpgradeLog::where('user_id', $userId)
+                ->where('upgrade_type', UPGRADE_TYPE::HOUSE->value)
+                ->orderByDesc('upgrade_time')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户房屋升级记录失败', [
+                'user_id' => $userId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取用户的土地升级记录
+     *
+     * @param int $userId
+     * @param int $limit
+     * @return Collection
+     */
+    public function findLandUpgradesByUserId(int $userId, int $limit = 100): Collection
+    {
+        try {
+            return FarmUpgradeLog::where('user_id', $userId)
+                ->where('upgrade_type', UPGRADE_TYPE::LAND->value)
+                ->orderByDesc('upgrade_time')
+                ->limit($limit)
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取用户土地升级记录失败', [
+                'user_id' => $userId,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 获取指定时间段内的升级记录
+     *
+     * @param string $startTime
+     * @param string $endTime
+     * @return Collection
+     */
+    public function findByTimeRange(string $startTime, string $endTime): Collection
+    {
+        try {
+            return FarmUpgradeLog::whereBetween('upgrade_time', [$startTime, $endTime])
+                ->orderByDesc('upgrade_time')
+                ->get();
+        } catch (\Exception $e) {
+            Log::error('获取时间段升级记录失败', [
+                'start_time' => $startTime,
+                'end_time' => $endTime,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return collect();
+        }
+    }
+
+    /**
+     * 清理过期的升级记录
+     *
+     * @param int $days 保留天数
+     * @return int
+     */
+    public function cleanupOldLogs(int $days = 90): int
+    {
+        try {
+            $date = now()->subDays($days);
+            return FarmUpgradeLog::where('upgrade_time', '<', $date)->delete();
+        } catch (\Exception $e) {
+            Log::error('清理过期升级记录失败', [
+                'days' => $days,
+                'error' => $e->getMessage(),
+                'trace' => $e->getTraceAsString()
+            ]);
+            
+            return 0;
+        }
+    }
+}

+ 0 - 73
app/Module/Farm/Repositories/FarmHarvestLogRepository.php

@@ -4,7 +4,6 @@ namespace App\Module\Farm\Repositories;
 
 use App\Module\Farm\Models\FarmHarvestLog;
 use Dcat\Admin\Repositories\EloquentRepository;
-use Illuminate\Database\Eloquent\Collection;
 
 /**
  * 收获记录仓库
@@ -20,76 +19,4 @@ class FarmHarvestLogRepository extends EloquentRepository
      * @var string
      */
     protected $eloquentClass = FarmHarvestLog::class;
-
-    /**
-     * 获取用户的收获记录
-     *
-     * @param int $userId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findByUserId(int $userId, int $limit = 100): Collection
-    {
-        return FarmHarvestLog::where('user_id', $userId)
-            ->orderByDesc('harvest_time')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取指定种子的收获记录
-     *
-     * @param int $seedId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findBySeedId(int $seedId, int $limit = 100): Collection
-    {
-        return FarmHarvestLog::where('seed_id', $seedId)
-            ->orderByDesc('harvest_time')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取指定时间段内的收获记录
-     *
-     * @param string $startTime
-     * @param string $endTime
-     * @return Collection
-     */
-    public function findByTimeRange(string $startTime, string $endTime): Collection
-    {
-        return FarmHarvestLog::whereBetween('harvest_time', [$startTime, $endTime])
-            ->orderByDesc('harvest_time')
-            ->get();
-    }
-
-    /**
-     * 获取用户指定时间段内的收获记录
-     *
-     * @param int $userId
-     * @param string $startTime
-     * @param string $endTime
-     * @return Collection
-     */
-    public function findByUserIdAndTimeRange(int $userId, string $startTime, string $endTime): Collection
-    {
-        return FarmHarvestLog::where('user_id', $userId)
-            ->whereBetween('harvest_time', [$startTime, $endTime])
-            ->orderByDesc('harvest_time')
-            ->get();
-    }
-
-    /**
-     * 清理过期的收获记录
-     *
-     * @param int $days 保留天数
-     * @return int
-     */
-    public function cleanupOldLogs(int $days = 90): int
-    {
-        $date = now()->subDays($days);
-        return FarmHarvestLog::where('harvest_time', '<', $date)->delete();
-    }
 }

+ 0 - 86
app/Module/Farm/Repositories/FarmTeamProfitRepository.php

@@ -4,7 +4,6 @@ namespace App\Module\Farm\Repositories;
 
 use App\Module\Farm\Models\FarmTeamProfit;
 use Dcat\Admin\Repositories\EloquentRepository;
-use Illuminate\Database\Eloquent\Collection;
 
 /**
  * 团队收益记录仓库
@@ -20,89 +19,4 @@ class FarmTeamProfitRepository extends EloquentRepository
      * @var string
      */
     protected $eloquentClass = FarmTeamProfit::class;
-
-    /**
-     * 获取用户的团队收益记录
-     *
-     * @param int $userId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findByUserId(int $userId, int $limit = 100): Collection
-    {
-        return FarmTeamProfit::where('user_id', $userId)
-            ->orderByDesc('created_at')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取团队成员产生的收益记录
-     *
-     * @param int $teamMemberId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findByTeamMemberId(int $teamMemberId, int $limit = 100): Collection
-    {
-        return FarmTeamProfit::where('team_member_id', $teamMemberId)
-            ->orderByDesc('created_at')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取指定收获记录产生的团队收益
-     *
-     * @param int $harvestId
-     * @return Collection
-     */
-    public function findByHarvestId(int $harvestId): Collection
-    {
-        return FarmTeamProfit::where('harvest_id', $harvestId)
-            ->orderByDesc('created_at')
-            ->get();
-    }
-
-    /**
-     * 获取指定时间段内的团队收益记录
-     *
-     * @param string $startTime
-     * @param string $endTime
-     * @return Collection
-     */
-    public function findByTimeRange(string $startTime, string $endTime): Collection
-    {
-        return FarmTeamProfit::whereBetween('created_at', [$startTime, $endTime])
-            ->orderByDesc('created_at')
-            ->get();
-    }
-
-    /**
-     * 获取用户指定时间段内的团队收益记录
-     *
-     * @param int $userId
-     * @param string $startTime
-     * @param string $endTime
-     * @return Collection
-     */
-    public function findByUserIdAndTimeRange(int $userId, string $startTime, string $endTime): Collection
-    {
-        return FarmTeamProfit::where('user_id', $userId)
-            ->whereBetween('created_at', [$startTime, $endTime])
-            ->orderByDesc('created_at')
-            ->get();
-    }
-
-    /**
-     * 清理过期的团队收益记录
-     *
-     * @param int $days 保留天数
-     * @return int
-     */
-    public function cleanupOldLogs(int $days = 90): int
-    {
-        $date = now()->subDays($days);
-        return FarmTeamProfit::where('created_at', '<', $date)->delete();
-    }
 }

+ 0 - 75
app/Module/Farm/Repositories/FarmUpgradeLogRepository.php

@@ -2,10 +2,8 @@
 
 namespace App\Module\Farm\Repositories;
 
-use App\Module\Farm\Enums\UPGRADE_TYPE;
 use App\Module\Farm\Models\FarmUpgradeLog;
 use Dcat\Admin\Repositories\EloquentRepository;
-use Illuminate\Database\Eloquent\Collection;
 
 /**
  * 升级记录仓库
@@ -21,77 +19,4 @@ class FarmUpgradeLogRepository extends EloquentRepository
      * @var string
      */
     protected $eloquentClass = FarmUpgradeLog::class;
-
-    /**
-     * 获取用户的升级记录
-     *
-     * @param int $userId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findByUserId(int $userId, int $limit = 100): Collection
-    {
-        return FarmUpgradeLog::where('user_id', $userId)
-            ->orderByDesc('upgrade_time')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取用户的房屋升级记录
-     *
-     * @param int $userId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findHouseUpgradesByUserId(int $userId, int $limit = 100): Collection
-    {
-        return FarmUpgradeLog::where('user_id', $userId)
-            ->where('upgrade_type', UPGRADE_TYPE::HOUSE)
-            ->orderByDesc('upgrade_time')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取用户的土地升级记录
-     *
-     * @param int $userId
-     * @param int $limit
-     * @return Collection
-     */
-    public function findLandUpgradesByUserId(int $userId, int $limit = 100): Collection
-    {
-        return FarmUpgradeLog::where('user_id', $userId)
-            ->where('upgrade_type', UPGRADE_TYPE::LAND)
-            ->orderByDesc('upgrade_time')
-            ->limit($limit)
-            ->get();
-    }
-
-    /**
-     * 获取指定时间段内的升级记录
-     *
-     * @param string $startTime
-     * @param string $endTime
-     * @return Collection
-     */
-    public function findByTimeRange(string $startTime, string $endTime): Collection
-    {
-        return FarmUpgradeLog::whereBetween('upgrade_time', [$startTime, $endTime])
-            ->orderByDesc('upgrade_time')
-            ->get();
-    }
-
-    /**
-     * 清理过期的升级记录
-     *
-     * @param int $days 保留天数
-     * @return int
-     */
-    public function cleanupOldLogs(int $days = 90): int
-    {
-        $date = now()->subDays($days);
-        return FarmUpgradeLog::where('upgrade_time', '<', $date)->delete();
-    }
 }

+ 1 - 12
tests/Unit/ExampleTest.php

@@ -15,7 +15,7 @@ class ExampleTest extends TestCase
     {
         dump(SessionApp::getSessionId());
 
-        $base64 ='qgYFCgMxMjM=';
+        $base64 ='ogYHCI2utsDtMg==';
         $b2 = base64_decode($base64);
         dump($b2);
         $resp =new  Response();
@@ -24,17 +24,6 @@ class ExampleTest extends TestCase
 
 
 
-        $login = new Response\ResponsePublicLogin();;
-        $login->setToken('111');
-        $resp = new Response();
-        $resp->setCallpath('111');
-        $resp->setMsg('你好呀');
-        $resp->setPublicLogin($login);
-        $b2 = base64_encode($resp->serializeToString());
-        dump($b2);
-        dump($resp->serializeToJsonString());
-
-
 
         $this->assertTrue(true);
     }