feat: wire match live backend api
This commit is contained in:
@@ -2,12 +2,27 @@
|
||||
|
||||
$root = dirname(__DIR__, 2);
|
||||
$servicePath = $root . '/server/app/common/service/match/MatchLiveService.php';
|
||||
$apiControllerPath = $root . '/server/app/api/controller/MatchController.php';
|
||||
$adminLogicPath = $root . '/server/app/adminapi/logic/match/MatchLogic.php';
|
||||
$backendChecks = [
|
||||
$root . '/server/app/adminapi/controller/match/MatchLiveController.php',
|
||||
$root . '/server/app/adminapi/lists/match/MatchLiveLists.php',
|
||||
$root . '/server/app/adminapi/logic/match/MatchLiveLogic.php',
|
||||
$root . '/server/app/adminapi/validate/match/MatchLiveValidate.php',
|
||||
];
|
||||
|
||||
if (!is_file($servicePath)) {
|
||||
fwrite(STDERR, "missing service file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
foreach ($backendChecks as $path) {
|
||||
if (!is_file($path)) {
|
||||
fwrite(STDERR, "missing backend file: {$path}\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
$service = file_get_contents($servicePath);
|
||||
$requiredSnippets = [
|
||||
'class MatchLiveService',
|
||||
@@ -36,6 +51,33 @@ if ($whereNullCount < 2) {
|
||||
exit(1);
|
||||
}
|
||||
|
||||
if (!is_file($apiControllerPath)) {
|
||||
fwrite(STDERR, "missing api controller file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$apiController = file_get_contents($apiControllerPath);
|
||||
foreach ([
|
||||
"'live_list'",
|
||||
'MatchLiveService::getLiveListForApi',
|
||||
] as $needle) {
|
||||
if (strpos($apiController, $needle) === false) {
|
||||
fwrite(STDERR, "missing api controller token: {$needle}\n");
|
||||
exit(1);
|
||||
}
|
||||
}
|
||||
|
||||
if (!is_file($adminLogicPath)) {
|
||||
fwrite(STDERR, "missing admin logic file\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$adminLogic = file_get_contents($adminLogicPath);
|
||||
if (strpos($adminLogic, "'live_url'") !== false) {
|
||||
fwrite(STDERR, "match admin logic still manually allows live_url\n");
|
||||
exit(1);
|
||||
}
|
||||
|
||||
$orderedOptionSnippets = [
|
||||
"['label' => 'M3U8', 'field' => 'play_url_m3u8']",
|
||||
"['label' => 'HD M3U8', 'field' => 'play_url_hd_m3u8']",
|
||||
|
||||
Reference in New Issue
Block a user