初始化
缺陷:主题配色需要优化整体的同风格
This commit is contained in:
53
app/Http/Controllers/Api/ImageController.php
Normal file
53
app/Http/Controllers/Api/ImageController.php
Normal file
@@ -0,0 +1,53 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\business\ImageService;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* 商品相册
|
||||
*/
|
||||
class ImageController extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = ImageService::getInstance();
|
||||
$this->insertField = ['catalogue_id', 'url', 'type'];
|
||||
$this->updateField = ['id', 'url'];
|
||||
$this->notRequest = ['catalogue_id', 'type', 'status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 渲染图列表(入参 catalogue_id)
|
||||
* @Method GET
|
||||
*/
|
||||
public function renderGraph(): JsonResponse
|
||||
{
|
||||
return jok($this->service->renderGraph((int) request()->get('catalogue_id', 0)), '列表获取成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 实物图列表(入参 catalogue_id)
|
||||
* @Method GET
|
||||
*/
|
||||
public function physicalDrawing(): JsonResponse
|
||||
{
|
||||
return jok($this->service->physicalDrawing((int) request()->get('catalogue_id', 0)), '列表获取成功');
|
||||
}
|
||||
|
||||
/**
|
||||
* 启用 / 禁用
|
||||
* @Method POST
|
||||
* @throws Exception
|
||||
*/
|
||||
public function status(): JsonResponse
|
||||
{
|
||||
$this->insertField = ['id', 'status'];
|
||||
$params = $this->checkRequiredFields(request()->post());
|
||||
return jok($this->service->status($params['id'], $params['status']), '操作成功');
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user