| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\controller\mini;
- use app\extra\basic\Base;
- use LinFly\Annotation\Route\Controller;
- use LinFly\Annotation\Route\Route;
- use support\Request;
- use support\Response;
- #[Controller(prefix: "/notify")]
- class Notify extends Base
- {
- /**
- * 核销工具解决方案-spi
- * @param Request $request
- * @return Response
- */
- #[Route(path: "mini",methods: "post")]
- public function getSpiData(Request $request): Response
- {
- try {
- $param = $request->post();
- echo getDateFull()."=={$param['type']}==\n";
- print_r($param);
- return json([
- "err_no" => 0,
- "err_tips" => "success"
- ]);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- /**
- * 核销工具解决方案-扩展点-spi
- * @param Request $request
- * @return Response
- */
- #[Route(path: "expand",methods: "post")]
- public function getExpandData(Request $request): Response
- {
- try {
- $param = $request->post();
- switch ($param['type'])
- {
- case "pre_create_order": // 预下单回调
- break;
- case "pre_create_refund": // 退款审核回调
- break;
- }
- echo getDateFull()."=={$param['type']}==\n";
- print_r($param);
- return json([
- "err_no" => 0,
- "err_tips" => "success"
- ]);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- }
|