- 在多个控制器中引入 SettlementPartyEnrichment 服务,以优化代理结算和账单的处理逻辑。 - 更新 AgentSettlementBillIndexController 和 AgentSettlementBillShowController,支持根据账单 ID 和关键字进行查询。 - 在 AgentSettlementPeriodCloseController 中添加对站点管理权限的验证,确保只有具备相应权限的管理员能够关闭账期。 - 在 AgentSettlementPeriodIndexController 中更新账期数据的返回格式,提升数据的完整性和可用性。 - 引入对相对占成比例的支持,增强代理资料的管理能力,确保数据一致性。
35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Api\V1\Player;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use App\Http\Requests\Player\PlayerAuthLoginRequest;
|
|
use App\Services\Player\PlayerNativeAuthService;
|
|
use App\Support\ApiResponse;
|
|
use App\Exceptions\PlayerAuthenticationException;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
/** POST /api/v1/player/auth/login — 代理线下玩家账号密码登录 */
|
|
final class PlayerAuthLoginController extends Controller
|
|
{
|
|
public function __invoke(PlayerAuthLoginRequest $request, PlayerNativeAuthService $auth): JsonResponse
|
|
{
|
|
try {
|
|
$data = $auth->login(
|
|
(string) $request->validated('site_code', ''),
|
|
(string) $request->validated('username'),
|
|
(string) $request->validated('password'),
|
|
);
|
|
} catch (PlayerAuthenticationException $e) {
|
|
return ApiResponse::error(
|
|
$e->getMessage(),
|
|
$e->lotteryCode,
|
|
null,
|
|
$e->httpStatus,
|
|
);
|
|
}
|
|
|
|
return ApiResponse::success($data);
|
|
}
|
|
}
|