Explorar o código

refactor(appgame): 优化施肥操作请求处理

- 修改 FertilizerHandler 中的 handle 方法返回类型
notfff hai 7 meses
pai
achega
eb545e6119

+ 1 - 1
app/Module/AppGame/Handler/Land/FertilizerHandler.php

@@ -31,7 +31,7 @@ class FertilizerHandler extends BaseHandler
      * 处理施肥操作请求
      *
      * @param RequestLandFertilizer $data 施肥操作请求数据
-     * @return ResponseLandFertilizer 施肥操作响应
+     * @return Res 施肥操作响应
      */
     public function handle(Message $data): Message
     {

+ 4 - 1
app/Module/Farm/Events/CropGrowthStageChangedEvent.php

@@ -6,10 +6,11 @@ use App\Module\Farm\Models\FarmCrop;
 use Illuminate\Broadcasting\InteractsWithSockets;
 use Illuminate\Foundation\Events\Dispatchable;
 use Illuminate\Queue\SerializesModels;
+use UCore\Helper\Logger;
 
 /**
  * 作物生长阶段变更事件
- * 
+ *
  * 当作物的生长阶段发生变化时触发
  */
 class CropGrowthStageChangedEvent
@@ -55,6 +56,8 @@ class CropGrowthStageChangedEvent
      */
     public function __construct(int $userId, FarmCrop $crop, int $oldStage, int $newStage)
     {
+
+        Logger::debug('CropGrowthStageChangedEvent');
         $this->userId = $userId;
         $this->crop = $crop;
         $this->oldStage = $oldStage;

+ 1 - 1
app/Module/Farm/Services/CropService.php

@@ -112,7 +112,7 @@ class CropService
      *
      * @param int $userId
      * @param int $landId
-     * @return bool
+     * @return Res
      */
     public static function useFertilizer(int $userId, int $landId,int $crop_growth_time): Res
     {