| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace App\Module\AppGame\Handler\House;
- use App\Module\AppGame\Handler\BaseHandler;
- use App\Module\Farm\Services\HouseService;
- use Google\Protobuf\Internal\Message;
- use Illuminate\Support\Facades\Log;
- use Uraus\Kku\Request\RequestHouseUp;
- use Uraus\Kku\Response\ResponseHouseUp;
- use UCore\Exception\LogicException;
- /**
- * 处理房屋升级请求
- */
- class UpHandler extends BaseHandler
- {
- /**
- * 是否需要登录
- *
- * @var bool
- */
- protected bool $need_login = true;
- /**
- * 处理房屋升级请求
- *
- * @param RequestHouseUp $data 房屋升级请求数据
- * @return ResponseHouseUp 房屋升级响应
- */
- public function handle(Message $data): Message
- {
- // 创建响应对象
- $response = new ResponseHouseUp();
- $userId = $this->user_id;
- // 检查是否满足升级条件
- HouseService::checkUpgradeRequirements($userId);
- // 执行房屋升级
- HouseService::executeHouseUpgrade($userId);
- // $response->se
- return $response;
- }
- }
|