初始化
缺陷:主题配色需要优化整体的同风格
This commit is contained in:
44
app/Http/Controllers/Api/FactoryImageController.php
Normal file
44
app/Http/Controllers/Api/FactoryImageController.php
Normal file
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\business\FactoryImageService;
|
||||
use Exception;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
/**
|
||||
* 工厂产品图
|
||||
*/
|
||||
class FactoryImageController extends BaseController
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = FactoryImageService::getInstance();
|
||||
$this->insertField = ['factory', 'url'];
|
||||
$this->updateField = ['id', 'url'];
|
||||
$this->notRequest = ['factory', 'status'];
|
||||
}
|
||||
|
||||
/**
|
||||
* 某工厂的全部产品图(入参 factory)
|
||||
* @Method GET
|
||||
*/
|
||||
public function imageList(): JsonResponse
|
||||
{
|
||||
return jok($this->service->imageList((int) request()->get('factory', 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