42 lines
1.3 KiB
PHP
42 lines
1.3 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers;
|
|
|
|
use App\BaseApp\BaseController;
|
|
use App\Service\ProjectService;
|
|
use Exception;
|
|
use Illuminate\Http\JsonResponse;
|
|
|
|
class ProjectController extends BaseController
|
|
{
|
|
//
|
|
|
|
public function __construct()
|
|
{
|
|
parent::__construct();
|
|
$this->service = ProjectService::getInstance();
|
|
$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),
|
|
'修改成功'
|
|
);
|
|
}
|
|
}
|