You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
879 B
45 lines
879 B
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request;
|
|
|
|
use Hyperf\Validation\Request\FormRequest;
|
|
|
|
class UserUnionidRequest extends FormRequest
|
|
{
|
|
/**
|
|
* Determine if the user is authorized to make this request.
|
|
*/
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'openid' => 'required|nonempty',
|
|
'unionid' => 'required|nonempty',
|
|
];
|
|
}
|
|
|
|
public function messages(): array
|
|
{
|
|
return [
|
|
'openid.*' => ':attribute必须',
|
|
'unionid.*' => ':attribute必须',
|
|
];
|
|
}
|
|
|
|
public function attributes(): array
|
|
{
|
|
return [
|
|
'openid' => '用户openid',
|
|
'unionid' => '用户unionid',
|
|
];
|
|
}
|
|
}
|