feat: add article and production modules

This commit is contained in:
2026-08-31 13:16:46 +08:00
parent ac3da246b2
commit 5c586a1a95
334 changed files with 34419 additions and 1 deletions
+9
View File
@@ -0,0 +1,9 @@
<?php
return [
'enable' => true,
'debug' => true,
'controller_suffix' => 'Controller',
'controller_reuse' => false,
'version' => '1.0.0',
];
+20
View File
@@ -0,0 +1,20 @@
<?php
/**
* 插件信息配置
*/
return [
'name' => 'produce',
'identifier' => 'produce',
'type' => 'madong:plugin',
'version' => '1.0.0',
'description' => '',
'author' => 'mrlee',
'author_email' => '',
'website' => '',
'uninstall' => [
'drop_tables' => false,
'remove_dependencies' => false,
],
];
@@ -0,0 +1,4 @@
<?php return array (
'version' => '1.0.0',
'installed_at' => '2026-08-30 15:44:35',
);
@@ -0,0 +1,19 @@
<?php
/**
* produce 插件中间件配置
*/
use app\adminapi\middleware\AccessTokenMiddleware;
use app\api\middleware\ApiAccessTokenMiddleware;
return [
'appapi' => [
ApiAccessTokenMiddleware::class,
],
'adminapi' => [
AccessTokenMiddleware::class,
],
'@' => [
\app\middleware\AllowCrossOriginMiddleware::class,
],
];
+126
View File
@@ -0,0 +1,126 @@
<?php
/**
* produce 插件路由配置
* 使用 Swagger 注解自动生成路由
*/
use Webman\Route;
use WebmanTech\Swagger\Swagger;
use OpenApi\Annotations as OA;
/**
* 注册 API 路由
*/
Route::group('/api', function () {
Swagger::create()->registerRoute([
'route_prefix' => '/produce/openapi',
'register_route' => true,
'openapi_doc' => [
'scan_path' => [
base_path('plugin/produce/app/api'),
],
'modify' => function (OA\OpenApi $openapi) {
$openapi->info->title = '生产管理 API';
$openapi->info->version = '1.0.0';
$openapi->servers = [
new OA\Server(
[
'url' => '/api',
'description' => request()->host(),
]
),
];
/** @phpstan-ignore-next-line */
if (!$openapi->components instanceof OA\Components) {
$openapi->components = new OA\Components([]);
}
$openapi->components->securitySchemes = [
new OA\SecurityScheme([
'securityScheme' => 'api_key',
'type' => 'apiKey',
'name' => config('core.jwt.app.token_name', 'Authorization'),
'in' => 'header',
]),
];
},
],
]);
});
/**
* 注册 AppAPI 路由
*/
Route::group('/appapi', function () {
Swagger::create()->registerRoute([
'route_prefix' => '/produce/openapi',
'register_route' => true,
'openapi_doc' => [
'scan_path' => [
base_path('plugin/produce/app/appapi'),
],
'modify' => function (OA\OpenApi $openapi) {
$openapi->info->title = '生产管理 APP API';
$openapi->info->version = '1.0.0';
$openapi->servers = [
new OA\Server(
[
'url' => '/appapi',
'description' => request()->host(),
]
),
];
/** @phpstan-ignore-next-line */
if (!$openapi->components instanceof OA\Components) {
$openapi->components = new OA\Components([]);
}
$openapi->components->securitySchemes = [
new OA\SecurityScheme([
'securityScheme' => 'api_key',
'type' => 'apiKey',
'name' => config('core.jwt.app.token_name', 'Authorization'),
'in' => 'header',
]),
];
},
],
]);
});
/**
* 注册 AdminAPI 路由
*/
Route::group('/adminapi', function () {
Swagger::create()->registerRoute([
'route_prefix' => '/produce/openapi',
'register_route' => true,
'openapi_doc' => [
'scan_path' => [
base_path('plugin/produce/app/adminapi'),
],
'modify' => function (OA\OpenApi $openapi) {
$openapi->info->title = '生产管理 API';
$openapi->info->version = '1.0.0';
$openapi->servers = [
new OA\Server(
[
'url' => '/adminapi',
'description' => request()->host(),
]
),
];
/** @phpstan-ignore-next-line */
if (!$openapi->components instanceof OA\Components) {
$openapi->components = new OA\Components([]);
}
$openapi->components->securitySchemes = [
new OA\SecurityScheme([
'securityScheme' => 'api_key',
'type' => 'apiKey',
'name' => config('core.jwt.app.token_name', 'Authorization'),
'in' => 'header',
]),
];
},
],
]);
});
@@ -0,0 +1,7 @@
<?php
return [
'locale' => config('app.lang'),
'fallback_locale' => ['zh_CN', 'en'],
'path' => base_path() . '/plugin/produce/resource/translations',
];