更新若干功能
This commit is contained in:
30
app/Http/Controllers/Wx/FavoriteController.php
Normal file
30
app/Http/Controllers/Wx/FavoriteController.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Wx;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\wx\WxFavoriteService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* 小程序收藏
|
||||
*/
|
||||
class FavoriteController extends BaseController
|
||||
{
|
||||
protected array $exceptRoute = ['option', 'detail', 'create', 'update', 'delete'];
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = WxFavoriteService::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* 切换收藏
|
||||
* @Method POST
|
||||
*/
|
||||
public function toggle(): JsonResponse
|
||||
{
|
||||
return jok($this->service->toggle((int) request()->post('catalogue_id', 0)));
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user