初始化本地仓库
This commit is contained in:
@@ -0,0 +1,89 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
*+------------------
|
||||
* madong
|
||||
*+------------------
|
||||
* Copyright (c) https://gitee.com/motion-code All rights reserved.
|
||||
*+------------------
|
||||
* Author: Mr. April (405784684@qq.com)
|
||||
*+------------------
|
||||
* Official Website: https://madong.tech
|
||||
*/
|
||||
|
||||
namespace app\api\schema\request\system;
|
||||
|
||||
use app\schema\request\BaseFormRequest;
|
||||
use OpenApi\Attributes as OA;
|
||||
use WebmanTech\DTO\Attributes\ValidationRules;
|
||||
|
||||
#[OA\Schema(
|
||||
title: '配置表单',
|
||||
description: '配置创建和编辑接口共用的表单请求参数'
|
||||
)]
|
||||
class ConfigFormRequest extends BaseFormRequest
|
||||
{
|
||||
#[OA\Property(
|
||||
description: '分组编码',
|
||||
type: 'string',
|
||||
example: 'site',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:50')]
|
||||
public string $group_code;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置编码',
|
||||
type: 'string',
|
||||
example: 'site_name',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:50|unique:sys_config,code')]
|
||||
public string $code;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置名称',
|
||||
type: 'string',
|
||||
example: '网站名称',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:100')]
|
||||
public string $name;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置内容',
|
||||
type: 'mixed',
|
||||
example: '我的网站',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required')]
|
||||
public mixed $content;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否启用(0:禁用,1:启用)',
|
||||
type: 'integer',
|
||||
enum: [0, 1],
|
||||
example: 1,
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|in:0,1')]
|
||||
public int $enabled;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置描述',
|
||||
type: 'string',
|
||||
example: '网站名称配置项',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'string|max:255|nullable')]
|
||||
public ?string $description = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '排序',
|
||||
type: 'integer',
|
||||
example: 1,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'integer|min:0|nullable')]
|
||||
public ?int $sort = null;
|
||||
}
|
||||
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
*+------------------
|
||||
* madong
|
||||
*+------------------
|
||||
* Copyright (c) https://gitee.com/motion-code All rights reserved.
|
||||
*+------------------
|
||||
* Author: Mr. April (405784684@qq.com)
|
||||
*+------------------
|
||||
* Official Website: https://madong.tech
|
||||
*/
|
||||
|
||||
namespace app\api\schema\request\system;
|
||||
|
||||
|
||||
use app\schema\request\BaseQueryRequest;
|
||||
use OpenApi\Attributes as OA;
|
||||
use WebmanTech\DTO\Attributes\ValidationRules;
|
||||
|
||||
#[OA\Schema(
|
||||
title: '分组配置查询',
|
||||
description: '获取分组配置接口的请求参数'
|
||||
)]
|
||||
class ConfigGroupQueryRequest extends BaseQueryRequest
|
||||
{
|
||||
#[OA\Property(
|
||||
description: '分组编码',
|
||||
type: 'string',
|
||||
example: 'site',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:50')]
|
||||
public string $group_code;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否只获取启用的配置项',
|
||||
type: 'boolean',
|
||||
example: true,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $enabled_only = true;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否包含配置项的完整元数据',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $with_metadata = false;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否包含配置项的描述信息',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $with_description = false;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否对配置项进行排序',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $sort_configs = false;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置项过滤,多个配置编码用逗号分隔',
|
||||
type: 'string',
|
||||
example: 'site_name,site_url',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'string|max:200|nullable')]
|
||||
public ?string $config_filter = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否返回默认值(当配置项不存在时)',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $with_defaults = false;
|
||||
|
||||
#[OA\Property(
|
||||
description: '默认值映射(JSON格式)',
|
||||
type: 'string',
|
||||
example: '{"site_name":"默认网站名称","site_url":"http://localhost"}',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'json|nullable')]
|
||||
public ?string $default_values = null;
|
||||
}
|
||||
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
*+------------------
|
||||
* madong
|
||||
*+------------------
|
||||
* Copyright (c) https://gitee.com/motion-code All rights reserved.
|
||||
*+------------------
|
||||
* Author: Mr. April (405784684@qq.com)
|
||||
*+------------------
|
||||
* Official Website: https://madong.tech
|
||||
*/
|
||||
|
||||
namespace app\api\schema\request\system;
|
||||
|
||||
use app\schema\request\BaseQueryRequest;
|
||||
use OpenApi\Attributes as OA;
|
||||
use WebmanTech\DTO\Attributes\ValidationRules;
|
||||
|
||||
#[OA\Schema(
|
||||
title: '配置查询',
|
||||
description: '配置查询接口的请求参数'
|
||||
)]
|
||||
class ConfigQueryRequest extends BaseQueryRequest
|
||||
{
|
||||
#[OA\Property(
|
||||
description: '分组编码',
|
||||
type: 'string',
|
||||
example: 'site',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'string|max:50|nullable')]
|
||||
public ?string $group_code = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置名称',
|
||||
type: 'string',
|
||||
example: '网站名称',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'string|max:100|nullable')]
|
||||
public ?string $name = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否只获取启用的配置项',
|
||||
type: 'boolean',
|
||||
example: true,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $enabled_only = true;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否包含配置项的完整元数据',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $with_metadata = false;
|
||||
|
||||
#[OA\Property(
|
||||
description: '分组过滤,多个分组用逗号分隔',
|
||||
type: 'string',
|
||||
example: 'site,oss',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'string|max:200|nullable')]
|
||||
public ?string $group_filter = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '按指定字段作为键名(code 或 id)',
|
||||
type: 'string',
|
||||
enum: ['code', 'id'],
|
||||
example: 'code',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'in:code,id|nullable')]
|
||||
public ?string $key_by = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否对分组进行排序',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $sort_groups = false;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否对配置项进行排序',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $sort_configs = false;
|
||||
|
||||
}
|
||||
@@ -0,0 +1,70 @@
|
||||
<?php
|
||||
declare(strict_types=1);
|
||||
/**
|
||||
*+------------------
|
||||
* madong
|
||||
*+------------------
|
||||
* Copyright (c) https://gitee.com/motion-code All rights reserved.
|
||||
*+------------------
|
||||
* Author: Mr. April (405784684@qq.com)
|
||||
*+------------------
|
||||
* Official Website: https://madong.tech
|
||||
*/
|
||||
|
||||
namespace app\api\schema\request\system;
|
||||
|
||||
use madong\swagger\schema\BaseResponseDTO;
|
||||
use OpenApi\Attributes as OA;
|
||||
use WebmanTech\DTO\Attributes\ValidationRules;
|
||||
|
||||
#[OA\Schema(
|
||||
title: '配置值操作',
|
||||
description: '配置值获取和更新接口的请求参数'
|
||||
)]
|
||||
class ConfigValueRequest extends BaseResponseDTO
|
||||
{
|
||||
#[OA\Property(
|
||||
description: '配置项编码',
|
||||
type: 'string',
|
||||
example: 'site_config',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:50')]
|
||||
public string $code;
|
||||
|
||||
#[OA\Property(
|
||||
description: '分组编码',
|
||||
type: 'string',
|
||||
example: 'site',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:50')]
|
||||
public string $group_code;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置键',
|
||||
type: 'string',
|
||||
example: 'site_name',
|
||||
nullable: false
|
||||
)]
|
||||
#[ValidationRules(rules: 'required|string|max:100')]
|
||||
public string $key;
|
||||
|
||||
#[OA\Property(
|
||||
description: '配置值',
|
||||
type: 'mixed',
|
||||
example: '我的网站',
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'nullable')]
|
||||
public mixed $value = null;
|
||||
|
||||
#[OA\Property(
|
||||
description: '是否强制创建配置项',
|
||||
type: 'boolean',
|
||||
example: false,
|
||||
nullable: true
|
||||
)]
|
||||
#[ValidationRules(rules: 'boolean|nullable')]
|
||||
public ?bool $force_create = false;
|
||||
}
|
||||
Reference in New Issue
Block a user