GameUserSkinController.php 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576
  1. <?php
  2. namespace App\Module\Game\AdminControllers;
  3. use App\Module\Game\Models\GameUserSkin;
  4. use App\Module\Game\Repositorys\GameUserSkinRepository;
  5. use Dcat\Admin\Form;
  6. use Dcat\Admin\Grid;
  7. use Dcat\Admin\Show;
  8. use UCore\DcatAdmin\AdminController;
  9. use Spatie\RouteAttributes\Attributes\Resource;
  10. /**
  11. * 用户皮肤管理控制器
  12. *
  13. * @Resource(
  14. * resource: 'game-user-skins',
  15. * names: [
  16. * 'index' => 'admin.game.user-skins.index',
  17. * 'show' => 'admin.game.user-skins.show',
  18. * 'create' => 'admin.game.user-skins.create',
  19. * 'store' => 'admin.game.user-skins.store',
  20. * 'edit' => 'admin.game.user-skins.edit',
  21. * 'update' => 'admin.game.user-skins.update',
  22. * 'destroy' => 'admin.game.user-skins.destroy'
  23. * ]
  24. * )
  25. */
  26. class GameUserSkinController extends AdminController
  27. {
  28. /**
  29. * 数据仓库
  30. *
  31. * @var GameUserSkinRepository
  32. */
  33. protected GameUserSkinRepository $repository;
  34. /**
  35. * 构造函数
  36. */
  37. public function __construct()
  38. {
  39. $this->repository = new GameUserSkinRepository();
  40. }
  41. /**
  42. * 列表页面
  43. *
  44. * @return Grid
  45. */
  46. protected function grid(): Grid
  47. {
  48. return $this->repository->grid();
  49. }
  50. /**
  51. * 详情页面
  52. *
  53. * @param mixed $id
  54. * @return Show
  55. */
  56. protected function detail($id): Show
  57. {
  58. return $this->repository->detail($id);
  59. }
  60. /**
  61. * 创建页面
  62. *
  63. * @return Form
  64. */
  65. protected function form(): Form
  66. {
  67. return $this->repository->form();
  68. }
  69. }