<?php

namespace  App\Http\Requests\OpenWork\External;

use App\Http\Requests\BaseRequest;

/**
 * 微信服务器客户接口校验规则
 * @author  唐远望
 * @date    2025-04-02
 * */
class User extends BaseRequest
{

    /**
     *
     * @return  array
     */
    public  function  rules()
    {
        // 规则
        return [
            'corpid'              => 'required',
            'userid_list'         => 'required',
            'external_userid'     => 'required',
            'userid'              => 'required',
            'page'                => 'required|integer|min:1',
            'limit'               => 'required|integer|min:1',
        ];
    }

    // 场景列表
    protected   $scenes         = [
        'sync_wechat_user'                      => ['corpid'],
        'get_detail'                            => ['corpid',  'external_userid'],
        'remark'                                => ['corpid', 'userid', 'external_userid'],
        'user_group_list'                       => ['corpid', 'external_userid','page','limit'],
    ];

    /**
     *
     * @return  array
     */
    public  function  messages()
    {
        return [
            'corpid.required'     => '授权方corpid不能为空',
            'userid_list.required'     => '用户ID列表不能为空',
            'external_userid.required'     => '外部联系人userid不能为空',
            'userid.required'     => '用户ID不能为空',
            'page.required'     => '页码不能为空',
            'page.integer'     => '页码必须为整数',
            'page.min'     => '页码最小为1',
            'limit.required'     => '每页数量不能为空',
            'limit.integer'     => '每页数量必须为整数',
            'limit.min'     => '每页数量最小为1',
        ];
    }
}
