src/Foundation/Api.php
public function getApiRules()
    {
        $rules = [];

        $allRules = $this->getRules();
        if (!is_array($allRules)) {
            $allRules = [];
        }

        $allRules = array_change_key_case($allRules, CASE_LOWER);

        $service = DI()->request->get('service', 'Default.Index');
        list($apiClassName, $action) = explode('.', $service);
        $action = strtolower($action);

        if (isset($allRules[$action]) && is_array($allRules[$action])) {
            $rules = $allRules[$action];
        }
        if (isset($allRules['*'])) {
            $rules = array_merge($allRules['*'], $rules);
        }

        $apiCommonRules = DI()->config->get('app.apiCommonRules', []);
        if (!empty($apiCommonRules) && is_array($apiCommonRules)) {
            $rules = array_merge($apiCommonRules, $rules);
        }

        return $rules;
    }
public function getApiRules()
    {
        $rules = [];

        $allRules = $this->getRules();
        if (!is_array($allRules)) {
            $allRules = [];
        }

        $allRules = array_change_key_case($allRules, CASE_LOWER);

        $service = DI()->request->get('service', 'Default.Index');
        list($apiClassName, $action) = explode('.', $service);
        $action = strtolower($action);

        if (isset($allRules[$action]) && is_array($allRules[$action])) {
            $rules = $allRules[$action];
        }
        if (isset($allRules['*'])) {
            $rules = array_merge($allRules['*'], $rules);
        }

        $apiCommonRules = DI()->config->get('app.apiCommonRules', []);
        if (!empty($apiCommonRules) && is_array($apiCommonRules)) {
            $rules = array_merge($apiCommonRules, $rules);
        }

        return $rules;
    }
取接口参数规则

主要包括有：
- 1、[固定]系统级的service参数
- 2、应用级统一接口参数规则，在app.apiCommonRules中配置
- 3、接口级通常参数规则，在子类的*中配置
- 4、接口级当前操作参数规则

<b>当规则有冲突时，以后面为准。另外，被请求的函数名和配置的下标都转成小写再进行匹配。</b>

@uses \PhalApi\Foundation\Api::getRules()

@return array