| 123456789101112131415161718192021222324252627282930313233343536373839404142 |
- <?php
- namespace app\controller\admin;
- use app\extra\basic\Base;
- use app\middleware\AuthMiddleware;
- use LinFly\Annotation\Attributes\Route\Controller;
- use LinFly\Annotation\Attributes\Route\GetMapping;
- use LinFly\Annotation\Attributes\Route\Middleware;
- use support\Request;
- use support\Response;
- use Webman\RedisQueue\Redis;
- /**
- * POI门店
- */
- #[Controller("/api/store"),Middleware(AuthMiddleware::class)]
- class Store extends Base
- {
- /**
- * 同步POI门店
- * @param Request $request
- * @return Response
- */
- #[GetMapping('sync')]
- public function syncStore(Request $request): Response
- {
- try {
- Redis::send("sync-store",[
- "appid" => sConf("wechat.appid"),
- "secret" => sConf("wechat.secret"),
- "account" => sConf("wechat.shop_id"),
- ]);
- return success("发起成功");
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- }
|