From 6ab5eff503ebe101a9901737eddc65e6278185a0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-GG6FIN9\\Administrator" <15040771@qq.com> Date: Mon, 3 Aug 2020 17:00:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=94=E5=88=B8=E6=8E=A5=E5=8F=A3=20?= =?UTF-8?q?=E5=88=9D=E5=A7=8B=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Controller/CouponRebateController.php | 16 ++++++++++------ app/CouponRebate/CouponRebate.php | 19 +++++++++++++++++++ app/CouponRebate/CouponRebateInterface.php | 10 ++++++++++ config/autoload/dependencies.php | 1 + config/routes.php | 1 + 5 files changed, 41 insertions(+), 6 deletions(-) create mode 100644 app/CouponRebate/CouponRebate.php create mode 100644 app/CouponRebate/CouponRebateInterface.php diff --git a/app/Controller/CouponRebateController.php b/app/Controller/CouponRebateController.php index 7ed921d..3d344cb 100644 --- a/app/Controller/CouponRebateController.php +++ b/app/Controller/CouponRebateController.php @@ -11,18 +11,22 @@ declare(strict_types=1); */ namespace App\Controller; - -use App\Model\CouponUserRecType; -use App\Model\Coupon; -use App\Model\CouponRec; use Hyperf\DbConnection\Db; use Hyperf\Redis\Redis; use Hyperf\Utils\ApplicationContext; - +use App\CouponRebate\CouponRebateInterface; +use http\Client\Curl\User; +use Hyperf\Di\Annotation\Inject; class CouponRebateController extends BaseController { + /** + * @Inject + * @var CouponRebateInterface + */ + protected $CouponRebate; public function isCouponRebate() { - return $this->success('创建成功'); + $res = $this->CouponRebate->isCouponRebate('测试数据'); + return $this->success($res); } } diff --git a/app/CouponRebate/CouponRebate.php b/app/CouponRebate/CouponRebate.php new file mode 100644 index 0000000..d006177 --- /dev/null +++ b/app/CouponRebate/CouponRebate.php @@ -0,0 +1,19 @@ + \App\Service\AttachmentService::class, \App\Service\ParamsTokenServiceInterface::class => \App\Service\ParamsTokenSsdbService::class, \App\Commons\Log::class => \App\Commons\Log::class, + \App\CouponRebate\CouponRebateInterface::class => \App\CouponRebate\CouponRebate::class, ]; diff --git a/config/routes.php b/config/routes.php index 88b8a99..7305ea3 100644 --- a/config/routes.php +++ b/config/routes.php @@ -25,4 +25,5 @@ Router::addGroup('/v1/',function (){ Router::get('test/index1', 'App\Controller\TestController@index1'); Router::post('ParamsToken/generate', 'App\Controller\ParamsTokenController@generate'); Router::post('ParamsToken/analyze', 'App\Controller\ParamsTokenController@analyze'); + Router::post('CouponRebate/isCouponRebate', 'App\Controller\CouponRebateController@isCouponRebate'); }); \ No newline at end of file