36 lines
759 B
PHP
36 lines
759 B
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\BaseApp\BaseController;
|
|
use App\Service\CollectionService;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class CollectionController extends BaseController
|
|
{
|
|
//
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->service = CollectionService::getInstance();
|
|
$this->insertField = ['project_id'];
|
|
}
|
|
|
|
/**
|
|
* 取消收藏
|
|
* @return JsonResponse
|
|
*/
|
|
public function unCollection(): JsonResponse
|
|
{
|
|
$projectId = request()->post('project_id');
|
|
if (empty($projectId)) {
|
|
return jerr('参数错误');
|
|
}
|
|
return jok(
|
|
$this->service->unCollection($projectId),
|
|
'取消成功'
|
|
);
|
|
}
|
|
}
|