33 lines
1.3 KiB
PHP
33 lines
1.3 KiB
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace app\adminapi\schema\request\plugin;
|
|
|
|
use app\schema\request\BaseFormRequest;
|
|
use OpenApi\Attributes as OA;
|
|
use WebmanTech\DTO\Attributes\ValidationRules;
|
|
|
|
#[OA\Schema(
|
|
title: '应用授权表单',
|
|
description: '应用授权创建和编辑接口共用的表单请求参数'
|
|
)]
|
|
class ApplicationAuthFormRequest extends BaseFormRequest
|
|
{
|
|
#[OA\Property(property: 'name', description: '应用名称', type: 'string', example: '开放平台应用', nullable: false)]
|
|
#[ValidationRules(rules: 'required|string|max:100')]
|
|
public string $name;
|
|
|
|
#[OA\Property(property: 'expired_at', description: '失效时间戳', type: 'integer', example: 1795104000, nullable: true)]
|
|
#[ValidationRules(rules: 'nullable|integer')]
|
|
public ?int $expired_at = null;
|
|
|
|
#[OA\Property(property: 'enabled', description: '状态(1正常 0停用)', type: 'integer', enum: [0, 1], example: 1, nullable: false)]
|
|
#[ValidationRules(rules: 'required|integer|in:0,1')]
|
|
public int $enabled;
|
|
|
|
#[OA\Property(property: 'description', description: '描述', type: 'string', example: '用于第三方应用接口调用', nullable: true)]
|
|
#[ValidationRules(rules: 'nullable|string|max:500')]
|
|
public ?string $description = null;
|
|
}
|