更新若干功能
This commit is contained in:
51
app/Http/Controllers/Wx/PackageController.php
Normal file
51
app/Http/Controllers/Wx/PackageController.php
Normal file
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Wx;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\wx\WxPackageService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* 小程序套餐(热门/列表/详情免登录,一件加入走 Service 内登录校验)
|
||||
*/
|
||||
class PackageController extends BaseController
|
||||
{
|
||||
protected array $exceptRoute = ['option', 'create', 'update', 'delete'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = WxPackageService::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* 首页热门套餐
|
||||
* @Method GET
|
||||
*/
|
||||
public function hot(): JsonResponse
|
||||
{
|
||||
return jok($this->service->hot());
|
||||
}
|
||||
|
||||
/**
|
||||
* 套餐详情,p_user_id 为代理商分享来源(与商品详情同一套)
|
||||
* @Method GET
|
||||
*/
|
||||
public function detail(): JsonResponse
|
||||
{
|
||||
return jok($this->service->detail(
|
||||
(int) request()->get('id', 0),
|
||||
(int) request()->get('p_user_id', 0)
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* 一件加入清单
|
||||
* @Method POST
|
||||
*/
|
||||
public function toList(): JsonResponse
|
||||
{
|
||||
return jok($this->service->toList(request()->post()), '已加入清单');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user