<?php
return array
(
    'source' => 'collect/api',
    'list' => array
    (
        'field'      => array
        (
            'id',
            'name',
            'method',
        ),
        'data_button' => array
        (
            '编辑' => 'edit',
            '业务' => array('route', array
            (
                'path' => 'yuan/api_service_manage',
                'param' => array
                (
                    'set' => array('api_id' => 'id', 'menu' => 'yuan/api_info', 'parent' => 'yuan/api_service_manage'),
                ),
            ), 'ChatLineSquare'),
        ),
        'button' => array
        (
            '新增' => 'add',
        ),
        'search' => array
        (
            'name',
        ),
    ),
    'update' => array
    (
        'tab' => array
        (
            '基本设置' => 'name,host,appkey,appsecret,method,post_method',
            '标准请求' => 'collect/api_request_body,collect/api_request_header',
            '响应设置' => 'response_type,response_data,response_msg,response_code,collect/api_response_code',
            '字段转换' => 'collect/api_convert',
            '签名设置' => 'sign_name,sign_method,sign_col,sign_type,sign_sort,sign_appsecret,sign_appsecret_location,sign_encode,sign_empty,sign_after',
            //'对称加密[暂时不支持]' => 'ssl_method,ssl_key,ssl_option,ssl_iv,ssl_after',
            '业务设置' => 'collect/api_service',
        ),
        'field'    => array
        (
            'name',
            'host',
            'appkey',
            'appsecret',
            'method' => array
            (
                'type' => 'radio',
                'control' => true,
            ),
            'post_method' => array
            (
                'type' => 'radio',
            ),

            'collect/api_request_body' => array
            (
                'name' => '请求体设置',
                'desc' => '标准请求body，没有标准请求体可以不填写',
                'where'  => array('api_id' => 'id'),
                'desc' => '[变量：timestamp毫秒时间戳，nonce随机值，appkey接口的appkey， notify请求回调地址，支持函数，如果函数中需要添加变量，请用{}隔开，如{code}，请求头也支持此变量]',
            ),
            'collect/api_request_header' => array
            (
                'name' => '请求头设置',
                'desc' => '标准请求header，没有标准请求头可以不填写',
                'where'  => array('api_id' => 'id'),
            ),

            'collect/api_convert' => array
            (
                'name' => '字段转换',
                'desc' => '设置字段转换后，响应和回调的数据名称将根据这些字段进行转换，official_order_num和official_msg是官方流水号和官方返回信息，这里需要绑定一下，未绑定则无法拿到官方流水号',
                'where'  => array('api_id' => 'id'),
            ),

            'response_type' => array
            (
                'type' => 'radio',
                //'control' => true,
            ),
            'response_data',
            'response_msg',
            'response_code',
            'collect/api_response_code' => array
            (
                'name' => '响应状态码',
                'desc' => '设置标准的响应状态码，也可以只设置成功值，其他值均为失败',
                'where'  => array('api_id' => 'id'),
            ),

            'sign_name',
            'sign_method' => 'radio',
            'sign_col' => array
            (
                'desc' => '按顺序做加密，用+号隔开，为空则所有字段均参与加密',
            ),
            'sign_type' => 'radio',
            'sign_sort' => 'radio',
            'sign_appsecret',
            'sign_appsecret_location' => 'radio',
            'sign_encode' => array
            (
                'type' => 'radio',
                'desc' => '【如果签名中包含有特殊字符，是否进行转码】',
            ),
            'sign_empty' => array
            (
                'type' => 'radio',
                'desc' => '【如果签名中有空值，是否参与加密】',
            ),
            'sign_after' => 'radio',

            'ssl_method' => array
            (
                'desc' => '如AES、DES等，直接填写加密方式的值',
            ),
            'ssl_key',
            'ssl_option' => 'radio',
            'ssl_iv',
            'ssl_after' => 'radio',

            'collect/api_service' => array
            (
                'name' => '接口列表',
                'where'  => array('api_id' => 'id'),
            ),
        ),

        'control' => array
        (
            'post_method' => array
            (
                'method' => 2,
            ),
        ),
    ),
);