|
@@ -3,12 +3,12 @@
|
|
|
namespace app\controller\api;
|
|
namespace app\controller\api;
|
|
|
|
|
|
|
|
use app\extra\basic\Base;
|
|
use app\extra\basic\Base;
|
|
|
|
|
+use app\extra\dyLife\Token;
|
|
|
use app\extra\dyMini\Relation;
|
|
use app\extra\dyMini\Relation;
|
|
|
use app\middleware\AuthMiddleware;
|
|
use app\middleware\AuthMiddleware;
|
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
use LinFly\Annotation\Attributes\Route\Controller;
|
|
|
use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
use LinFly\Annotation\Attributes\Route\GetMapping;
|
|
|
-use LinFly\Annotation\Attributes\Route\Middleware;
|
|
|
|
|
-use LinFly\Annotation\Attributes\Route\PostMapping;
|
|
|
|
|
|
|
+use LinFly\Annotation\Attributes\Route\RequestMapping;
|
|
|
use support\Request;
|
|
use support\Request;
|
|
|
use support\Response;
|
|
use support\Response;
|
|
|
|
|
|
|
@@ -22,19 +22,34 @@ class Solution extends Base
|
|
|
{
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
|
- #[PostMapping("notify")]
|
|
|
|
|
|
|
+ #[RequestMapping(path: "notify")]
|
|
|
public function getSolutionData(Request $request): Response
|
|
public function getSolutionData(Request $request): Response
|
|
|
{
|
|
{
|
|
|
try {
|
|
try {
|
|
|
$data = $request->all();
|
|
$data = $request->all();
|
|
|
echo getDateFull()."===扩展回调\n";
|
|
echo getDateFull()."===扩展回调\n";
|
|
|
print_r($data);
|
|
print_r($data);
|
|
|
|
|
+ print_r($request->rawBody());
|
|
|
return json(['err_no' => 0,"err_tips" => "success"]);
|
|
return json(['err_no' => 0,"err_tips" => "success"]);
|
|
|
} catch (\Throwable $throwable) {
|
|
} catch (\Throwable $throwable) {
|
|
|
return error($throwable->getMessage());
|
|
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")]
|
|
#[GetMapping("test")]
|
|
|
public function setTest()
|
|
public function setTest()
|