feat: add article and production modules
This commit is contained in:
@@ -0,0 +1,94 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace plugin\produce\app\adminapi\controller;
|
||||
|
||||
use app\adminapi\controller\Crud;
|
||||
use app\adminapi\middleware\OperationMiddleware;
|
||||
use app\adminapi\middleware\PermissionMiddleware;
|
||||
use app\schema\request\BatchDeleteRequest;
|
||||
use app\schema\request\IdRequest;
|
||||
use madong\swagger\annotation\response\PageResponse;
|
||||
use madong\swagger\annotation\response\SimpleResponse;
|
||||
use madong\swagger\attribute\Permission;
|
||||
use OpenApi\Attributes as OA;
|
||||
use plugin\produce\app\service\admin\ExceptionSettingService;
|
||||
use plugin\produce\app\validate\ExceptionSettingValidate;
|
||||
use support\annotation\Middleware;
|
||||
use support\Request;
|
||||
use WebmanTech\Swagger\DTO\SchemaConstants;
|
||||
|
||||
#[Middleware(OperationMiddleware::class, PermissionMiddleware::class)]
|
||||
class ExceptionSettingController extends Crud
|
||||
{
|
||||
protected ?array $selectInputConfig = [
|
||||
'enable_keyword_search' => true,
|
||||
'keyword_fields' => ['code', 'name', 'remark'],
|
||||
];
|
||||
|
||||
public function __construct(ExceptionSettingService $service, ExceptionSettingValidate $validate)
|
||||
{
|
||||
$this->service = $service;
|
||||
$this->validate = $validate;
|
||||
}
|
||||
|
||||
#[OA\Get(path: '/produce/exception-setting', summary: '异常设置列表', tags: ['produce-exception-setting'])]
|
||||
#[Permission(code: 'produce:exception-setting:list', description: '异常设置列表')]
|
||||
#[PageResponse(schema: [], example: [])]
|
||||
public function index(Request $request): \support\Response
|
||||
{
|
||||
return parent::index($request);
|
||||
}
|
||||
|
||||
#[OA\Get(path: '/produce/exception-setting/{id}', summary: '异常设置详情', tags: ['produce-exception-setting'], x: [
|
||||
SchemaConstants::X_PROPERTY_IN => 'id',
|
||||
SchemaConstants::X_SCHEMA_REQUEST => IdRequest::class,
|
||||
])]
|
||||
#[Permission(code: 'produce:exception-setting:read', description: '异常设置详情')]
|
||||
#[SimpleResponse(schema: [], example: [])]
|
||||
public function show(Request $request): \support\Response
|
||||
{
|
||||
return parent::show($request);
|
||||
}
|
||||
|
||||
#[OA\Post(path: '/produce/exception-setting', summary: '创建异常设置', tags: ['produce-exception-setting'])]
|
||||
#[Permission(code: 'produce:exception-setting:create', description: '创建异常设置')]
|
||||
#[SimpleResponse(schema: [], example: [])]
|
||||
public function store(Request $request): \support\Response
|
||||
{
|
||||
return parent::store($request);
|
||||
}
|
||||
|
||||
#[OA\Put(path: '/produce/exception-setting/{id}', summary: '更新异常设置', tags: ['produce-exception-setting'], x: [
|
||||
SchemaConstants::X_PROPERTY_IN => 'id',
|
||||
SchemaConstants::X_SCHEMA_REQUEST => IdRequest::class,
|
||||
])]
|
||||
#[Permission(code: 'produce:exception-setting:update', description: '更新异常设置')]
|
||||
#[SimpleResponse(schema: [], example: [])]
|
||||
public function update(Request $request): \support\Response
|
||||
{
|
||||
return parent::update($request);
|
||||
}
|
||||
|
||||
#[OA\Delete(path: '/produce/exception-setting/{id}', summary: '删除异常设置', tags: ['produce-exception-setting'], x: [
|
||||
SchemaConstants::X_PROPERTY_IN => 'id',
|
||||
SchemaConstants::X_SCHEMA_REQUEST => IdRequest::class,
|
||||
])]
|
||||
#[Permission(code: 'produce:exception-setting:delete', description: '删除异常设置')]
|
||||
#[SimpleResponse(schema: [], example: [])]
|
||||
public function destroy(Request $request): \support\Response
|
||||
{
|
||||
return parent::destroy($request);
|
||||
}
|
||||
|
||||
#[OA\Delete(path: '/produce/exception-setting', summary: '批量删除异常设置', tags: ['produce-exception-setting'], x: [
|
||||
SchemaConstants::X_SCHEMA_REQUEST => BatchDeleteRequest::class,
|
||||
])]
|
||||
#[Permission(code: 'produce:exception-setting:delete', description: '批量删除异常设置')]
|
||||
#[SimpleResponse(schema: [], example: [])]
|
||||
public function batchDelete(Request $request): \support\Response
|
||||
{
|
||||
return parent::destroy($request);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user