| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253 |
- <?php
- namespace app\controller\admin;
- use app\extra\basic\Base;
- use app\extra\service\saas\OrderLogService;
- use app\extra\service\saas\OrderService;
- use app\middleware\AuthMiddleware;
- use DI\Attribute\Inject;
- use LinFly\Annotation\Route\Controller;
- use LinFly\Annotation\Route\Route;
- use support\Request;
- use support\Response;
- use Webman\Annotation\Middleware;
- #[Controller(prefix: "/api/order"),Middleware(AuthMiddleware::class)]
- class Order extends Base
- {
- #[Inject]
- protected OrderService $service;
- #[Inject]
- protected OrderLogService $log;
- #[Route(path: "list",methods: "get")]
- public function getOrderList(Request $request): Response
- {
- try {
- $param = $request->get();
- $list = $this->service->getList($param);
- return successTrans("success.data",pageFormat($list),200);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- #[Route(path: "log",methods: "get")]
- public function getOrderLog(Request $request): Response
- {
- try {
- $param = $request->get();
- $list = $this->log->getList($param);
- return successTrans("success.data",$list,200);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- }
|