| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- <?php
- namespace app\controller\api;
- use app\extra\basic\Base;
- use app\extra\dyLife\Token;
- use app\extra\dyMini\Relation;
- use app\middleware\AuthMiddleware;
- use LinFly\Annotation\Attributes\Route\Controller;
- use LinFly\Annotation\Attributes\Route\GetMapping;
- use LinFly\Annotation\Attributes\Route\RequestMapping;
- use support\Request;
- use support\Response;
- /**
- * 解决方案回传
- */
- #[Controller("/solution")]
- class Solution extends Base
- {
- #[RequestMapping(path: "notify")]
- public function getSolutionData(Request $request): Response
- {
- try {
- $data = $request->all();
- echo getDateFull()."===扩展回调\n";
- print_r($data);
- print_r($request->rawBody());
- return json(['err_no' => 0,"err_tips" => "success"]);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- #[GetMapping("token")]
- public function setTestToken(Request $request): Response
- {
- try {
- $param = $this->_valid([
- "code.require" => ""
- ]);
- if (!is_array($param)) return error($param);
- $data = (new Token)->config($this->getDyConfig())->token()->getAccessTokenUser($param['code']);
- return success("ok",$data);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- #[GetMapping("test")]
- public function setTest()
- {
- try {
- $data = (new Relation)->config($this->getDyConfig())->token()->createOrderFirst(['1865253598118939']);
- return success("ok",$data);
- } catch (\Throwable $throwable) {
- return error($throwable->getMessage());
- }
- }
- }
|