增加event

This commit is contained in:
2022-03-04 15:21:01 +08:00
parent 4eefe95576
commit c3461e1335
4 changed files with 132 additions and 17 deletions

View File

@@ -15,6 +15,14 @@ class PetroController
{ {
try { try {
//获取动态码
$res = Petro::Check()->setParams([
'ticketNum' => '61578832475977235',
'random' => Str::random(6),
])->start();
dd($res);
// $res = Petro::Bill()->setParams([ // $res = Petro::Bill()->setParams([
// 'matchDate' => Carbon::now()->format('Ymd'), // 'matchDate' => Carbon::now()->format('Ymd'),
// 'pageNo' => 1, // 'pageNo' => 1,

View File

@@ -19,7 +19,7 @@ class TestController
public function index(Request $request) public function index(Request $request)
{ {
$str = Str::uuid();
$date = $request->date ?? date('Y-m-d'); $date = $request->date ?? date('Y-m-d');
$time = Carbon::parse($date); $time = Carbon::parse($date);

View File

@@ -5,6 +5,8 @@ namespace App\Providers;
use App\Events\ConponCallback; use App\Events\ConponCallback;
use App\Listeners\ConponCallbackListener; use App\Listeners\ConponCallbackListener;
use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider; use Illuminate\Foundation\Support\Providers\EventServiceProvider as ServiceProvider;
use XuanChen\Petro\Kernel\Event\CouponNotice;
use XuanChen\Petro\Kernel\Listeners\PetroConponNoticeListener;
use XuanChen\UnionPay\Event\UnionpayConponCallback; use XuanChen\UnionPay\Event\UnionpayConponCallback;
use XuanChen\UnionPay\Listeners\UnionpayConponCallbackListener; use XuanChen\UnionPay\Listeners\UnionpayConponCallbackListener;
@@ -13,6 +15,7 @@ class EventServiceProvider extends ServiceProvider
/** /**
* The event listener mappings for the application. * The event listener mappings for the application.
*
* @var array * @var array
*/ */
protected $listen = [ protected $listen = [
@@ -22,11 +25,14 @@ class EventServiceProvider extends ServiceProvider
UnionpayConponCallback::class => [ UnionpayConponCallback::class => [
UnionpayConponCallbackListener::class, UnionpayConponCallbackListener::class,
], ],
CouponNotice::class => [
PetroConponNoticeListener::class,
],
]; ];
/** /**
* Register any events for your application. * Register any events for your application.
*
* @return void * @return void
*/ */
public function boot() public function boot()

131
composer.lock generated
View File

@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "ff9124fe13daf9df8300d62da36b73a9", "content-hash": "8ae60394194187c6f32ba6dd833951bf",
"packages": [ "packages": [
{ {
"name": "asm89/stack-cors", "name": "asm89/stack-cors",
@@ -3494,6 +3494,59 @@
], ],
"time": "2022-01-30T08:48:36+00:00" "time": "2022-01-30T08:48:36+00:00"
}, },
{
"name": "pimple/pimple",
"version": "v3.5.0",
"source": {
"type": "git",
"url": "https://github.com/silexphp/Pimple.git",
"reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/silexphp/Pimple/zipball/a94b3a4db7fb774b3d78dad2315ddc07629e1bed",
"reference": "a94b3a4db7fb774b3d78dad2315ddc07629e1bed",
"shasum": ""
},
"require": {
"php": ">=7.2.5",
"psr/container": "^1.1 || ^2.0"
},
"require-dev": {
"symfony/phpunit-bridge": "^5.4@dev"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.4.x-dev"
}
},
"autoload": {
"psr-0": {
"Pimple": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "Pimple, a simple Dependency Injection Container",
"homepage": "https://pimple.symfony.com",
"keywords": [
"container",
"dependency injection"
],
"support": {
"source": "https://github.com/silexphp/Pimple/tree/v3.5.0"
},
"time": "2021-10-28T11:13:42+00:00"
},
{ {
"name": "predis/predis", "name": "predis/predis",
"version": "v1.1.10", "version": "v1.1.10",
@@ -7158,23 +7211,17 @@
}, },
{ {
"name": "xuanchen/coupon", "name": "xuanchen/coupon",
"version": "1.0.9", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/xuanchen120/coupon.git", "url": "https://github.com/xuanchen120/coupon.git",
"reference": "f67679162f55af80d8343fe1cacdc2eed3ad96e8" "reference": "6d32a7e33509cc95ba2309cda5b34efbd9ddd9e6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/xuanchen120/coupon/zipball/f67679162f55af80d8343fe1cacdc2eed3ad96e8", "url": "https://api.github.com/repos/xuanchen120/coupon/zipball/6d32a7e33509cc95ba2309cda5b34efbd9ddd9e6",
"reference": "f67679162f55af80d8343fe1cacdc2eed3ad96e8", "reference": "6d32a7e33509cc95ba2309cda5b34efbd9ddd9e6",
"shasum": "", "shasum": ""
"mirrors": [
{
"url": "https://mirrors.aliyun.com/composer/dists/%package%/%reference%.%type%",
"preferred": true
}
]
}, },
"require": { "require": {
"laravel/framework": "*", "laravel/framework": "*",
@@ -7207,9 +7254,63 @@
"homepage": "https://github.com/xuanchen120/coupon.git", "homepage": "https://github.com/xuanchen120/coupon.git",
"support": { "support": {
"issues": "https://github.com/xuanchen120/coupon/issues", "issues": "https://github.com/xuanchen120/coupon/issues",
"source": "https://github.com/xuanchen120/coupon/tree/1.0.9" "source": "https://github.com/xuanchen120/coupon/tree/1.1.0"
}, },
"time": "2021-07-01T02:02:51+00:00" "time": "2022-02-11T06:39:44+00:00"
},
{
"name": "xuanchen/petro",
"version": "1.2",
"source": {
"type": "git",
"url": "https://github.com/xuanchen120/petro.git",
"reference": "730e3dbe8194fea8cbee34839769071721fd9704"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/xuanchen120/petro/zipball/730e3dbe8194fea8cbee34839769071721fd9704",
"reference": "730e3dbe8194fea8cbee34839769071721fd9704",
"shasum": ""
},
"require": {
"guzzlehttp/guzzle": "^7.0.0",
"illuminate/support": "^7.0|^8.0",
"laravel/framework": "*",
"php": ">=7.1.3",
"pimple/pimple": "^3.0"
},
"type": "library",
"extra": {
"laravel": {
"providers": [
"XuanChen\\Petro\\ServiceProvider"
],
"aliases": {
"Petro": "XuanChen\\Petro"
}
}
},
"autoload": {
"psr-4": {
"XuanChen\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "玄尘",
"email": "122383162@qq.com"
}
],
"description": "优惠券",
"support": {
"issues": "https://github.com/xuanchen120/petro/issues",
"source": "https://github.com/xuanchen120/petro/tree/1.2"
},
"time": "2022-03-04T07:06:08+00:00"
}, },
{ {
"name": "xuanchen/unionpay", "name": "xuanchen/unionpay",
@@ -10022,5 +10123,5 @@
"php": "^7.3|^8.0" "php": "^7.3|^8.0"
}, },
"platform-dev": [], "platform-dev": [],
"plugin-api-version": "2.0.0" "plugin-api-version": "2.2.0"
} }