Files
lgp-admin-plus-api/app/Http/Controllers/Api/FactoryInfoController.php

36 lines
922 B
PHP
Raw Normal View History

<?php
namespace App\Http\Controllers\Api;
use App\BaseApp\BaseController;
use App\Service\business\FactoryInfoService;
use Exception;
use Illuminate\Http\JsonResponse;
/**
* 工厂管理
*/
class FactoryInfoController extends BaseController
{
public function __construct()
{
parent::__construct();
$this->service = FactoryInfoService::getInstance();
$this->insertField = ['name', 'classification'];
$this->updateField = ['id', 'name', 'classification'];
$this->notRequest = ['phone', 'cover', 'address', 'status'];
}
/**
* 启用 / 禁用
* @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']), '操作成功');
}
}