部分前台接口

This commit is contained in:
2025-05-07 16:52:49 +08:00
parent 7a08ac219e
commit 8a99bcb904
8 changed files with 65 additions and 5 deletions

View File

@@ -4,6 +4,7 @@ namespace App\Http\Controllers;
use App\BaseApp\BaseController;
use App\Service\CollectionService;
use Illuminate\Http\JsonResponse;
class CollectionController extends BaseController
{
@@ -15,4 +16,20 @@ class CollectionController extends BaseController
$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),
'取消成功'
);
}
}