| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\controller\admin;
- use app\extra\basic\Base;
- use app\extra\service\blue\ExpertService;
- use app\middleware\AuthMiddleware;
- use app\model\blue\BlueExpert;
- use DI\Attribute\Inject;
- use LinFly\Annotation\Route\Controller;
- use LinFly\Annotation\Route\Middleware;
- use LinFly\Annotation\Route\Route;
- use support\Request;
- use support\Response;
- /**
- * 达人
- */
- #[Controller(prefix: "/api/expert"),Middleware(AuthMiddleware::class)]
- class Expert extends Base
- {
- #[Inject]
- protected BlueExpert $model;
- #[Inject]
- protected ExpertService $service;
- /**
- *
- * @param Request $request
- * @return Response
- */
- #[Route(path: "list",methods: "get")]
- public function getDataList(Request $request): Response
- {
- try {
- $param = $request->all();
- $list = $this->service->getList($param);
- return successTrans("success.data",pageFormat($list),200);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- }
|