Files
wh-api/app/Request/CompanyRequest.php
ykxiao 0b2299c427
Some checks failed
Build Docker / build (push) Has been cancelled
协程版仓库后端项目
2025-07-08 14:59:47 +08:00

51 lines
1.1 KiB
PHP

<?php
/**
* Author: ykxiao
* Date: 2025/6/4
* Time: 下午2:54
* Description:
*
* (c) ykxiao <yk_9001@hotmail.com>
*
* This source file is subject to the MIT license that is bundled
* with this source code in the file LICENSE.
*/
declare(strict_types=1);
namespace App\Request;
use App\Constants\ActiveStatusConst;
use App\Constants\CompanyTypeConst;
class CompanyRequest extends AbstractRequest
{
public array $scenes = [
'addCompany' => [
'id',
'company_type',
'name',
'status',
],
];
public function rules(): array
{
return [
'id' => 'integer',
'company_type' => 'required|in:' . implode(',', array_column(CompanyTypeConst::getConstantsList(), 'value')),
'name' => 'required|string|max:128',
'status' => 'integer|in:0,1',
];
}
public function attributes(): array
{
return [
'id' => '公司ID',
'company_type' => '公司类型',
'name' => '公司名称',
'status' => '状态',
];
}
}