<?php
// +----------------------------------------------------------------------
// | saiadmin [ saiadmin快速开发框架 ]
// +----------------------------------------------------------------------
namespace app\dice\validate\game;

use plugin\saiadmin\basic\BaseValidate;

/**
 * 游戏管理验证器
 */
class DiceGameValidate extends BaseValidate
{
    protected $rule = [
        'provider' => 'require|max:64',
        'provider_code' => 'require|max:32',
        'game_code' => 'require|max:64',
        'game_key' => 'require|max:64',
        'game_name' => 'require|max:128',
        'game_name_en' => 'max:128',
        'game_type' => 'require|max:32',
        'status' => 'require|in:0,1',
        'sort' => 'number',
    ];

    protected $message = [
        'provider' => 'provider 必填',
        'provider_code' => 'provider_code 必填',
        'game_code' => 'game_code 必填',
        'game_key' => 'game_key 必填',
        'game_name' => 'game_name 必填',
        'game_type' => 'game_type 必填',
        'status' => 'status 仅支持 0 或 1',
        'sort' => 'sort 必须为数字',
    ];

    protected $scene = [
        'save' => [
            'provider',
            'provider_code',
            'game_code',
            'game_key',
            'game_name',
            'game_name_en',
            'game_type',
            'status',
            'sort',
        ],
        'update' => [
            'provider',
            'provider_code',
            'game_code',
            'game_key',
            'game_name',
            'game_name_en',
            'game_type',
            'status',
            'sort',
        ],
    ];
}
