项目相关优化
This commit is contained in:
@@ -4,6 +4,8 @@ namespace App\Http\Controllers;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\ProjectService;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class ProjectController extends BaseController
|
||||
{
|
||||
@@ -13,8 +15,27 @@ class ProjectController extends BaseController
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = ProjectService::getInstance();
|
||||
$this->insertField = [ 'title', 'cover', 'description', 'category_id', 'video_url', 'price', 'front', 'service', 'deploy', 'status'];
|
||||
$this->updateField = [ 'id', 'title', 'cover', 'description', 'category_id', 'video_url', 'price', 'front', 'service', 'deploy', 'status'];
|
||||
$this->notRequest = ['features', 'screenshots', 'labels', 'preferential_price'];
|
||||
$this->insertField = [ 'title', 'features', 'cover', 'labels', 'description', 'category_id', 'video_url', 'price', 'front', 'service', 'deploy', 'status', 'module_image', 'flowchart'];
|
||||
$this->updateField = [ 'id', 'title', 'features', 'cover', 'labels', 'description', 'category_id', 'video_url', 'price', 'front', 'service', 'deploy', 'status', 'module_image', 'flowchart'];
|
||||
$this->notRequest = ['screenshots', 'preferential_price', 'content'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改项目内容
|
||||
* @Method POST
|
||||
* @return JsonResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function changeContent(): JsonResponse
|
||||
{
|
||||
$id = request()->post('id');
|
||||
$content = request()->post('content');
|
||||
if (empty($id) || empty($content)) {
|
||||
return jerr('参数错误');
|
||||
}
|
||||
return jok(
|
||||
$this->service->changeContent($id, $content),
|
||||
'修改成功'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user