feat : admin role unfinish

This commit is contained in:
2025-09-15 18:56:34 +08:00
parent 5ed0e2d4f5
commit b1713d8476
2 changed files with 112 additions and 2 deletions

View File

@@ -10,12 +10,69 @@ declare(strict_types=1);
namespace App\Service\Admin\AdminUser;
use App\Exception\ErrException;
use App\Repository\AdminRoleRepository;
use App\Service\Admin\BaseAdminService;
use Hyperf\Di\Annotation\Inject;
class RoleService extends BaseAdminService
{
public function handle()
/**
* @var AdminRoleRepository
*/
#[Inject]
protected AdminRoleRepository $adminRoleRepository;
/**
* @return array
*/
public function handle(): array
{
//todo Write logic
return $this->adminReturn->success(
'success',
$this->adminRoleRepository->page(
$this->getRequestData(),
$this->getCurrentPage(),
$this->getPageSize()
)
);
}
/**
* @return array
*/
public function create(): array
{
if (!$this->adminRoleRepository->create(
array_merge(
$this->getRequestData(),
['created_by' => $this->adminId]
)
)) throw new ErrException('添加失败');
return $this->adminReturn->success();
}
public function update(int $id)
{
if (!$this->adminRoleRepository->updateById(
$id,
array_merge()
));
}
public function delete()
{
}
public function getRole()
{
}
public function setRole()
{
}
}