feat: wire match live backend api

This commit is contained in:
hajimi
2026-06-21 11:52:02 +08:00
parent 8d528ba5fe
commit 80e0e6a8a6
7 changed files with 329 additions and 1 deletions
@@ -0,0 +1,53 @@
<?php
namespace app\adminapi\controller\match;
use app\adminapi\controller\BaseAdminController;
use app\adminapi\lists\match\MatchLiveLists;
use app\adminapi\logic\match\MatchLiveLogic;
use app\adminapi\validate\match\MatchLiveValidate;
class MatchLiveController extends BaseAdminController
{
public function lists()
{
return $this->dataLists(new MatchLiveLists());
}
public function detail()
{
$params = (new MatchLiveValidate())->goCheck('detail');
$result = MatchLiveLogic::detail($params);
return $this->data($result);
}
public function add()
{
$params = (new MatchLiveValidate())->post()->goCheck('add');
$result = MatchLiveLogic::add($params);
if (true === $result) {
return $this->success('添加成功', [], 1, 1);
}
return $this->fail(MatchLiveLogic::getError());
}
public function edit()
{
$params = (new MatchLiveValidate())->post()->goCheck('edit');
$result = MatchLiveLogic::edit($params);
if (true === $result) {
return $this->success('编辑成功', [], 1, 1);
}
return $this->fail(MatchLiveLogic::getError());
}
public function delete()
{
$params = (new MatchLiveValidate())->post()->goCheck('delete');
$result = MatchLiveLogic::delete($params);
if (true === $result) {
return $this->success('删除成功', [], 1, 1);
}
return $this->fail(MatchLiveLogic::getError());
}
}