rabin 1 mēnesi atpakaļ
vecāks
revīzija
0e6e3d8549
60 mainītis faili ar 2449 papildinājumiem un 2986 dzēšanām
  1. 79 96
      manage/account.php
  2. 53 66
      manage/account_cert.php
  3. 23 28
      manage/account_setting.php
  4. 167 200
      manage/api.php
  5. 29 36
      manage/api_notify.php
  6. 10 13
      manage/api_notify_code.php
  7. 11 14
      manage/api_path.php
  8. 17 22
      manage/api_save.php
  9. 44 57
      manage/app.php
  10. 116 141
      manage/app_func.php
  11. 28 35
      manage/app_func_input.php
  12. 20 26
      manage/app_func_output.php
  13. 28 34
      manage/app_func_work.php
  14. 88 101
      manage/core.php
  15. 32 42
      manage/format.php
  16. 123 152
      manage/platform.php
  17. 11 15
      manage/platform_cert.php
  18. 9 12
      manage/platform_convert.php
  19. 28 34
      manage/platform_request_body.php
  20. 13 17
      manage/platform_response_code.php
  21. 16 21
      manage/platform_setting.php
  22. 87 104
      manage/platform_sign.php
  23. 114 143
      manage/platform_ssl.php
  24. 24 31
      manage/sku.php
  25. 40 49
      table/account.php
  26. 37 45
      table/account_cert.php
  27. 22 27
      table/account_setting.php
  28. 84 100
      table/api.php
  29. 61 74
      table/api_log.php
  30. 31 38
      table/api_notify.php
  31. 10 12
      table/api_notify_body.php
  32. 32 39
      table/api_notify_code.php
  33. 38 46
      table/api_path.php
  34. 10 12
      table/api_query.php
  35. 10 12
      table/api_request_body.php
  36. 10 12
      table/api_request_header.php
  37. 11 13
      table/api_response.php
  38. 11 13
      table/api_response_body.php
  39. 11 13
      table/api_response_header.php
  40. 37 45
      table/api_save.php
  41. 10 12
      table/api_setting.php
  42. 32 39
      table/app.php
  43. 75 90
      table/app_func.php
  44. 59 70
      table/app_func_input.php
  45. 32 39
      table/app_func_output.php
  46. 38 46
      table/app_func_work.php
  47. 15 19
      table/app_platform.php
  48. 42 49
      table/format.php
  49. 25 31
      table/openid.php
  50. 47 57
      table/platform.php
  51. 21 26
      table/platform_cert.php
  52. 20 25
      table/platform_convert.php
  53. 32 39
      table/platform_request_body.php
  54. 35 43
      table/platform_response_code.php
  55. 27 33
      table/platform_setting.php
  56. 102 121
      table/platform_sign.php
  57. 112 134
      table/platform_ssl.php
  58. 36 44
      table/sku.php
  59. 26 32
      table/spec.php
  60. 38 47
      table/spec_value.php

+ 79 - 96
manage/account.php

@@ -1,96 +1,79 @@
-<?php
-$account_id = Dever::input('id');
-$show = false;
-$account_setting = array();
-if ($account_id) {
-    $account = Dever::db('account', 'api')->find($account_id);
-    $setting = Dever::db('platform_setting', 'api')->select(array('platform_id' => $account['platform_id']));
-    if ($setting) {
-        $show = true;
-        foreach ($setting as $k => $v) {
-            $account_setting[] = array('platform_setting_name' => $v['name'], 'platform_setting_id' => $v['id'], 'value' => '');
-        }
-    }
-}
-
-return array
-(
-    'list' => array
-    (
-        'field'      => array
-        (
-            'id',
-            'name',
-            'key',
-            'app_id' => array
-            (
-                'show' => 'Dever::call("api/app-find", "{app_id}")["name"]',
-            ),
-            'platform_id' => array
-            (
-                'show' => 'Dever::call("api/platform-find", "{platform_id}")["name"]',
-            ),
-            'cdate',
-        ),
-        'button' => array
-        (
-            '新增' => array('fastadd', 'name,key,app_platform'),
-        ),
-        'data_button' => array
-        (
-            '设置' => array('edit', 'name,key,app_platform_name,api/account_setting'),
-            '证书' => array('route', array
-            (
-                'path' => 'api_manage/account_cert',
-                'param' => array
-                (
-                    'set' => array('account_id' => 'id', 'menu' => 'api_manage/account', 'parent' => 'api_manage/account'),
-                ),
-            )),
-        ),
-        'search' => array
-        (
-            'name',
-            'key',
-            'app_platform' => array
-            (
-                'type' => 'cascader',
-                'remote'    => 'api/manage.getAppPlatform',
-            ),
-        ),
-    ),
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name' => array
-            (
-                'rules' => true,
-            ),
-            'key',
-            'app_platform' => array
-            (
-                'desc' => '【提交后不能更改】',
-                'rules' => true,
-                'type' => 'cascader',
-                'remote'    => 'api/manage.getAppPlatform',
-                'remote_default' => false,
-            ),
-            'app_platform_name' => array
-            (
-                'name' => '平台与应用',
-                'type' => 'show',
-                'default' => 'Dever::call("api/app.getAppPlatform", array("{app_id}", "{platform_id}"))',
-            ),
-            'api/account_setting' => array
-            (
-                'show' => $show,
-                'name' => '平台参数配置',
-                'where'  => array('account_id' => 'id'),
-                'default' => $account_setting,
-            ),
-        ),
-        'check' => 'key',
-        'start' => array('manage/common.updateKey', 'api/account.update'),
-    ),
-);
+<?php
+$account_id = Dever::input('id');
+$show = false;
+$account_setting = [];
+if ($account_id) {
+    $account = Dever::db('account', 'api')->find($account_id);
+    $setting = Dever::db('platform_setting', 'api')->select(['platform_id' => $account['platform_id']]);
+    if ($setting) {
+        $show = true;
+        foreach ($setting as $k => $v) {
+            $account_setting[] = ['platform_setting_name' => $v['name'], 'platform_setting_id' => $v['id'], 'value' => ''];
+        }
+    }
+}
+
+return [
+    'list' => [
+        'field'      => [
+            'id',
+            'name',
+            'key',
+            'app_id' => [
+                'show' => 'Dever::call("api/app-find", "{app_id}")["name"]',
+            ],
+            'platform_id' => [
+                'show' => 'Dever::call("api/platform-find", "{platform_id}")["name"]',
+            ],
+            'cdate',
+        ],
+        'button' => [
+            '新增' => ['fastadd', 'name,key,app_platform'],
+        ],
+        'data_button' => [
+            '设置' => ['edit', 'name,key,app_platform_name,api/account_setting'],
+            '证书' => ['route', [
+                'path' => 'api_manage/account_cert',
+                'param' => [
+                    'set' => ['account_id' => 'id', 'menu' => 'api_manage/account', 'parent' => 'api_manage/account'],
+                ],
+            ]],
+        ],
+        'search' => [
+            'name',
+            'key',
+            'app_platform' => [
+                'type' => 'cascader',
+                'remote'    => 'api/manage.getAppPlatform',
+            ],
+        ],
+    ],
+    'update' => [
+        'field'    => [
+            'name' => [
+                'rules' => true,
+            ],
+            'key',
+            'app_platform' => [
+                'desc' => '【提交后不能更改】',
+                'rules' => true,
+                'type' => 'cascader',
+                'remote'    => 'api/manage.getAppPlatform',
+                'remote_default' => false,
+            ],
+            'app_platform_name' => [
+                'name' => '平台与应用',
+                'type' => 'show',
+                'default' => 'Dever::call("api/app.getAppPlatform", ["{app_id}", "{platform_id}"])',
+            ],
+            'api/account_setting' => [
+                'show' => $show,
+                'name' => '平台参数配置',
+                'where'  => ['account_id' => 'id'],
+                'default' => $account_setting,
+            ],
+        ],
+        'check' => 'key',
+        'start' => ['manage/common.updateKey', 'api/account.update'],
+    ],
+];

+ 53 - 66
manage/account_cert.php

@@ -1,66 +1,53 @@
-<?php
-$account_id = Dever::input('set')['account_id'] ?? 0;
-if (!$account_id) {
-    $account_id = Dever::input('field')['account_id'] ?? 0;
-}
-$account = Dever::db('account', 'api')->find($account_id);
-return array
-(
-    'list' => array
-    (
-        'where' => array('account_id' => $account_id),
-        'field'      => array
-        (
-            'id',
-            'platform_cert_id' => array
-            (
-                'show' => 'Dever::call("api/app.getCertName", "{platform_cert_id}")',
-            ),
-            'number',
-            'cdate',
-        ),
-        'data_button' => array
-        (
-            '编辑' => array('fastedit', array('account_id' => $account_id)),
-        ),
-        'button' => array
-        (
-            '新增' => array('fastadd', array('account_id' => $account_id)),
-        ),
-        'search' => array
-        (
-            'account_id' => 'hidden',
-            'number',
-        ),
-    ),
-    'update' => array
-    (
-        'desc' => '有的证书会自动同步,无需手动添加,如微信支付的平台证书',
-        'field'    => array
-        (
-            'account_id' => 'hidden',
-            'platform_cert_id' => array
-            (
-                'rules' => true,
-                'type' => 'select',
-                'option'     => 'Dever::call("api/app.getCert", '.$account['platform_id'].')',
-                //'remote' => 'api/manage.getCertName',
-                //'remote_default' => false,
-            ),
-            'number' => array
-            (
-                'rules' => true,
-            ),
-            'public' => array
-            (
-                //'rules' => true,
-                'type' => 'textarea',
-            ),
-            'private' => array
-            (
-                //'rules' => true,
-                'type' => 'textarea',
-            ),
-        ),
-    ),
-);
+<?php
+$account_id = Dever::input('set')['account_id'] ?? 0;
+if (!$account_id) {
+    $account_id = Dever::input('field')['account_id'] ?? 0;
+}
+$account = Dever::db('account', 'api')->find($account_id);
+return [
+    'list' => [
+        'where' => ['account_id' => $account_id],
+        'field'      => [
+            'id',
+            'platform_cert_id' => [
+                'show' => 'Dever::call("api/app.getCertName", "{platform_cert_id}")',
+            ],
+            'number',
+            'cdate',
+        ],
+        'data_button' => [
+            '编辑' => ['fastedit', ['account_id' => $account_id]],
+        ],
+        'button' => [
+            '新增' => ['fastadd', ['account_id' => $account_id]],
+        ],
+        'search' => [
+            'account_id' => 'hidden',
+            'number',
+        ],
+    ],
+    'update' => [
+        'desc' => '有的证书会自动同步,无需手动添加,如微信支付的平台证书',
+        'field'    => [
+            'account_id' => 'hidden',
+            'platform_cert_id' => [
+                'rules' => true,
+                'type' => 'select',
+                'option'     => 'Dever::call("api/app.getCert", '.$account['platform_id'].')',
+                //'remote' => 'api/manage.getCertName',
+                //'remote_default' => false,
+            ],
+            'number' => [
+                'rules' => true,
+            ],
+            'public' => [
+                //'rules' => true,
+                'type' => 'textarea',
+            ],
+            'private' => [
+                //'rules' => true,
+                'type' => 'textarea',
+            ],
+        ],
+    ],
+];

+ 23 - 28
manage/account_setting.php

@@ -1,28 +1,23 @@
-<?php
-$account_id = Dever::input('id');
-$account = Dever::db('account', 'api')->find($account_id);
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'platform_setting_id' => 'hidden',
-            'platform_setting_name' => array
-            (
-                'name' => '参数名',
-                'type' => 'show',
-                'default' => 'Dever::call("api/platform_setting-find", "{platform_setting_id}")["name"]',
-                //'disable' => true,
-                //'option'     => 'Dever::call("api/app.getSetting", '.$account['platform_id'].')',
-                //'remote' => 'api/manage.getSettingName',
-                //'remote_default' => false,
-            ),
-            'value' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-        ),
-    ),
-);
+<?php
+$account_id = Dever::input('id');
+$account = Dever::db('account', 'api')->find($account_id);
+return [
+    'update' => [
+        'field'    => [
+            'platform_setting_id' => 'hidden',
+            'platform_setting_name' => [
+                'name' => '参数名',
+                'type' => 'show',
+                'default' => 'Dever::call("api/platform_setting-find", "{platform_setting_id}")["name"]',
+                //'disable' => true,
+                //'option'     => 'Dever::call("api/app.getSetting", '.$account['platform_id'].')',
+                //'remote' => 'api/manage.getSettingName',
+                //'remote_default' => false,
+            ],
+            'value' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+        ],
+    ],
+];

+ 167 - 200
manage/api.php

@@ -1,201 +1,168 @@
-<?php
-$platform_id = Dever::input('set')['platform_id'] ?? 0;
-if (!$platform_id) {
-    $platform_id = Dever::input('field')['platform_id'] ?? 0;
-}
-$platform = include('platform.php');
-$config = array
-(
-    'list' => array
-    (
-        'where' => array('platform_id' => $platform_id),
-        'field'      => array
-        (
-            //'id',
-            'sort' => 'input',
-            'name',
-            'uri',
-            'env',
-            'platform_id',
-            'status' => array
-            (
-                'type' => 'switch',
-                'show'  => '{status}',
-                'active_value' => 1,
-                'inactive_value' => 2,
-            ),
-        ),
-        'data_button' => array
-        (
-            '设置' => array('edit', array('platform_id' => $platform_id)),
-            //'删除' => 'delete',
-            '复制' => array('api', 'api/manage.copyApi'),
-        ),
-        'button' => array
-        (
-            '新增' => array('fastadd', array('platform_id' => $platform_id, 'field' => 'name,env,platform_id,uri')),
-        ),
-        'search' => array
-        (
-            'platform_id' => array
-            (
-                'type' => 'hidden',
-                'default' => $platform_id,
-            ),
-            'name',
-            'uri',
-            'status',
-        ),
-    ),
-    'update' => array
-    (
-        'end' => 'api/app.updateApi',
-        'desc' => $platform['update']['desc'],
-        'tab' => array
-        (
-            '基本设置' => 'name,env,api/api_setting',
-            '请求地址' => 'uri,method,post_method,api/api_path,api/api_query',
-            '请求参数' => 'api/api_request_header,api/api_request_body',
-            '响应参数' => 'api/api_response_header,api/api_response_body',
-            
-            '存储设置' => 'api/api_save',
-            '回调设置' => 'notify,api/api_notify,api/api_notify_body,api/api_notify_code',
-            //'价格设置' => 'spec_type,api/sku,api/sku#',
-            //'输入输出' => 'api/api_request_input,api/api_request_output',
-        ),
-        'field'    => array
-        (
-            'name',
-            'env' => 'radio',
-            'platform_id' => array
-            (
-                'desc' => '【提交后不能更改】',
-            ),
-            'uri',
-            'api/api_path' => array
-            (
-                'name' => '接口路径',
-                'where'  => array('api_id' => 'id'),
-                'desc' => '填写接口上的路径path参数',
-            ),
-            'api/api_query' => array
-            (
-                'name' => '接口查询参数',
-                'where'  => array('api_id' => 'id'),
-                'desc' => '填写接口上的query参数',
-            ),
-
-            'api/api_setting' => array
-            (
-                'name' => '基础参数',
-                'where'  => array('api_id' => 'id'),
-                'desc' => '设置仅限该接口使用的参数,用于定义一些特殊的参数',
-            ),
-
-            'method' => array
-            (
-                'type' => 'radio',
-                'control' => true,
-            ),
-            'post_method' => array
-            (
-                'type' => 'radio',
-                'show' => false,
-            ),
-            'api/api_request_body' => array
-            (
-                'name' => '请求体',
-                'where'  => array('api_id' => 'id'),
-            ),
-            'api/api_request_header' => array
-            (
-                'name' => '请求头',
-                'where'  => array('api_id' => 'id'),
-            ),
-
-            'api/api_response_body' => array
-            (
-                'name' => '响应体',
-                'desc' => '填写后,平台中的标准响应体将失效,并且只保留填写后的响应体,格式:data[].name,不是列表则为data.name',
-                'where'  => array('api_id' => 'id'),
-            ),
-
-            'api/api_response_header' => array
-            (
-                'name' => '响应头',
-                'desc' => '填写后,平台中的标准响应头将失效,不填写不保留响应头,格式:data[].name,不是列表则为data.name',
-                'where'  => array('api_id' => 'id'),
-            ),
-
-            'api/api_save' => array
-            (
-                'name' => '存储设置',
-                'desc' => '用于将响应数据保存到数据表中,该数据表最好有api_id(int)和request_id(varchar)字段,用于区分是哪个接口哪次请求,当然也可以没有',
-                'where'  => array('api_id' => 'id'),
-            ),
-
-            'notify' => array
-            (
-                'type' => 'radio',
-                'control' => true,
-            ),
-            /*
-            #也可以这样设置
-            'api/api_notify#' => array
-            (
-                'field' => 'sign_arg',
-                'name' => '签名参数',
-                'where'  => array('api_id' => 'id'),
-            ),
-            'api/api_notify##' => array
-            (
-                'field' => 'sign_id',
-                'name' => '签名',
-                'where'  => array('api_id' => 'id'),
-            ),*/
-            'api/api_notify' => array
-            (
-                'name' => '基本设置',
-                'where'  => array('api_id' => 'id'),
-                'default' => array(array()),
-                # 默认使用表格形式展示,可以改成每行展示
-                #'type' => 'line',
-            ),
-            'api/api_notify_body' => array
-            (
-                'name' => '参数设置',
-                'where'  => array('api_id' => 'id'),
-            ),
-            'api/api_notify_code' => array
-            (
-                'name' => '状态码',
-                'where'  => array('api_id' => 'id'),
-            ),
-        ),
-
-        'control' => array
-        (
-            'post_method' => array
-            (
-                'method' => 2,
-            ),
-            'api/api_notify' => array
-            (
-                'notify' => 1,
-            ),
-            'api/api_notify_body' => array
-            (
-                'notify' => 1,
-            ),
-            'api/api_notify_code' => array
-            (
-                'notify' => 1,
-            ),
-        ),
-    ),
-);
-$id = Dever::input('id');
-if (!$id) {
-    unset($config['update']['tab']);
-}
+<?php
+$platform_id = Dever::input('set')['platform_id'] ?? 0;
+if (!$platform_id) {
+    $platform_id = Dever::input('field')['platform_id'] ?? 0;
+}
+$platform = include('platform.php');
+$config = [
+    'list' => [
+        'where' => ['platform_id' => $platform_id],
+        'field'      => [
+            //'id',
+            'sort' => 'input',
+            'name',
+            'uri',
+            'env',
+            'platform_id',
+            'status' => [
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ],
+        ],
+        'data_button' => [
+            '设置' => ['edit', ['platform_id' => $platform_id]],
+            //'删除' => 'delete',
+            '复制' => ['api', 'api/manage.copyApi'],
+        ],
+        'button' => [
+            '新增' => ['fastadd', ['platform_id' => $platform_id, 'field' => 'name,env,platform_id,uri']],
+        ],
+        'search' => [
+            'platform_id' => [
+                'type' => 'hidden',
+                'default' => $platform_id,
+            ],
+            'name',
+            'uri',
+            'status',
+        ],
+    ],
+    'update' => [
+        'end' => 'api/app.updateApi',
+        'desc' => $platform['update']['desc'],
+        'tab' => [
+            '基本设置' => 'name,env,api/api_setting',
+            '请求地址' => 'uri,method,post_method,api/api_path,api/api_query',
+            '请求参数' => 'api/api_request_header,api/api_request_body',
+            '响应参数' => 'api/api_response_header,api/api_response_body',
+            
+            '存储设置' => 'api/api_save',
+            '回调设置' => 'notify,api/api_notify,api/api_notify_body,api/api_notify_code',
+            //'价格设置' => 'spec_type,api/sku,api/sku#',
+            //'输入输出' => 'api/api_request_input,api/api_request_output',
+        ],
+        'field'    => [
+            'name',
+            'env' => 'radio',
+            'platform_id' => [
+                'desc' => '【提交后不能更改】',
+            ],
+            'uri',
+            'api/api_path' => [
+                'name' => '接口路径',
+                'where'  => ['api_id' => 'id'],
+                'desc' => '填写接口上的路径path参数',
+            ],
+            'api/api_query' => [
+                'name' => '接口查询参数',
+                'where'  => ['api_id' => 'id'],
+                'desc' => '填写接口上的query参数',
+            ],
+
+            'api/api_setting' => [
+                'name' => '基础参数',
+                'where'  => ['api_id' => 'id'],
+                'desc' => '设置仅限该接口使用的参数,用于定义一些特殊的参数',
+            ],
+
+            'method' => [
+                'type' => 'radio',
+                'control' => true,
+            ],
+            'post_method' => [
+                'type' => 'radio',
+                'show' => false,
+            ],
+            'api/api_request_body' => [
+                'name' => '请求体',
+                'where'  => ['api_id' => 'id'],
+            ],
+            'api/api_request_header' => [
+                'name' => '请求头',
+                'where'  => ['api_id' => 'id'],
+            ],
+
+            'api/api_response_body' => [
+                'name' => '响应体',
+                'desc' => '填写后,平台中的标准响应体将失效,并且只保留填写后的响应体,格式:data[].name,不是列表则为data.name',
+                'where'  => ['api_id' => 'id'],
+            ],
+
+            'api/api_response_header' => [
+                'name' => '响应头',
+                'desc' => '填写后,平台中的标准响应头将失效,不填写不保留响应头,格式:data[].name,不是列表则为data.name',
+                'where'  => ['api_id' => 'id'],
+            ],
+
+            'api/api_save' => [
+                'name' => '存储设置',
+                'desc' => '用于将响应数据保存到数据表中,该数据表最好有api_id(int)和request_id(varchar)字段,用于区分是哪个接口哪次请求,当然也可以没有',
+                'where'  => ['api_id' => 'id'],
+            ],
+
+            'notify' => [
+                'type' => 'radio',
+                'control' => true,
+            ],
+            /*
+            #也可以这样设置
+            'api/api_notify#' => [
+                'field' => 'sign_arg',
+                'name' => '签名参数',
+                'where'  => ['api_id' => 'id'],
+            ],
+            'api/api_notify##' => [
+                'field' => 'sign_id',
+                'name' => '签名',
+                'where'  => ['api_id' => 'id'],
+            ],*/
+            'api/api_notify' => [
+                'name' => '基本设置',
+                'where'  => ['api_id' => 'id'],
+                'default' => [[]],
+                # 默认使用表格形式展示,可以改成每行展示
+                #'type' => 'line',
+            ],
+            'api/api_notify_body' => [
+                'name' => '参数设置',
+                'where'  => ['api_id' => 'id'],
+            ],
+            'api/api_notify_code' => [
+                'name' => '状态码',
+                'where'  => ['api_id' => 'id'],
+            ],
+        ],
+
+        'control' => [
+            'post_method' => [
+                'method' => 2,
+            ],
+            'api/api_notify' => [
+                'notify' => 1,
+            ],
+            'api/api_notify_body' => [
+                'notify' => 1,
+            ],
+            'api/api_notify_code' => [
+                'notify' => 1,
+            ],
+        ],
+    ],
+];
+$id = Dever::input('id');
+if (!$id) {
+    unset($config['update']['tab']);
+}
 return $config;

+ 29 - 36
manage/api_notify.php

@@ -1,36 +1,29 @@
-<?php
-$platform_id = Dever::input('set')['platform_id'] ?? 0;
-if (!$platform_id) {
-    $platform_id = Dever::input('field')['platform_id'] ?? 0;
-}
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'sign_id' => array
-            (
-                'type' => 'select',
-                'option'     => 'Dever::call("api/util.getPlatformSign", '.$platform_id.')',
-                'clearable' => true,
-                'default' => '',
-            ),
-            'sign_arg' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'success' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'error' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-        ),
-    ),
-);
+<?php
+$platform_id = Dever::input('set')['platform_id'] ?? 0;
+if (!$platform_id) {
+    $platform_id = Dever::input('field')['platform_id'] ?? 0;
+}
+return [
+    'update' => [
+        'field'    => [
+            'sign_id' => [
+                'type' => 'select',
+                'option'     => 'Dever::call("api/util.getPlatformSign", '.$platform_id.')',
+                'clearable' => true,
+                'default' => '',
+            ],
+            'sign_arg' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'success' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'error' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+        ],
+    ],
+];

+ 10 - 13
manage/api_notify_code.php

@@ -1,13 +1,10 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'key',
-            'value',
-            'type',
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'key',
+            'value',
+            'type',
+        ],
+    ],
+];

+ 11 - 14
manage/api_path.php

@@ -1,14 +1,11 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'key',
-            'value',
-            'type',
-        ),
-        'drag' => 'sort',
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'key',
+            'value',
+            'type',
+        ],
+        'drag' => 'sort',
+    ],
+];

+ 17 - 22
manage/api_save.php

@@ -1,22 +1,17 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'table',
-            'key' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'value' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'type',
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'table',
+            'key' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'value' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'type',
+        ],
+    ],
+];

+ 44 - 57
manage/app.php

@@ -1,57 +1,44 @@
-<?php
-return array
-(
-    'list' => array
-    (
-        'field'      => array
-        (
-            'id',
-            'name',
-            'sort' => 'input',
-            'status' => array
-            (
-                'type' => 'switch',
-                'show'  => '{status}',
-                'active_value' => 1,
-                'inactive_value' => 2,
-            ),
-            'cdate',
-        ),
-        'button' => array
-        (
-            '新增' => 'fastadd',
-        ),
-        'data_button' => array
-        (
-            '编辑' => 'fastedit',
-            '功能' => array('route', array
-            (
-                'path' => 'api_manage/app_func',
-                'param' => array
-                (
-                    'set' => array('app_id' => 'id', 'menu' => 'api_manage/app', 'parent' => 'api_manage/app'),
-                ),
-            )),
-        ),
-        'search'    => array
-        (
-            'name',
-            'status',
-        ),
-    ),
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name' => array
-            (
-                'rules' => true,
-            ),
-            'desc' => 'textarea',
-            'status' => array
-            (
-                'type' => 'radio',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'list' => [
+        'field'      => [
+            'id',
+            'name',
+            'sort' => 'input',
+            'status' => [
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ],
+            'cdate',
+        ],
+        'button' => [
+            '新增' => 'fastadd',
+        ],
+        'data_button' => [
+            '编辑' => 'fastedit',
+            '功能' => ['route', [
+                'path' => 'api_manage/app_func',
+                'param' => [
+                    'set' => ['app_id' => 'id', 'menu' => 'api_manage/app', 'parent' => 'api_manage/app'],
+                ],
+            ]],
+        ],
+        'search'    => [
+            'name',
+            'status',
+        ],
+    ],
+    'update' => [
+        'field'    => [
+            'name' => [
+                'rules' => true,
+            ],
+            'desc' => 'textarea',
+            'status' => [
+                'type' => 'radio',
+            ],
+        ],
+    ],
+];

+ 116 - 141
manage/app_func.php

@@ -1,141 +1,116 @@
-<?php
-$app_id = Dever::input('set')['app_id'] ?? 0;
-return array
-(
-    'list' => array
-    (
-        'where' => array('app_id' => $app_id),
-        'field'      => array
-        (
-            'id',
-            'name',
-            'key',
-            'type',
-            'status' => array
-            (
-                'type' => 'switch',
-                'show'  => '{status}',
-                'active_value' => 1,
-                'inactive_value' => 2,
-            ),
-            'cdate',
-        ),
-        'data_button' => array
-        (
-            '编辑' => array('edit', array('app_id' => $app_id)),
-        ),
-        'button' => array
-        (
-            '新增' => array('add', array('app_id' => $app_id)),
-        ),
-        'search' => array
-        (
-            'app_id' => 'hidden',
-            'name',
-            'key',
-            'type',
-        ),
-    ),
-    'update' => array
-    (
-        'end' => 'api/app.update',
-        'tab' => array
-        (
-            '基本设置' => 'app_id,name,key,desc,cron_date,cron_time',
-            '接口设置' => 'type,api/app_func_work',
-            '价格设置' => 'spec_type,api/sku,api/sku#',
-            '输入输出' => 'api/app_func_input,api/app_func_output',
-        ),
-        'field'    => array
-        (
-            'app_id' => 'hidden',
-            'name',
-            'type',
-            'key' => array
-            (
-                'tips' => '如果为空,将自动按照名称拼音生成',
-            ),
-            'desc' => 'textarea',
-            'status' => array
-            (
-                'type' => 'radio',
-            ),
-            'cron_date' => array
-            (
-                'type' => 'date',
-                'date_type' => 'datetime',
-            ),
-            'cron_time' => array
-            (
-                'type' => 'text',
-                'desc' => '直接输入秒数,如60,就是间隔60秒执行一次,为0则不定时执行',
-            ),
-            'api/app_func_work' => array
-            (
-                'name' => '功能接口',
-                'desc' => '设置功能包含的接口',
-                'where'  => array('app_func_id' => 'id'),
-            ),
-
-            'spec_type' => array
-            (
-                'type' => 'radio',
-                'control' => true,
-            ),
-            'api/sku' => array
-            (
-                'name' => '单规格设置',
-                'where'  => array('app_func_id' => 'id', 'key' => '-1'),
-                # 默认值,如果有默认值则无法添加和删除
-                'default' => array
-                (
-                    # 默认值
-                    array
-                    (
-                        'key' => '-1',
-                        'price' => '',
-                        'num' => '',
-                        'day_num' => '',
-                    ),
-                ),
-            ),
-
-            'api/sku#' => array
-            (
-                'name' => '多规格设置',
-                'where' => array('app_func_id' => 'id', 'key' => array('!=', '-1')),
-                'type' => 'sku',
-                # 设置规格表名
-                'spec' => 'api/spec',
-                # 设置规格表关联字段
-                'spec_field' => 'app_func_id',
-                # 获取规格数据的接口
-                'spec_data' => 'api/spec.manage',
-            ),
-
-            'api/app_func_input' => array
-            (
-                'name' => '参数输入',
-                'where'  => array('app_func_id' => 'id'),
-                'desc' => '[参数名:对应接口中的请求参数名,默认值/可选项:可以多行输入,默认值为第一行,其他行为可选项]',
-            ),
-            'api/app_func_output' => array
-            (
-                'name' => '参数输出',
-                'where'  => array('app_func_id' => 'id'),
-            ),
-        ),
-        'control' => array
-        (
-            'api/sku' => array
-            (
-                'spec_type' => 2,
-            ),
-
-            'api/sku#' => array
-            (
-                'spec_type' => 3,
-            ),
-        ),
-    ),
-);
+<?php
+$app_id = Dever::input('set')['app_id'] ?? 0;
+return [
+    'list' => [
+        'where' => ['app_id' => $app_id],
+        'field'      => [
+            'id',
+            'name',
+            'key',
+            'type',
+            'status' => [
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ],
+            'cdate',
+        ],
+        'data_button' => [
+            '编辑' => ['edit', ['app_id' => $app_id]],
+        ],
+        'button' => [
+            '新增' => ['add', ['app_id' => $app_id]],
+        ],
+        'search' => [
+            'app_id' => 'hidden',
+            'name',
+            'key',
+            'type',
+        ],
+    ],
+    'update' => [
+        'end' => 'api/app.update',
+        'tab' => [
+            '基本设置' => 'app_id,name,key,desc,cron_date,cron_time',
+            '接口设置' => 'type,api/app_func_work',
+            '价格设置' => 'spec_type,api/sku,api/sku#',
+            '输入输出' => 'api/app_func_input,api/app_func_output',
+        ],
+        'field'    => [
+            'app_id' => 'hidden',
+            'name',
+            'type',
+            'key' => [
+                'tips' => '如果为空,将自动按照名称拼音生成',
+            ],
+            'desc' => 'textarea',
+            'status' => [
+                'type' => 'radio',
+            ],
+            'cron_date' => [
+                'type' => 'date',
+                'date_type' => 'datetime',
+            ],
+            'cron_time' => [
+                'type' => 'text',
+                'desc' => '直接输入秒数,如60,就是间隔60秒执行一次,为0则不定时执行',
+            ],
+            'api/app_func_work' => [
+                'name' => '功能接口',
+                'desc' => '设置功能包含的接口',
+                'where'  => ['app_func_id' => 'id'],
+            ],
+
+            'spec_type' => [
+                'type' => 'radio',
+                'control' => true,
+            ],
+            'api/sku' => [
+                'name' => '单规格设置',
+                'where'  => ['app_func_id' => 'id', 'key' => '-1'],
+                # 默认值,如果有默认值则无法添加和删除
+                'default' => [
+                    # 默认值
+                    [
+                        'key' => '-1',
+                        'price' => '',
+                        'num' => '',
+                        'day_num' => '',
+                    ],
+                ],
+            ],
+
+            'api/sku#' => [
+                'name' => '多规格设置',
+                'where' => ['app_func_id' => 'id', 'key' => ['!=', '-1']],
+                'type' => 'sku',
+                # 设置规格表名
+                'spec' => 'api/spec',
+                # 设置规格表关联字段
+                'spec_field' => 'app_func_id',
+                # 获取规格数据的接口
+                'spec_data' => 'api/spec.manage',
+            ],
+
+            'api/app_func_input' => [
+                'name' => '参数输入',
+                'where'  => ['app_func_id' => 'id'],
+                'desc' => '[参数名:对应接口中的请求参数名,默认值/可选项:可以多行输入,默认值为第一行,其他行为可选项]',
+            ],
+            'api/app_func_output' => [
+                'name' => '参数输出',
+                'where'  => ['app_func_id' => 'id'],
+            ],
+        ],
+        'control' => [
+            'api/sku' => [
+                'spec_type' => 2,
+            ],
+
+            'api/sku#' => [
+                'spec_type' => 3,
+            ],
+        ],
+    ],
+];

+ 28 - 35
manage/app_func_input.php

@@ -1,35 +1,28 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'key' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'option' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'type',
-            'match' => array
-            (
-                'width' => '40',
-                'type' => 'switch',
-                'show'  => '{match}',
-                'active_value' => 1,
-                'inactive_value' => 2,
-            ),
-        ),
-        'drag' => 'sort',
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'name' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'key' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'option' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'type',
+            'match' => [
+                'width' => '40',
+                'type' => 'switch',
+                'show'  => '{match}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];

+ 20 - 26
manage/app_func_output.php

@@ -1,26 +1,20 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'key' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'data' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-        ),
-        'drag' => 'sort',
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'name' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'key' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'data' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];

+ 28 - 34
manage/app_func_work.php

@@ -1,34 +1,28 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'platform_id' => array
-            (
-                'rules' => true,
-                'type' => 'select',
-                'remote'    => 'api/manage.getApi',
-                # 无需默认值
-                'remote_default' => false,
-            ),
-            'api_id' => array
-            (
-                'rules' => true,
-                'type' => 'select',
-                'placeholder' => '选择接口',
-            ),
-            /*
-            'status' => array
-            (
-                'width' => '40',
-                'type' => 'switch',
-                'show'  => '{status}',
-                'active_value' => 1,
-                'inactive_value' => 2,
-            ),*/
-        ),
-        'drag' => 'sort',
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'platform_id' => [
+                'rules' => true,
+                'type' => 'select',
+                'remote'    => 'api/manage.getApi',
+                # 无需默认值
+                'remote_default' => false,
+            ],
+            'api_id' => [
+                'rules' => true,
+                'type' => 'select',
+                'placeholder' => '选择接口',
+            ],
+            /*
+            'status' => [
+                'width' => '40',
+                'type' => 'switch',
+                'show'  => '{status}',
+                'active_value' => 1,
+                'inactive_value' => 2,
+            ],*/
+        ],
+        'drag' => 'sort',
+    ],
+];

+ 88 - 101
manage/core.php

@@ -1,101 +1,88 @@
-<?php
-return array
-(
-    'menu' => array
-    (
-        'connect' => array
-        (
-            'name' => '万接',
-            'icon' => 'contacts-line',
-            'sort' => '900',
-            'module' => 'platform',
-            'app' => 'api',
-        ),
-
-        'api_manage' => array
-        (
-            'parent' => 'connect',
-            'name' => '核心设置',
-            'icon' => 'compasses-line',
-            'sort' => '1',
-        ),
-
-        'platform' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '平台管理',
-            'icon'      => 'tools-line',
-            'sort'      => '3',
-        ),
-
-        'format' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '参数格式转换',
-            'icon'      => 'tools-line',
-            'sort'      => '4',
-            'show'      => 3,
-        ),
-
-        'api' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '平台接口管理',
-            'icon'      => 'tools-line',
-            'sort'      => '4',
-            'show'      => 3,
-        ),
-
-        'platform_ssl' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '平台加密管理',
-            'icon'      => 'tools-line',
-            'sort'      => '5',
-            'show'      => 3,
-        ),
-
-        'platform_sign' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '平台签名管理',
-            'icon'      => 'tools-line',
-            'sort'      => '6',
-            'show'      => 3,
-        ),
-
-        'app' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '应用管理',
-            'icon'      => 'file-list-2-line',
-            'sort'      => '7',
-        ),
-
-        'app_func' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '应用功能管理',
-            'icon'      => 'file-list-2-line',
-            'sort'      => '8',
-            'show'      => 3,
-        ),
-
-        'account' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '账户管理',
-            'icon'      => 'contacts-line',
-            'sort'      => '9',
-        ),
-
-        'account_cert' => array
-        (
-            'parent'    => 'api_manage',
-            'name'      => '账户证书',
-            'icon'      => 'contacts-line',
-            'sort'      => '10',
-            'show'      => 3,
-        ),
-    ),
-);
+<?php
+return [
+    'menu' => [
+        'connect' => [
+            'name' => '万接',
+            'icon' => 'contacts-line',
+            'sort' => '900',
+            'module' => 'platform',
+            'app' => 'api',
+        ],
+
+        'api_manage' => [
+            'parent' => 'connect',
+            'name' => '核心设置',
+            'icon' => 'compasses-line',
+            'sort' => '1',
+        ],
+
+        'platform' => [
+            'parent'    => 'api_manage',
+            'name'      => '平台管理',
+            'icon'      => 'tools-line',
+            'sort'      => '3',
+        ],
+
+        'format' => [
+            'parent'    => 'api_manage',
+            'name'      => '参数格式转换',
+            'icon'      => 'tools-line',
+            'sort'      => '4',
+            'show'      => 3,
+        ],
+
+        'api' => [
+            'parent'    => 'api_manage',
+            'name'      => '平台接口管理',
+            'icon'      => 'tools-line',
+            'sort'      => '4',
+            'show'      => 3,
+        ],
+
+        'platform_ssl' => [
+            'parent'    => 'api_manage',
+            'name'      => '平台加密管理',
+            'icon'      => 'tools-line',
+            'sort'      => '5',
+            'show'      => 3,
+        ],
+
+        'platform_sign' => [
+            'parent'    => 'api_manage',
+            'name'      => '平台签名管理',
+            'icon'      => 'tools-line',
+            'sort'      => '6',
+            'show'      => 3,
+        ],
+
+        'app' => [
+            'parent'    => 'api_manage',
+            'name'      => '应用管理',
+            'icon'      => 'file-list-2-line',
+            'sort'      => '7',
+        ],
+
+        'app_func' => [
+            'parent'    => 'api_manage',
+            'name'      => '应用功能管理',
+            'icon'      => 'file-list-2-line',
+            'sort'      => '8',
+            'show'      => 3,
+        ],
+
+        'account' => [
+            'parent'    => 'api_manage',
+            'name'      => '账户管理',
+            'icon'      => 'contacts-line',
+            'sort'      => '9',
+        ],
+
+        'account_cert' => [
+            'parent'    => 'api_manage',
+            'name'      => '账户证书',
+            'icon'      => 'contacts-line',
+            'sort'      => '10',
+            'show'      => 3,
+        ],
+    ],
+];

+ 32 - 42
manage/format.php

@@ -1,42 +1,32 @@
-<?php
-return array
-(
-    'list' => array
-    (
-        'field'      => array
-        (
-            'id',
-            'name',
-            'sort' => 'input',
-            'cdate',
-        ),
-        'button' => array
-        (
-            '新增' => 'fastadd',
-        ),
-        'data_button' => array
-        (
-            '编辑' => 'fastedit',
-        ),
-        'search' => array
-        (
-            'name',
-        ),
-    ),
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name' => array
-            (
-                'rules' => true,
-            ),
-            'method' => array
-            (
-                'rules' => true,
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 6),
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'list' => [
+        'field'      => [
+            'id',
+            'name',
+            'sort' => 'input',
+            'cdate',
+        ],
+        'button' => [
+            '新增' => 'fastadd',
+        ],
+        'data_button' => [
+            '编辑' => 'fastedit',
+        ],
+        'search' => [
+            'name',
+        ],
+    ],
+    'update' => [
+        'field'    => [
+            'name' => [
+                'rules' => true,
+            ],
+            'method' => [
+                'rules' => true,
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 6],
+            ],
+        ],
+    ],
+];

+ 123 - 152
manage/platform.php

@@ -1,153 +1,124 @@
-<?php
-$config = array
-(
-    'source' => 'api/platform',
-    'list' => array
-    (
-        'field'      => array
-        (
-            'id',
-            'name',
-            'host',
-        ),
-        'data_button' => array
-        (
-            '设置' => 'edit',
-            '加密' => array('route', array
-            (
-                'path' => 'api_manage/platform_ssl',
-                'param' => array
-                (
-                    'set' => array('platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
-                ),
-            )),
-            '签名' => array('route', array
-            (
-                'path' => 'api_manage/platform_sign',
-                'param' => array
-                (
-                    'set' => array('platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
-                ),
-            )),
-            '接口' => array('route', array
-            (
-                'path' => 'api_manage/api',
-                'param' => array
-                (
-                    'set' => array('platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
-                ),
-            )),
-        ),
-        'button' => array
-        (
-            '新增' => array('fastadd', 'name,host'),
-            '定义格式转换' => array('route', array
-            (
-                'path' => 'api_manage/format',
-                'param' => array
-                (
-                    'set' => array('menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
-                ),
-            )),
-        ),
-        'search' => array
-        (
-            'name',
-        ),
-    ),
-    'update' => array
-    (
-        'desc' => "所有参数定义后均可以直接使用,也支持函数,参数值可以是变量、函数、字符串,如果函数中或者字符串中需要增加变量或者常量,请用{}隔开,默认常量:method请求方式,url请求完整地址,host主机域名,uri请求路径,time秒时间戳,timestamp毫秒时间戳,nonce随机值,notify请求回调地址,order_num请求订单号,sign签名信息,aad签名附加数据,query请求查询参数,query_json请求查询参数(json格式),body请求体参数,body_json请求体参数(json格式),header请求头参数,header_json请求头参数(json格式)",
-        'tab' => array
-        (
-            '基本设置' => 'name,host,api/platform_setting,api/platform_cert',
-            '标准请求' => 'method,post_method,api/platform_request_header,api/platform_request_body',
-            '标准响应' => 'response_type,api/platform_response_header,api/platform_response_body,api/platform_response_code',
-        ),
-        'field'    => array
-        (
-            'name',
-            'host',
-            'method' => array
-            (
-                'type' => 'radio',
-                'control' => true,
-            ),
-            'post_method' => array
-            (
-                'type' => 'radio',
-            ),
-
-            'api/platform_setting' => array
-            (
-                'name' => '账户参数',
-                'desc' => '设置账户需要的参数',
-                'where'  => array('platform_id' => 'id'),
-            ),
-
-            'api/platform_cert' => array
-            (
-                'name' => '账户证书',
-                'desc' => '设置账户需要的证书',
-                'where'  => array('platform_id' => 'id'),
-            ),
-
-            'api/platform_request_body' => array
-            (
-                'name' => '请求体设置',
-                'desc' => '设置平台标准请求体',
-                'where'  => array('platform_id' => 'id'),
-            ),
-            'api/platform_request_header' => array
-            (
-                'name' => '请求头设置',
-                'desc' => '设置平台标准请求头',
-                'where'  => array('platform_id' => 'id'),
-            ),
-
-            'response_type' => 'radio',
-
-            'api/platform_response_body' => array
-            (
-                'name' => '标准响应体',
-                'desc' => '设置平台标准响应体,填写后,将只保留填写后的响应体,格式:data[].name,不是列表则为data.name,如果填写了“数据字段”,这里仅返回“数据字段”里的数据',
-                'where'  => array('platform_id' => 'id'),
-            ),
-            'api/platform_response_header' => array
-            (
-                'name' => '标准响应头',
-                'desc' => '设置平台标准响应头,不填写不保留响应头,格式:data[].name,不是列表则为data.name',
-                'where'  => array('platform_id' => 'id'),
-            ),
-
-            'api/platform_response_code' => array
-            (
-                'name' => '响应状态码',
-                'desc' => '设置标准的响应状态码,也可以只设置成功值,其他值均为失败',
-                'where'  => array('platform_id' => 'id'),
-            ),
-
-            'api/platform_convert' => array
-            (
-                'name' => '字段转换',
-                'where'  => array('platform_id' => 'id'),
-                'desc' => '设置之后,所有平台过来的字段,都将按照这个转换规则进行转换',
-            ),
-        ),
-
-        'control' => array
-        (
-            'post_method' => array
-            (
-                'method' => 2,
-            ),
-        ),
-    ),
-);
-$id = Dever::input('id');
-$load = Dever::input('load');
-if (($load == '/api_manage/platform' || $load == '/api_manage/api') && !$id) {
-    $config['update']['desc'] = '';
-    unset($config['update']['tab']);
-}
+<?php
+$config = [
+    'source' => 'api/platform',
+    'list' => [
+        'field'      => [
+            'id',
+            'name',
+            'host',
+        ],
+        'data_button' => [
+            '设置' => 'edit',
+            '加密' => ['route', [
+                'path' => 'api_manage/platform_ssl',
+                'param' => [
+                    'set' => ['platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'],
+                ],
+            ]],
+            '签名' => ['route', [
+                'path' => 'api_manage/platform_sign',
+                'param' => [
+                    'set' => ['platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'],
+                ],
+            ]],
+            '接口' => ['route', [
+                'path' => 'api_manage/api',
+                'param' => [
+                    'set' => ['platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'],
+                ],
+            ]],
+        ],
+        'button' => [
+            '新增' => ['fastadd', 'name,host'],
+            '定义格式转换' => ['route', [
+                'path' => 'api_manage/format',
+                'param' => [
+                    'set' => ['menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'],
+                ],
+            ]],
+        ],
+        'search' => [
+            'name',
+        ],
+    ],
+    'update' => [
+        'desc' => "所有参数定义后均可以直接使用,也支持函数,参数值可以是变量、函数、字符串,如果函数中或者字符串中需要增加变量或者常量,请用{}隔开,默认常量:method请求方式,url请求完整地址,host主机域名,uri请求路径,time秒时间戳,timestamp毫秒时间戳,nonce随机值,notify请求回调地址,order_num请求订单号,sign签名信息,aad签名附加数据,query请求查询参数,query_json请求查询参数(json格式),body请求体参数,body_json请求体参数(json格式),header请求头参数,header_json请求头参数(json格式)",
+        'tab' => [
+            '基本设置' => 'name,host,api/platform_setting,api/platform_cert',
+            '标准请求' => 'method,post_method,api/platform_request_header,api/platform_request_body',
+            '标准响应' => 'response_type,api/platform_response_header,api/platform_response_body,api/platform_response_code',
+        ],
+        'field'    => [
+            'name',
+            'host',
+            'method' => [
+                'type' => 'radio',
+                'control' => true,
+            ],
+            'post_method' => [
+                'type' => 'radio',
+            ],
+
+            'api/platform_setting' => [
+                'name' => '账户参数',
+                'desc' => '设置账户需要的参数',
+                'where'  => ['platform_id' => 'id'],
+            ],
+
+            'api/platform_cert' => [
+                'name' => '账户证书',
+                'desc' => '设置账户需要的证书',
+                'where'  => ['platform_id' => 'id'],
+            ],
+
+            'api/platform_request_body' => [
+                'name' => '请求体设置',
+                'desc' => '设置平台标准请求体',
+                'where'  => ['platform_id' => 'id'],
+            ],
+            'api/platform_request_header' => [
+                'name' => '请求头设置',
+                'desc' => '设置平台标准请求头',
+                'where'  => ['platform_id' => 'id'],
+            ],
+
+            'response_type' => 'radio',
+
+            'api/platform_response_body' => [
+                'name' => '标准响应体',
+                'desc' => '设置平台标准响应体,填写后,将只保留填写后的响应体,格式:data[].name,不是列表则为data.name,如果填写了“数据字段”,这里仅返回“数据字段”里的数据',
+                'where'  => ['platform_id' => 'id'],
+            ],
+            'api/platform_response_header' => [
+                'name' => '标准响应头',
+                'desc' => '设置平台标准响应头,不填写不保留响应头,格式:data[].name,不是列表则为data.name',
+                'where'  => ['platform_id' => 'id'],
+            ],
+
+            'api/platform_response_code' => [
+                'name' => '响应状态码',
+                'desc' => '设置标准的响应状态码,也可以只设置成功值,其他值均为失败',
+                'where'  => ['platform_id' => 'id'],
+            ],
+
+            'api/platform_convert' => [
+                'name' => '字段转换',
+                'where'  => ['platform_id' => 'id'],
+                'desc' => '设置之后,所有平台过来的字段,都将按照这个转换规则进行转换',
+            ],
+        ],
+
+        'control' => [
+            'post_method' => [
+                'method' => 2,
+            ],
+        ],
+    ],
+];
+$id = Dever::input('id');
+$load = Dever::input('load');
+if (($load == '/api_manage/platform' || $load == '/api_manage/api') && !$id) {
+    $config['update']['desc'] = '';
+    unset($config['update']['tab']);
+}
 return $config;

+ 11 - 15
manage/platform_cert.php

@@ -1,15 +1,11 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name',
-            'type' => array
-            (
-                'placeholder' => '用以区分不同类别的证书',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'name',
+            'type' => [
+                'placeholder' => '用以区分不同类别的证书',
+            ],
+        ],
+    ],
+];

+ 9 - 12
manage/platform_convert.php

@@ -1,12 +1,9 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'before',
-            'after',
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'before',
+            'after',
+        ],
+    ],
+];

+ 28 - 34
manage/platform_request_body.php

@@ -1,34 +1,28 @@
-<?php
-$platform_id = Dever::input('set')['platform_id'] ?? 0;
-if (!$platform_id) {
-    $platform_id = Dever::input('field')['platform_id'] ?? 0;
-}
-if (!$platform_id) {
-    $platform_id = Dever::input('id');
-}
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'key' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'value' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'type' => array
-            (
-                'type' => 'cascader',
-                'option'    => 'Dever::call("api/util.fieldType", '.$platform_id.')',
-                'clearable' => true,
-            ),
-        ),
-        'drag' => 'sort',
-    ),
-);
+<?php
+$platform_id = Dever::input('set')['platform_id'] ?? 0;
+if (!$platform_id) {
+    $platform_id = Dever::input('field')['platform_id'] ?? 0;
+}
+if (!$platform_id) {
+    $platform_id = Dever::input('id');
+}
+return [
+    'update' => [
+        'field'    => [
+            'key' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'value' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'type' => [
+                'type' => 'cascader',
+                'option'    => 'Dever::call("api/util.fieldType", '.$platform_id.')',
+                'clearable' => true,
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];

+ 13 - 17
manage/platform_response_code.php

@@ -1,17 +1,13 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'key',
-            'value',
-            'type',
-            'msg' => array
-            (
-                'placeholder' => '可以填写字段名',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'key',
+            'value',
+            'type',
+            'msg' => [
+                'placeholder' => '可以填写字段名',
+            ],
+        ],
+    ],
+];

+ 16 - 21
manage/platform_setting.php

@@ -1,21 +1,16 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'name' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-            'key' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-            ),
-        ),
-        'drag' => 'sort',
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'name' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+            'key' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+            ],
+        ],
+        'drag' => 'sort',
+    ],
+];

+ 87 - 104
manage/platform_sign.php

@@ -1,104 +1,87 @@
-<?php
-$platform_id = Dever::input('set')['platform_id'] ?? 0;
-$platform = include('platform.php');
-$encrypt = array
-(
-    -1 => '无需加密',
-    -2 => 'md5',
-    -3 => 'sha256',
-    -4 => 'sha1',
-);
-$platform_id = Dever::input('set')['platform_id'] ?? 0;
-if (!$platform_id) {
-    $platform_id = Dever::input('field')['platform_id'] ?? 0;
-}
-if ($platform_id) {
-    $info = Dever::db('platform_ssl', 'api')->select(['platform_id' => $platform_id]);
-    if ($info) {
-        foreach ($info as $k => $v) {
-            $encrypt[$v['id']] = $v['name'];
-        }
-    }
-}
-return array
-(
-    'list' => array
-    (
-        'where' => array('platform_id' => $platform_id),
-        'field'      => array
-        (
-            'id',
-            'name',
-            //'sort' => 'input',
-            'cdate',
-        ),
-        'data_button' => array
-        (
-            '编辑' => array('edit', array('platform_id' => $platform_id)),
-            '删除' => 'delete',
-        ),
-        'button' => array
-        (
-            '新增' => array('add', array('platform_id' => $platform_id)),
-        ),
-        'search' => array
-        (
-            'platform_id' => 'hidden',
-            'name',
-        ),
-    ),
-    'update' => array
-    (
-        'desc' => $platform['update']['desc'],
-        'tab' => array
-        (
-            '基本设置' => 'platform_id,name,arg,encrypt,after',
-            '键名键值设置' => 'kv_type,kv_sort,kv_value_empty,kv_key_handle,kv_value_handle,kv_join,kv_join_handle',
-        ),
-        'field'    => array
-        (
-            'platform_id' => 'text',
-            'name' => array
-            (
-                'desc' => '填写后,以{签名名称}形式调用',
-            ),
-            'arg' => array
-            (
-                'type' => 'textarea',
-                'autosize' => array('minRows' => 2),
-                'desc' => '按顺序做加密,用换行隔开,为空则所有请求体参数参与签名',
-            ),
-            'encrypt' => array
-            (
-                'type' => 'radio',
-                'option' => $encrypt,
-            ),
-            'after' => array
-            (
-                'type' => 'select',
-                'clearable' => true
-            ),
-
-
-            'kv_type' => 'radio',
-            'kv_sort' => 'radio',
-            'kv_value_empty' => array
-            (
-                'type' => 'radio',
-                'desc' => '【如果参数中有空值,是否参与签名】',
-            ),
-            'kv_key_handle' => array
-            (
-                'type' => 'select',
-                'clearable' => true
-            ),
-            'kv_value_handle' => array
-            (
-                'type' => 'select',
-                'clearable' => true
-            ),
-            'kv_join',
-            'kv_join_handle' => 'radio',
-        ),
-    ),
-);
+<?php
+$platform_id = Dever::input('set')['platform_id'] ?? 0;
+$platform = include('platform.php');
+$encrypt = [
+    -1 => '无需加密',
+    -2 => 'md5',
+    -3 => 'sha256',
+    -4 => 'sha1',
+];
+$platform_id = Dever::input('set')['platform_id'] ?? 0;
+if (!$platform_id) {
+    $platform_id = Dever::input('field')['platform_id'] ?? 0;
+}
+if ($platform_id) {
+    $info = Dever::db('platform_ssl', 'api')->select(['platform_id' => $platform_id]);
+    if ($info) {
+        foreach ($info as $k => $v) {
+            $encrypt[$v['id']] = $v['name'];
+        }
+    }
+}
+return [
+    'list' => [
+        'where' => ['platform_id' => $platform_id],
+        'field'      => [
+            'id',
+            'name',
+            //'sort' => 'input',
+            'cdate',
+        ],
+        'data_button' => [
+            '编辑' => ['edit', ['platform_id' => $platform_id]],
+            '删除' => 'delete',
+        ],
+        'button' => [
+            '新增' => ['add', ['platform_id' => $platform_id]],
+        ],
+        'search' => [
+            'platform_id' => 'hidden',
+            'name',
+        ],
+    ],
+    'update' => [
+        'desc' => $platform['update']['desc'],
+        'tab' => [
+            '基本设置' => 'platform_id,name,arg,encrypt,after',
+            '键名键值设置' => 'kv_type,kv_sort,kv_value_empty,kv_key_handle,kv_value_handle,kv_join,kv_join_handle',
+        ],
+        'field'    => [
+            'platform_id' => 'text',
+            'name' => [
+                'desc' => '填写后,以{签名名称}形式调用',
+            ],
+            'arg' => [
+                'type' => 'textarea',
+                'autosize' => ['minRows' => 2],
+                'desc' => '按顺序做加密,用换行隔开,为空则所有请求体参数参与签名',
+            ],
+            'encrypt' => [
+                'type' => 'radio',
+                'option' => $encrypt,
+            ],
+            'after' => [
+                'type' => 'select',
+                'clearable' => true
+            ],
+
+
+            'kv_type' => 'radio',
+            'kv_sort' => 'radio',
+            'kv_value_empty' => [
+                'type' => 'radio',
+                'desc' => '【如果参数中有空值,是否参与签名】',
+            ],
+            'kv_key_handle' => [
+                'type' => 'select',
+                'clearable' => true
+            ],
+            'kv_value_handle' => [
+                'type' => 'select',
+                'clearable' => true
+            ],
+            'kv_join',
+            'kv_join_handle' => 'radio',
+        ],
+    ],
+];

+ 114 - 143
manage/platform_ssl.php

@@ -1,143 +1,114 @@
-<?php
-$platform_id = Dever::input('set')['platform_id'] ?? 0;
-if (!$platform_id) {
-    $platform_id = Dever::input('field')['platform_id'] ?? 0;
-}
-return array
-(
-    'list' => array
-    (
-        'where' => array('platform_id' => $platform_id),
-        'field'      => array
-        (
-            'id',
-            'name',
-            'type',
-            'cdate',
-        ),
-        'data_button' => array
-        (
-            '编辑' => array('fastedit', array('platform_id' => $platform_id)),
-        ),
-        'button' => array
-        (
-            '新增' => array('fastadd', array('platform_id' => $platform_id)),
-        ),
-        'search' => array
-        (
-            'platform_id' => 'hidden',
-            'name',
-        ),
-    ),
-    'update' => array
-    (
-        'tab' => array
-        (
-            '基本设置' => 'name,type,cipher_algo,option,iv,tag_len,aad,after',
-            '加密设置' => 'encrypt_cert_type,encrypt_cert,encrypt_cert_id',
-            '解密设置' => 'decrypt_cert_type,decrypt_cert,decrypt_cert_id',
-        ),
-
-        'field'    => array
-        (
-            'platform_id' => 'hidden',
-            'name',
-            'type' => 'radio',
-            'cipher_algo' => array
-            (
-                'desc' => '直接填写密码学方式的值,如aes-256-cbc',
-            ),
-            'option' => array
-            (
-                'desc' => '直接输入填充模式的常量即可,如:OPENSSL_NO_PADDING'
-            ),
-            'iv' => array
-            (
-                'desc' => '可以直接使用平台设置中的参数名',
-            ),
-            'tag' => array
-            (
-                'desc' => '可以直接使用平台设置中的参数名',
-            ),
-            'tag_len',
-            'aad' => array
-            (
-                'desc' => '可以直接使用平台设置中的参数名',
-            ),
-            'after' => 'radio',
-
-            'encrypt_cert_type' => 'radio',
-            'encrypt_cert' => array
-            (
-                'type' => 'text',
-                'desc' => '可以直接使用平台设置中的参数名',
-            ),
-            'encrypt_cert_id' => array
-            (
-                'type' => 'select',
-                'option'     => 'Dever::call("api/cert.list", array('.$platform_id.'))',
-            ),
-
-            'decrypt_cert_type' => 'radio',
-            'decrypt_cert' => array
-            (
-                'type' => 'text',
-                'desc' => '可以直接使用平台设置中的参数名',
-            ),
-            'decrypt_cert_id' => array
-            (
-                'type' => 'select',
-                'option'     => 'Dever::call("api/cert.list", array('.$platform_id.'))',
-            ),
-        ),
-
-        'control' => array
-        (
-            'cipher_algo' => array
-            (
-                'type' => array(2,3)
-            ),
-
-            'option' => array
-            (
-                'type' => array(1,2)
-            ),
-
-            'iv' => array
-            (
-                'type' => 2,
-            ),
-            
-            'tag' => array
-            (
-                'type' => 2,
-            ),
-            'aad' => array
-            (
-                'type' => 2,
-            ),
-            'tag_len' => array
-            (
-                'type' => 2,
-            ),
-
-            'encrypt_cert' => array
-            (
-                'encrypt_cert_type' => 3,
-            ),
-            'encrypt_cert_id' => array
-            (
-                'encrypt_cert_type' => array(1,2),
-            ),
-
-            'decrypt_cert' => array
-            (
-                'decrypt_cert_type' => 3,
-            ),
-            'decrypt_cert_id' => array
-            (
-                'decrypt_cert_type' => array(1,2),
-            ),
-        ),
-    ),
-);
+<?php
+$platform_id = Dever::input('set')['platform_id'] ?? 0;
+if (!$platform_id) {
+    $platform_id = Dever::input('field')['platform_id'] ?? 0;
+}
+return [
+    'list' => [
+        'where' => ['platform_id' => $platform_id],
+        'field'      => [
+            'id',
+            'name',
+            'type',
+            'cdate',
+        ],
+        'data_button' => [
+            '编辑' => ['fastedit', ['platform_id' => $platform_id]],
+        ],
+        'button' => [
+            '新增' => ['fastadd', ['platform_id' => $platform_id]],
+        ],
+        'search' => [
+            'platform_id' => 'hidden',
+            'name',
+        ],
+    ],
+    'update' => [
+        'tab' => [
+            '基本设置' => 'name,type,cipher_algo,option,iv,tag_len,aad,after',
+            '加密设置' => 'encrypt_cert_type,encrypt_cert,encrypt_cert_id',
+            '解密设置' => 'decrypt_cert_type,decrypt_cert,decrypt_cert_id',
+        ],
+
+        'field'    => [
+            'platform_id' => 'hidden',
+            'name',
+            'type' => 'radio',
+            'cipher_algo' => [
+                'desc' => '直接填写密码学方式的值,如aes-256-cbc',
+            ],
+            'option' => [
+                'desc' => '直接输入填充模式的常量即可,如:OPENSSL_NO_PADDING'
+            ],
+            'iv' => [
+                'desc' => '可以直接使用平台设置中的参数名',
+            ],
+            'tag' => [
+                'desc' => '可以直接使用平台设置中的参数名',
+            ],
+            'tag_len',
+            'aad' => [
+                'desc' => '可以直接使用平台设置中的参数名',
+            ],
+            'after' => 'radio',
+
+            'encrypt_cert_type' => 'radio',
+            'encrypt_cert' => [
+                'type' => 'text',
+                'desc' => '可以直接使用平台设置中的参数名',
+            ],
+            'encrypt_cert_id' => [
+                'type' => 'select',
+                'option'     => 'Dever::call("api/cert.list", ['.$platform_id.'])',
+            ],
+
+            'decrypt_cert_type' => 'radio',
+            'decrypt_cert' => [
+                'type' => 'text',
+                'desc' => '可以直接使用平台设置中的参数名',
+            ],
+            'decrypt_cert_id' => [
+                'type' => 'select',
+                'option'     => 'Dever::call("api/cert.list", ['.$platform_id.'])',
+            ],
+        ],
+
+        'control' => [
+            'cipher_algo' => [
+                'type' => [2,3]
+            ],
+
+            'option' => [
+                'type' => [1,2]
+            ],
+
+            'iv' => [
+                'type' => 2,
+            ],
+            
+            'tag' => [
+                'type' => 2,
+            ],
+            'aad' => [
+                'type' => 2,
+            ],
+            'tag_len' => [
+                'type' => 2,
+            ],
+
+            'encrypt_cert' => [
+                'encrypt_cert_type' => 3,
+            ],
+            'encrypt_cert_id' => [
+                'encrypt_cert_type' => [1,2],
+            ],
+
+            'decrypt_cert' => [
+                'decrypt_cert_type' => 3,
+            ],
+            'decrypt_cert_id' => [
+                'decrypt_cert_type' => [1,2],
+            ],
+        ],
+    ],
+];

+ 24 - 31
manage/sku.php

@@ -1,31 +1,24 @@
-<?php
-return array
-(
-    'update' => array
-    (
-        'field'    => array
-        (
-            'key' => array
-            (
-                'type' => 'hidden',
-                'remote' => 'api/manage.keyToField?project=api',
-            ),
-            'price' => array
-            (
-                'type' => 'text',
-                'tips' => '设置价格',
-                'rules' => true,
-            ),
-            'num' => array
-            (
-                'type' => 'text',
-                'rules' => true,
-            ),
-            'day_num' => array
-            (
-                'type' => 'text',
-                'rules' => true,
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'update' => [
+        'field'    => [
+            'key' => [
+                'type' => 'hidden',
+                'remote' => 'api/manage.keyToField?project=api',
+            ],
+            'price' => [
+                'type' => 'text',
+                'tips' => '设置价格',
+                'rules' => true,
+            ],
+            'num' => [
+                'type' => 'text',
+                'rules' => true,
+            ],
+            'day_num' => [
+                'type' => 'text',
+                'rules' => true,
+            ],
+        ],
+    ],
+];

+ 40 - 49
table/account.php

@@ -1,49 +1,40 @@
-<?php
-return array
-(
-    'name' => '账户管理',
-    'struct' => array
-    (
-        'name'      => array
-        (
-            'type'      => 'varchar(32)',
-            'name'      => '账户名称',
-        ),
-
-        'key'       => array
-        (
-            'type'      => 'varchar(32)',
-            'name'      => '账户标识',
-        ),
-
-        'app_platform'       => array
-        (
-            'type'      => 'varchar(30)',
-            'name'      => '应用与平台',
-        ),
-
-        'app_id'       => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '应用',
-        ),
-
-        'platform_id'       => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '平台',
-        ),
-
-        'status' => array
-        (
-            'name'      => '状态',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '上架',
-                2 => '下架',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '账户管理',
+    'struct' => [
+        'name'      => [
+            'type'      => 'varchar(32)',
+            'name'      => '账户名称',
+        ],
+
+        'key'       => [
+            'type'      => 'varchar(32)',
+            'name'      => '账户标识',
+        ],
+
+        'app_platform'       => [
+            'type'      => 'varchar(30)',
+            'name'      => '应用与平台',
+        ],
+
+        'app_id'       => [
+            'type'      => 'int(11)',
+            'name'      => '应用',
+        ],
+
+        'platform_id'       => [
+            'type'      => 'int(11)',
+            'name'      => '平台',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '上架',
+                2 => '下架',
+            ],
+        ],
+    ],
+];

+ 37 - 45
table/account_cert.php

@@ -1,45 +1,37 @@
-<?php
-
-return array
-(
-    'name' => '账户证书设置',
-    'order' => 'edate desc, id asc',
-    'struct' => array
-    (
-        'account_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '账户',
-        ),
-
-        'platform_cert_id' => array
-        (
-            'name'      => '证书名',
-            'type'      => 'int(11)',
-        ),
-
-        'number' => array
-        (
-            'name'      => '证书序列号',
-            'type'      => 'varchar(100)',
-        ),
-
-        'public' => array
-        (
-            'name'      => '公钥内容',
-            'type'      => 'varchar(3000)',
-        ),
-
-        'private' => array
-        (
-            'name'      => '私钥内容',
-            'type'      => 'varchar(3000)',
-        ),
-
-        'edate' => array
-        (
-            'name'      => '过期时间',
-            'type'      => 'int(11)',
-        ),
-    ),
-);
+<?php
+
+return [
+    'name' => '账户证书设置',
+    'order' => 'edate desc, id asc',
+    'struct' => [
+        'account_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '账户',
+        ],
+
+        'platform_cert_id' => [
+            'name'      => '证书名',
+            'type'      => 'int(11)',
+        ],
+
+        'number' => [
+            'name'      => '证书序列号',
+            'type'      => 'varchar(100)',
+        ],
+
+        'public' => [
+            'name'      => '公钥内容',
+            'type'      => 'varchar(3000)',
+        ],
+
+        'private' => [
+            'name'      => '私钥内容',
+            'type'      => 'varchar(3000)',
+        ],
+
+        'edate' => [
+            'name'      => '过期时间',
+            'type'      => 'int(11)',
+        ],
+    ],
+];

+ 22 - 27
table/account_setting.php

@@ -1,27 +1,22 @@
-<?php
-
-return array
-(
-    'name' => '账户设置',
-    'order' => 'id asc',
-    'struct' => array
-    (
-        'account_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '账户',
-        ),
-
-        'platform_setting_id' => array
-        (
-            'name'      => '参数名',
-            'type'      => 'int(11)',
-        ),
-
-        'value' => array
-        (
-            'name'      => '参数值',
-            'type'      => 'varchar(3000)',
-        ),
-    ),
-);
+<?php
+
+return [
+    'name' => '账户设置',
+    'order' => 'id asc',
+    'struct' => [
+        'account_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '账户',
+        ],
+
+        'platform_setting_id' => [
+            'name'      => '参数名',
+            'type'      => 'int(11)',
+        ],
+
+        'value' => [
+            'name'      => '参数值',
+            'type'      => 'varchar(3000)',
+        ],
+    ],
+];

+ 84 - 100
table/api.php

@@ -1,100 +1,84 @@
-<?php
-return array
-(
-    'name' => '接口配置',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台',
-            'type'      => 'int(11)',
-            'value'     => 'api/platform',
-        ),
-
-        'name' => array
-        (
-            'name'      => '接口名称',
-            'type'      => 'varchar(32)',
-        ),
-
-        'uri' => array
-        (
-            'name'      => '接口地址',
-            'type'      => 'varchar(100)',
-        ),
-
-        'method' => array
-        (
-            'name'      => '请求方式',
-            'type'      => 'tinyint(1)',
-            'default'   => '-1',
-            'value'     => array
-            (
-                -1 => '使用平台标准请求方式',
-                1 => 'get',
-                2 => 'post',
-            ),
-        ),
-
-        'post_method' => array
-        (
-            'name'      => '请求头设置',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '普通表单:application/x-www-form-urlencoded',
-                2 => '文件表单:multipart/form-data',
-                3 => 'JSON:application/json',
-            ),
-        ),
-
-        'notify' => array
-        (
-            'name'      => '是否有回调',
-            'type'      => 'tinyint(1)',
-            'default'   => '2',
-            'value'     => array
-            (
-                1 => '有回调',
-                2 => '无回调',
-            ),
-        ),
-
-        'env' => array
-        (
-            'name'      => '运行环境',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '通用',
-                2 => 'h5',
-                3 => 'jsapi',
-                4 => 'app',
-                5 => '小程序',
-                6 => 'pc',
-            ),
-        ),
-
-        'status' => array
-        (
-            'name'      => '状态',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '展示',
-                2 => '不展示',
-            ),
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '接口配置',
+    'order' => 'sort asc',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台',
+            'type'      => 'int(11)',
+            'value'     => 'api/platform',
+        ],
+
+        'name' => [
+            'name'      => '接口名称',
+            'type'      => 'varchar(32)',
+        ],
+
+        'uri' => [
+            'name'      => '接口地址',
+            'type'      => 'varchar(100)',
+        ],
+
+        'method' => [
+            'name'      => '请求方式',
+            'type'      => 'tinyint(1)',
+            'default'   => '-1',
+            'value'     => [
+                -1 => '使用平台标准请求方式',
+                1 => 'get',
+                2 => 'post',
+            ],
+        ],
+
+        'post_method' => [
+            'name'      => '请求头设置',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '普通表单:application/x-www-form-urlencoded',
+                2 => '文件表单:multipart/form-data',
+                3 => 'JSON:application/json',
+            ],
+        ],
+
+        'notify' => [
+            'name'      => '是否有回调',
+            'type'      => 'tinyint(1)',
+            'default'   => '2',
+            'value'     => [
+                1 => '有回调',
+                2 => '无回调',
+            ],
+        ],
+
+        'env' => [
+            'name'      => '运行环境',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '通用',
+                2 => 'h5',
+                3 => 'jsapi',
+                4 => 'app',
+                5 => '小程序',
+                6 => 'pc',
+            ],
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '展示',
+                2 => '不展示',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 61 - 74
table/api_log.php

@@ -1,74 +1,61 @@
-<?php
-return array
-(
-    'name' => 'api日志',
-    'store' => 'log',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'api_id' => array
-        (
-            'name'      => '接口id',
-            'type'      => 'int(11)',
-        ),
-
-        'account_id' => array
-        (
-            'name'      => '账户id',
-            'type'      => 'int(11)',
-        ),
-
-        'account_project' => array
-        (
-            'name'      => '账户所在项目',
-            'type'      => 'varchar(100)',
-        ),
-
-        'url' => array
-        (
-            'name'      => '请求url',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'method' => array
-        (
-            'name'      => '请求方式',
-            'type'      => 'varchar(50)',
-        ),
-
-        'body' => array
-        (
-            'name'      => '请求体',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'header' => array
-        (
-            'name'      => '请求头',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'response_body' => array
-        (
-            'name'      => '响应体',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'response_header' => array
-        (
-            'name'      => '响应头',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'data' => array
-        (
-            'name'      => '返回数据',
-            'type'      => 'varchar(1000)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => 'api日志',
+    'store' => 'log',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'api_id' => [
+            'name'      => '接口id',
+            'type'      => 'int(11)',
+        ],
+
+        'account_id' => [
+            'name'      => '账户id',
+            'type'      => 'int(11)',
+        ],
+
+        'account_project' => [
+            'name'      => '账户所在项目',
+            'type'      => 'varchar(100)',
+        ],
+
+        'url' => [
+            'name'      => '请求url',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'method' => [
+            'name'      => '请求方式',
+            'type'      => 'varchar(50)',
+        ],
+
+        'body' => [
+            'name'      => '请求体',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'header' => [
+            'name'      => '请求头',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'response_body' => [
+            'name'      => '响应体',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'response_header' => [
+            'name'      => '响应头',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'data' => [
+            'name'      => '返回数据',
+            'type'      => 'varchar(1000)',
+        ],
+    ],
+];

+ 31 - 38
table/api_notify.php

@@ -1,38 +1,31 @@
-<?php
-return array
-(
-    'name' => '接口回调配置',
-    'struct' => array
-    (
-        'api_id' => array
-        (
-            'name'      => '接口id',
-            'type'      => 'int(11)',
-        ),
-
-        'success' => array
-        (
-            'name'      => '应答成功报文',
-            'type'      => 'varchar(500)',
-        ),
-
-        'error' => array
-        (
-            'name'      => '应答失败报文',
-            'type'      => 'varchar(500)',
-        ),
-
-        'sign_id' => array
-        (
-            'name'      => '签名',
-            'type'      => 'int(11)',
-            'default'   => '',
-        ),
-
-        'sign_arg' => array
-        (
-            'name'      => '签名参数',
-            'type'      => 'varchar(2000)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '接口回调配置',
+    'struct' => [
+        'api_id' => [
+            'name'      => '接口id',
+            'type'      => 'int(11)',
+        ],
+
+        'success' => [
+            'name'      => '应答成功报文',
+            'type'      => 'varchar(500)',
+        ],
+
+        'error' => [
+            'name'      => '应答失败报文',
+            'type'      => 'varchar(500)',
+        ],
+
+        'sign_id' => [
+            'name'      => '签名',
+            'type'      => 'int(11)',
+            'default'   => '',
+        ],
+
+        'sign_arg' => [
+            'name'      => '签名参数',
+            'type'      => 'varchar(2000)',
+        ],
+    ],
+];

+ 10 - 12
table/api_notify_body.php

@@ -1,13 +1,11 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口回调请求体设置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口回调请求体设置';
 return $config;

+ 32 - 39
table/api_notify_code.php

@@ -1,39 +1,32 @@
-<?php
-return array
-(
-    'name' => '回调参数配置',
-    'order' => 'id asc',
-    'struct' => array
-    (
-        'api_id' => array
-        (
-            'name'      => '接口id',
-            'type'      => 'int(11)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '状态码标识',
-            'type'      => 'varchar(32)',
-        ),
-
-        'value' => array
-        (
-            'name'      => '状态码值',
-            'type'      => 'varchar(150)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '状态码类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '成功',
-                2 => '失败',
-                3 => '无状态',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '回调参数配置',
+    'order' => 'id asc',
+    'struct' => [
+        'api_id' => [
+            'name'      => '接口id',
+            'type'      => 'int(11)',
+        ],
+
+        'key' => [
+            'name'      => '状态码标识',
+            'type'      => 'varchar(32)',
+        ],
+
+        'value' => [
+            'name'      => '状态码值',
+            'type'      => 'varchar(150)',
+        ],
+
+        'type' => [
+            'name'      => '状态码类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '成功',
+                2 => '失败',
+                3 => '无状态',
+            ],
+        ],
+    ],
+];

+ 38 - 46
table/api_path.php

@@ -1,46 +1,38 @@
-<?php
-return array
-(
-    'name' => '接口路径设置',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'api_id' => array
-        (
-            'name'      => '接口id',
-            'type'      => 'int(11)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '路径参数名',
-            'type'      => 'varchar(32)',
-        ),
-
-        'value' => array
-        (
-            'name'      => '路径参数值',
-            'type'      => 'varchar(150)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '展示形式',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => 'value形式',
-                2 => 'key/value形式',
-                3 => 'key=value形式',
-            ),
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '接口路径设置',
+    'order' => 'sort asc',
+    'struct' => [
+        'api_id' => [
+            'name'      => '接口id',
+            'type'      => 'int(11)',
+        ],
+
+        'key' => [
+            'name'      => '路径参数名',
+            'type'      => 'varchar(32)',
+        ],
+
+        'value' => [
+            'name'      => '路径参数值',
+            'type'      => 'varchar(150)',
+        ],
+
+        'type' => [
+            'name'      => '展示形式',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => 'value形式',
+                2 => 'key/value形式',
+                3 => 'key=value形式',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 10 - 12
table/api_query.php

@@ -1,13 +1,11 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口查询参数设置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口查询参数设置';
 return $config;

+ 10 - 12
table/api_request_body.php

@@ -1,13 +1,11 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口请求体参数配置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口请求体参数配置';
 return $config;

+ 10 - 12
table/api_request_header.php

@@ -1,13 +1,11 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口请求头参数配置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口请求头参数配置';
 return $config;

+ 11 - 13
table/api_response.php

@@ -1,14 +1,12 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-$config['struct']['value']['name'] = '转换参数名';
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口响应参数配置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+$config['struct']['value']['name'] = '转换参数名';
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口响应参数配置';
 return $config;

+ 11 - 13
table/api_response_body.php

@@ -1,14 +1,12 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-//$config['struct']['value']['name'] = '转换参数名';
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口响应体参数配置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+//$config['struct']['value']['name'] = '转换参数名';
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口响应体参数配置';
 return $config;

+ 11 - 13
table/api_response_header.php

@@ -1,14 +1,12 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-//$config['struct']['value']['name'] = '转换参数名';
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口响应头参数配置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+//$config['struct']['value']['name'] = '转换参数名';
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口响应头参数配置';
 return $config;

+ 37 - 45
table/api_save.php

@@ -1,45 +1,37 @@
-<?php
-return array
-(
-    'name' => 'api数据存储定义',
-    'order' => 'id asc',
-    'struct' => array
-    (
-        'api_id' => array
-        (
-            'name'      => '接口id',
-            'type'      => 'int(11)',
-        ),
-
-        'table' => array
-        (
-            'name'      => '数据表表名',
-            'type'      => 'varchar(100)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '数据表字段名',
-            'type'      => 'varchar(150)',
-        ),
-
-        'value' => array
-        (
-            'name'      => '响应参数名/参数值',
-            'type'      => 'varchar(100)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '普通字段',
-                2 => '条件字段',
-                3 => '时间戳字段',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'name' => 'api数据存储定义',
+    'order' => 'id asc',
+    'struct' => [
+        'api_id' => [
+            'name'      => '接口id',
+            'type'      => 'int(11)',
+        ],
+
+        'table' => [
+            'name'      => '数据表表名',
+            'type'      => 'varchar(100)',
+        ],
+
+        'key' => [
+            'name'      => '数据表字段名',
+            'type'      => 'varchar(150)',
+        ],
+
+        'value' => [
+            'name'      => '响应参数名/参数值',
+            'type'      => 'varchar(100)',
+        ],
+
+        'type' => [
+            'name'      => '类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '普通字段',
+                2 => '条件字段',
+                3 => '时间戳字段',
+            ],
+        ],
+    ],
+];

+ 10 - 12
table/api_setting.php

@@ -1,13 +1,11 @@
-<?php
-$config = include('platform_request_body.php');
-unset($config['struct']['platform_id']);
-$config['struct'] += array
-(
-    'api_id' => array
-    (
-        'name'      => '接口id',
-        'type'      => 'int(11)',
-    ),
-);
-$config['name'] = '接口参数配置';
+<?php
+$config = include('platform_request_body.php');
+unset($config['struct']['platform_id']);
+$config['struct'] += [
+    'api_id' => [
+        'name'      => '接口id',
+        'type'      => 'int(11)',
+    ],
+];
+$config['name'] = '接口参数配置';
 return $config;

+ 32 - 39
table/app.php

@@ -1,39 +1,32 @@
-<?php
-return array
-(
-    'name' => '应用表',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'name' => array
-        (
-            'name'      => '应用名称',
-            'type'      => 'varchar(32)',
-        ),
-
-        'desc' => array
-        (
-            'name'      => '应用描述',
-            'type'      => 'varchar(300)',
-        ),
-
-        'status' => array
-        (
-            'name'      => '状态',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '上架',
-                2 => '下架',
-            ),
-        ),
-        
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '应用表',
+    'order' => 'sort asc',
+    'struct' => [
+        'name' => [
+            'name'      => '应用名称',
+            'type'      => 'varchar(32)',
+        ],
+
+        'desc' => [
+            'name'      => '应用描述',
+            'type'      => 'varchar(300)',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '上架',
+                2 => '下架',
+            ],
+        ],
+        
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 75 - 90
table/app_func.php

@@ -1,90 +1,75 @@
-<?php
-return array
-(
-    'name' => '应用功能表',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'app_id' => array
-        (
-            'name'      => '应用id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '功能名称',
-            'type'      => 'varchar(32)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '功能标识',
-            'type'      => 'varchar(32)',
-        ),
-
-        'desc' => array
-        (
-            'name'      => '功能描述',
-            'type'      => 'varchar(300)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '执行方式',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '单接口-按需执行某一接口',
-                2 => '工作流-按顺序执行所有接口',
-                3 => '工作组-同时执行所有接口'
-            ),
-        ),
-
-        'cron_date' => array
-        (
-            'name'      => '定时执行时间',
-            'type'      => 'int(11)',
-        ),
-
-        'cron_time' => array
-        (
-            'name'      => '定时执行间隔',
-            'type'      => 'int(11)',
-            'default'   => '0',
-        ),
-
-        'spec_type' => array
-        (
-            'name'      => '规格类型',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '免费',
-                2 => '单规格',
-                3 => '多规格',
-            ),
-        ),
-
-        'status' => array
-        (
-            'name'      => '状态',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '上架',
-                2 => '下架',
-            ),
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '应用功能表',
+    'order' => 'sort asc',
+    'struct' => [
+        'app_id' => [
+            'name'      => '应用id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '功能名称',
+            'type'      => 'varchar(32)',
+        ],
+
+        'key' => [
+            'name'      => '功能标识',
+            'type'      => 'varchar(32)',
+        ],
+
+        'desc' => [
+            'name'      => '功能描述',
+            'type'      => 'varchar(300)',
+        ],
+
+        'type' => [
+            'name'      => '执行方式',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '单接口-按需执行某一接口',
+                2 => '工作流-按顺序执行所有接口',
+                3 => '工作组-同时执行所有接口'
+            ],
+        ],
+
+        'cron_date' => [
+            'name'      => '定时执行时间',
+            'type'      => 'int(11)',
+        ],
+
+        'cron_time' => [
+            'name'      => '定时执行间隔',
+            'type'      => 'int(11)',
+            'default'   => '0',
+        ],
+
+        'spec_type' => [
+            'name'      => '规格类型',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '免费',
+                2 => '单规格',
+                3 => '多规格',
+            ],
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '上架',
+                2 => '下架',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 59 - 70
table/app_func_input.php

@@ -1,70 +1,59 @@
-<?php
-return array
-(
-    'name' => '输入参数配置',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'app_func_id' => array
-        (
-            'name'      => '功能id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '参数描述',
-            'type'      => 'varchar(150)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '参数名',
-            'type'      => 'varchar(150)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '单行输入',
-                2 => '多行输入',
-                3 => '单选',
-                4 => '多选',
-                5 => '选择框',
-                11 => '图片上传',
-                12 => '视频上传',
-                13 => '音频上传',
-                14 => '文件上传',
-            ),
-        ),
-
-        'option' => array
-        (
-            'name'      => '默认值/可选项',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'match' => array
-        (
-            'name'      => '必填',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '必填',
-                2 => '选填',
-            ),
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '输入参数配置',
+    'order' => 'sort asc',
+    'struct' => [
+        'app_func_id' => [
+            'name'      => '功能id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '参数描述',
+            'type'      => 'varchar(150)',
+        ],
+
+        'key' => [
+            'name'      => '参数名',
+            'type'      => 'varchar(150)',
+        ],
+
+        'type' => [
+            'name'      => '类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '单行输入',
+                2 => '多行输入',
+                3 => '单选',
+                4 => '多选',
+                5 => '选择框',
+                11 => '图片上传',
+                12 => '视频上传',
+                13 => '音频上传',
+                14 => '文件上传',
+            ],
+        ],
+
+        'option' => [
+            'name'      => '默认值/可选项',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'match' => [
+            'name'      => '必填',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '必填',
+                2 => '选填',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 32 - 39
table/app_func_output.php

@@ -1,39 +1,32 @@
-<?php
-return array
-(
-    'name' => '输出参数配置',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'app_func_id' => array
-        (
-            'name'      => '功能id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '模块名称',
-            'type'      => 'varchar(150)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '模块标识',
-            'type'      => 'varchar(150)',
-        ),
-
-        'data' => array
-        (
-            'name'      => '包含数据',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '输出参数配置',
+    'order' => 'sort asc',
+    'struct' => [
+        'app_func_id' => [
+            'name'      => '功能id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '模块名称',
+            'type'      => 'varchar(150)',
+        ],
+
+        'key' => [
+            'name'      => '模块标识',
+            'type'      => 'varchar(150)',
+        ],
+
+        'data' => [
+            'name'      => '包含数据',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 38 - 46
table/app_func_work.php

@@ -1,46 +1,38 @@
-<?php
-return array
-(
-    'name' => '应用功能工作表',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'app_func_id' => array
-        (
-            'name'      => '功能id',
-            'type'      => 'int(11)',
-        ),
-
-        'platform_id' => array
-        (
-            'name'      => '平台',
-            'type'      => 'int(11)',
-            'value'     => 'api/platform',
-        ),
-
-        'api_id' => array
-        (
-            'name'      => '接口',
-            'type'      => 'int(11)',
-        ),
-
-        'status' => array
-        (
-            'name'      => '状态',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '上架',
-                2 => '下架',
-            ),
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '应用功能工作表',
+    'order' => 'sort asc',
+    'struct' => [
+        'app_func_id' => [
+            'name'      => '功能id',
+            'type'      => 'int(11)',
+        ],
+
+        'platform_id' => [
+            'name'      => '平台',
+            'type'      => 'int(11)',
+            'value'     => 'api/platform',
+        ],
+
+        'api_id' => [
+            'name'      => '接口',
+            'type'      => 'int(11)',
+        ],
+
+        'status' => [
+            'name'      => '状态',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '上架',
+                2 => '下架',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 15 - 19
table/app_platform.php

@@ -1,19 +1,15 @@
-<?php
-return array
-(
-    'name' => '应用与平台关联表',
-    'struct' => array
-    (
-        'app_id' => array
-        (
-            'name'      => '应用id',
-            'type'      => 'int(11)',
-        ),
-
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '应用与平台关联表',
+    'struct' => [
+        'app_id' => [
+            'name'      => '应用id',
+            'type'      => 'int(11)',
+        ],
+
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+    ],
+];

+ 42 - 49
table/format.php

@@ -1,49 +1,42 @@
-<?php
-return array
-(
-    'name' => '参数格式转换',
-    'order' => 'sort asc, id asc',
-    'struct' => array
-    (
-        'name' => array
-        (
-            'name'      => '转换名称',
-            'type'      => 'varchar(30)',
-        ),
-
-        'method' => array
-        (
-            'name'      => '转换方式',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-
-    'default' => array
-    (
-        'field' => 'sort,name,method,cdate',
-        'value' => array
-        (
-            '1,"字符串","strval(\'{value}\')",' . DEVER_TIME,
-            '2,"整数","intval(\'{value}\')",' . DEVER_TIME,
-            '3,"浮点数","floatval(\'{value}\')",' . DEVER_TIME,
-            '4,"uri编码","urlencode(\'{value}\')",' . DEVER_TIME,
-            '5,"uri编码-RFC3986规则","rawurlencode(\'{value}\')",' . DEVER_TIME,
-            '6,"转小写","strtolower(\'{value}\')",' . DEVER_TIME,
-            '7,"转大写","strtoupper(\'{value}\')",' . DEVER_TIME,
-            '8,"去空值","trim(\'{value}\')",' . DEVER_TIME,
-
-            '10,"时间戳","strtotime(\'{value}\')",' . DEVER_TIME,
-            '11,"yyyy-MM-dd HH:mm:ss","date(\'Y-m-d H:i:s\', \'{value}\')",' . DEVER_TIME,
-            '12,"yyyy-MM-DDTHH:mm:ss+TIMEZONE","date(\'Y-m-d\\\TH:i:sP\', \'{value}\')",' . DEVER_TIME,
-            '13,"yyyy-MM-ddTHH:mm:ssZ","date(\'Y-m-d\\\TH:i:sZ\', \'{value}\')",' . DEVER_TIME,
-        ),
-        'num' => 1,
-    ),
-);
+<?php
+return [
+    'name' => '参数格式转换',
+    'order' => 'sort asc, id asc',
+    'struct' => [
+        'name' => [
+            'name'      => '转换名称',
+            'type'      => 'varchar(30)',
+        ],
+
+        'method' => [
+            'name'      => '转换方式',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+
+    'default' => [
+        'field' => 'sort,name,method,cdate',
+        'value' => [
+            '1,"字符串","strval(\'{value}\')",' . DEVER_TIME,
+            '2,"整数","intval(\'{value}\')",' . DEVER_TIME,
+            '3,"浮点数","floatval(\'{value}\')",' . DEVER_TIME,
+            '4,"uri编码","urlencode(\'{value}\')",' . DEVER_TIME,
+            '5,"uri编码-RFC3986规则","rawurlencode(\'{value}\')",' . DEVER_TIME,
+            '6,"转小写","strtolower(\'{value}\')",' . DEVER_TIME,
+            '7,"转大写","strtoupper(\'{value}\')",' . DEVER_TIME,
+            '8,"去空值","trim(\'{value}\')",' . DEVER_TIME,
+
+            '10,"时间戳","strtotime(\'{value}\')",' . DEVER_TIME,
+            '11,"yyyy-MM-dd HH:mm:ss","date(\'Y-m-d H:i:s\', \'{value}\')",' . DEVER_TIME,
+            '12,"yyyy-MM-DDTHH:mm:ss+TIMEZONE","date(\'Y-m-d\\\TH:i:sP\', \'{value}\')",' . DEVER_TIME,
+            '13,"yyyy-MM-ddTHH:mm:ssZ","date(\'Y-m-d\\\TH:i:sZ\', \'{value}\')",' . DEVER_TIME,
+        ],
+        'num' => 1,
+    ],
+];

+ 25 - 31
table/openid.php

@@ -1,31 +1,25 @@
-<?php
-return array
-(
-    'name' => 'openid表',
-    'struct' => array
-    (
-        'account_id'        => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '账户',
-        ),
-
-        'env' => array
-        (
-            'name'      => '运行环境',
-            'type'      => 'tinyint(1)',
-        ),
-
-        'uid'       => array
-        (
-            'type'      => 'int(11)',
-            'name'      => '用户ID',
-        ),
-
-        'openid'        => array
-        (
-            'type'      => 'varchar(60)',
-            'name'      => 'openid',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => 'openid表',
+    'struct' => [
+        'account_id'        => [
+            'type'      => 'int(11)',
+            'name'      => '账户',
+        ],
+
+        'env' => [
+            'name'      => '运行环境',
+            'type'      => 'tinyint(1)',
+        ],
+
+        'uid'       => [
+            'type'      => 'int(11)',
+            'name'      => '用户ID',
+        ],
+
+        'openid'        => [
+            'type'      => 'varchar(60)',
+            'name'      => 'openid',
+        ],
+    ],
+];

+ 47 - 57
table/platform.php

@@ -1,57 +1,47 @@
-<?php
-return array
-(
-    'name' => '平台表',
-    'struct' => array
-    (
-        'name' => array
-        (
-            'name'      => '平台名称',
-            'type'      => 'varchar(32)',
-        ),
-
-        'host' => array
-        (
-            'name'      => '主机域名',
-            'type'      => 'varchar(500)',
-        ),
-
-        'method' => array
-        (
-            'name'      => '请求方法',
-            'type'      => 'tinyint(1)',
-            'default'   => '2',
-            'value'     => array
-            (
-                1 => 'get',
-                2 => 'post',
-            ),
-        ),
-
-        'post_method' => array
-        (
-            'name'      => '请求方式',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '普通表单:application/x-www-form-urlencoded',
-                2 => '文件表单:multipart/form-data',
-                3 => 'JSON:application/json',
-            ),
-        ),
-
-        'response_type' => array
-        (
-            'name'      => '响应数据类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '2',
-            'value'     => array
-            (
-                //1 => '无标准响应',
-                2 => 'JSON',
-                3 => 'XML',
-            ),
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '平台表',
+    'struct' => [
+        'name' => [
+            'name'      => '平台名称',
+            'type'      => 'varchar(32)',
+        ],
+
+        'host' => [
+            'name'      => '主机域名',
+            'type'      => 'varchar(500)',
+        ],
+
+        'method' => [
+            'name'      => '请求方法',
+            'type'      => 'tinyint(1)',
+            'default'   => '2',
+            'value'     => [
+                1 => 'get',
+                2 => 'post',
+            ],
+        ],
+
+        'post_method' => [
+            'name'      => '请求方式',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '普通表单:application/x-www-form-urlencoded',
+                2 => '文件表单:multipart/form-data',
+                3 => 'JSON:application/json',
+            ],
+        ],
+
+        'response_type' => [
+            'name'      => '响应数据类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '2',
+            'value'     => [
+                //1 => '无标准响应',
+                2 => 'JSON',
+                3 => 'XML',
+            ],
+        ],
+    ],
+];

+ 21 - 26
table/platform_cert.php

@@ -1,26 +1,21 @@
-<?php
-return array
-(
-    'name' => '平台证书配置',
-    'order' => 'id asc',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '证书名称',
-            'type'      => 'varchar(50)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '证书类型',
-            'type'      => 'varchar(50)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '平台证书配置',
+    'order' => 'id asc',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '证书名称',
+            'type'      => 'varchar(50)',
+        ],
+
+        'type' => [
+            'name'      => '证书类型',
+            'type'      => 'varchar(50)',
+        ],
+    ],
+];

+ 20 - 25
table/platform_convert.php

@@ -1,25 +1,20 @@
-<?php
-return array
-(
-    'name' => '参数转换配置',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'before' => array
-        (
-            'name'      => '转换前字段',
-            'type'      => 'varchar(150)',
-        ),
-
-        'after' => array
-        (
-            'name'      => '转换后字段',
-            'type'      => 'varchar(150)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '参数转换配置',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'before' => [
+            'name'      => '转换前字段',
+            'type'      => 'varchar(150)',
+        ],
+
+        'after' => [
+            'name'      => '转换后字段',
+            'type'      => 'varchar(150)',
+        ],
+    ],
+];

+ 32 - 39
table/platform_request_body.php

@@ -1,39 +1,32 @@
-<?php
-return array
-(
-    'name' => '请求体通用参数配置',
-    'order' => 'sort asc,id asc',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '参数名',
-            'type'      => 'varchar(32)',
-        ),
-
-        'value' => array
-        (
-            'name'      => '参数值',
-            'type'      => 'varchar(1000)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '参数处理',
-            'type'      => 'varchar(100)',
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '请求体通用参数配置',
+    'order' => 'sort asc,id asc',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'key' => [
+            'name'      => '参数名',
+            'type'      => 'varchar(32)',
+        ],
+
+        'value' => [
+            'name'      => '参数值',
+            'type'      => 'varchar(1000)',
+        ],
+
+        'type' => [
+            'name'      => '参数处理',
+            'type'      => 'varchar(100)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 35 - 43
table/platform_response_code.php

@@ -1,43 +1,35 @@
-<?php
-return array
-(
-    'name' => '响应状态码列表',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '状态码名',
-            'type'      => 'varchar(150)',
-        ),
-
-        'value' => array
-        (
-            'name'      => '状态码值',
-            'type'      => 'varchar(150)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '状态码类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '成功',
-                2 => '失败',
-            ),
-        ),
-
-        'msg' => array
-        (
-            'name'      => '返回信息',
-            'type'      => 'varchar(150)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '响应状态码列表',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'key' => [
+            'name'      => '状态码名',
+            'type'      => 'varchar(150)',
+        ],
+
+        'value' => [
+            'name'      => '状态码值',
+            'type'      => 'varchar(150)',
+        ],
+
+        'type' => [
+            'name'      => '状态码类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '成功',
+                2 => '失败',
+            ],
+        ],
+
+        'msg' => [
+            'name'      => '返回信息',
+            'type'      => 'varchar(150)',
+        ],
+    ],
+];

+ 27 - 33
table/platform_setting.php

@@ -1,33 +1,27 @@
-<?php
-return array
-(
-    'name' => '平台配置',
-    'order' => 'sort asc, id asc',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '参数描述',
-            'type'      => 'varchar(32)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '参数名',
-            'type'      => 'varchar(32)',
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '平台配置',
+    'order' => 'sort asc, id asc',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '参数描述',
+            'type'      => 'varchar(32)',
+        ],
+
+        'key' => [
+            'name'      => '参数名',
+            'type'      => 'varchar(32)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 102 - 121
table/platform_sign.php

@@ -1,121 +1,102 @@
-<?php
-return array
-(
-    'name' => '平台签名配置',
-    'order' => 'sort asc, id desc',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '签名名称',
-            'type'      => 'varchar(150)',
-            'default'   => 'sign',
-        ),
-
-        'arg' => array
-        (
-            'name'      => '签名参数',
-            'type'      => 'varchar(2000)',
-        ),
-
-        'encrypt' => array
-        (
-            'name'      => '加密方式',
-            'type'      => 'int(11)',
-            'default'   => '-1',
-            //'value'     => $encrypt,
-        ),
-
-        'after' => array
-        (
-            'name'      => '最后处理',
-            'type'      => 'int(11)',
-            'value'     => 'api/format',
-        ),
-
-        'kv_type' => array
-        (
-            'name'      => '键名键值形式',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => 'value形式',
-                2 => 'key形式',
-                3 => 'key=value形式',
-                4 => 'keyvalue形式',
-                5 => 'key:value形式',
-            ),
-        ),
-
-        'kv_sort' => array
-        (
-            'name'      => '排序方式',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '按照【签名参数键名】填写顺序排序',
-                2 => '按照【签名参数键名】字符顺序升序排序',
-                3 => '按照【签名参数键值】字符顺序升序排序',
-            ),
-        ),
-
-        'kv_value_empty' => array
-        (
-            'name'      => '键值空值',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '参与签名',
-                2 => '不参与签名',
-            ),
-        ),
-
-        'kv_key_handle' => array
-        (
-            'name'      => '健名处理',
-            'type'      => 'int(11)',
-            'value'     => 'api/format',
-        ),
-
-        'kv_value_handle' => array
-        (
-            'name'      => '键值处理',
-            'type'      => 'int(11)',
-            'value'     => 'api/format',
-        ),
-
-        'kv_join' => array
-        (
-            'name'      => '连接符',
-            'type'      => 'varchar(30)',
-        ),
-
-        'kv_join_handle' => array
-        (
-            'name'      => '连接符处理',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '删除尾部连接符',
-                2 => '不删除',
-            ),
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '平台签名配置',
+    'order' => 'sort asc, id desc',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '签名名称',
+            'type'      => 'varchar(150)',
+            'default'   => 'sign',
+        ],
+
+        'arg' => [
+            'name'      => '签名参数',
+            'type'      => 'varchar(2000)',
+        ],
+
+        'encrypt' => [
+            'name'      => '加密方式',
+            'type'      => 'int(11)',
+            'default'   => '-1',
+            //'value'     => $encrypt,
+        ],
+
+        'after' => [
+            'name'      => '最后处理',
+            'type'      => 'int(11)',
+            'value'     => 'api/format',
+        ],
+
+        'kv_type' => [
+            'name'      => '键名键值形式',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => 'value形式',
+                2 => 'key形式',
+                3 => 'key=value形式',
+                4 => 'keyvalue形式',
+                5 => 'key:value形式',
+            ],
+        ],
+
+        'kv_sort' => [
+            'name'      => '排序方式',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '按照【签名参数键名】填写顺序排序',
+                2 => '按照【签名参数键名】字符顺序升序排序',
+                3 => '按照【签名参数键值】字符顺序升序排序',
+            ],
+        ],
+
+        'kv_value_empty' => [
+            'name'      => '键值空值',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '参与签名',
+                2 => '不参与签名',
+            ],
+        ],
+
+        'kv_key_handle' => [
+            'name'      => '健名处理',
+            'type'      => 'int(11)',
+            'value'     => 'api/format',
+        ],
+
+        'kv_value_handle' => [
+            'name'      => '键值处理',
+            'type'      => 'int(11)',
+            'value'     => 'api/format',
+        ],
+
+        'kv_join' => [
+            'name'      => '连接符',
+            'type'      => 'varchar(30)',
+        ],
+
+        'kv_join_handle' => [
+            'name'      => '连接符处理',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '删除尾部连接符',
+                2 => '不删除',
+            ],
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 112 - 134
table/platform_ssl.php

@@ -1,134 +1,112 @@
-<?php
-return array
-(
-    'name' => '平台加解密',
-    'order' => 'id asc',
-    'struct' => array
-    (
-        'platform_id' => array
-        (
-            'name'      => '平台id',
-            'type'      => 'int(11)',
-        ),
-
-        'name' => array
-        (
-            'name'      => '名称',
-            'type'      => 'varchar(50)',
-        ),
-
-        'type' => array
-        (
-            'name'      => '算法',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '非对称',
-                2 => '对称',
-                3 => '签名',
-            ),
-        ),
-
-        'cipher_algo' => array
-        (
-            'name'      => '密码学方式',
-            'type'      => 'varchar(50)',
-        ),
-
-        'option' => array
-        (
-            'name'      => '填充模式',
-            'type'      => 'varchar(30)',
-            'default'   => 'OPENSSL_NO_PADDING',
-        ),
-
-        # 对称加密特有
-        'iv' => array
-        (
-            'name'      => '初始化向量',
-            'type'      => 'varchar(50)',
-        ),
-
-        'tag' => array
-        (
-            'name'      => '验证标签',
-            'type'      => 'varchar(50)',
-        ),
-
-        'tag_len' => array
-        (
-            'name'      => '标签长度',
-            'type'      => 'tinyint(1)',
-            'default'   => '16',
-        ),
-
-        'aad' => array
-        (
-            'name'      => '附加验证数据',
-            'type'      => 'varchar(50)',
-        ),
-
-        'after' => array
-        (
-            'name'      => '数据处理',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '不处理',
-                2 => '转base64',
-            ),
-        ),
-
-        'encrypt_cert_type' => array
-        (
-            'name'      => '加密密钥类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '公钥',
-                2 => '私钥',
-                3 => '文本',
-            ),
-        ),
-
-        'encrypt_cert' => array
-        (
-            'name'      => '加密密钥文本',
-            'type'      => 'varchar(50)',
-        ),
-
-        'encrypt_cert_id' => array
-        (
-            'name'      => '加密证书',
-            'type'      => 'int(11)',
-        ),
-
-        'decrypt_cert_type' => array
-        (
-            'name'      => '解密密钥类型',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-            'value'     => array
-            (
-                1 => '公钥',
-                2 => '私钥',
-                3 => '文本',
-            ),
-        ),
-
-        'decrypt_cert' => array
-        (
-            'name'      => '解密密钥文本',
-            'type'      => 'varchar(50)',
-        ),
-
-        'decrypt_cert_id' => array
-        (
-            'name'      => '解密证书',
-            'type'      => 'int(11)',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '平台加解密',
+    'order' => 'id asc',
+    'struct' => [
+        'platform_id' => [
+            'name'      => '平台id',
+            'type'      => 'int(11)',
+        ],
+
+        'name' => [
+            'name'      => '名称',
+            'type'      => 'varchar(50)',
+        ],
+
+        'type' => [
+            'name'      => '算法',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '非对称',
+                2 => '对称',
+                3 => '签名',
+            ],
+        ],
+
+        'cipher_algo' => [
+            'name'      => '密码学方式',
+            'type'      => 'varchar(50)',
+        ],
+
+        'option' => [
+            'name'      => '填充模式',
+            'type'      => 'varchar(30)',
+            'default'   => 'OPENSSL_NO_PADDING',
+        ],
+
+        # 对称加密特有
+        'iv' => [
+            'name'      => '初始化向量',
+            'type'      => 'varchar(50)',
+        ],
+
+        'tag' => [
+            'name'      => '验证标签',
+            'type'      => 'varchar(50)',
+        ],
+
+        'tag_len' => [
+            'name'      => '标签长度',
+            'type'      => 'tinyint(1)',
+            'default'   => '16',
+        ],
+
+        'aad' => [
+            'name'      => '附加验证数据',
+            'type'      => 'varchar(50)',
+        ],
+
+        'after' => [
+            'name'      => '数据处理',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '不处理',
+                2 => '转base64',
+            ],
+        ],
+
+        'encrypt_cert_type' => [
+            'name'      => '加密密钥类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '公钥',
+                2 => '私钥',
+                3 => '文本',
+            ],
+        ],
+
+        'encrypt_cert' => [
+            'name'      => '加密密钥文本',
+            'type'      => 'varchar(50)',
+        ],
+
+        'encrypt_cert_id' => [
+            'name'      => '加密证书',
+            'type'      => 'int(11)',
+        ],
+
+        'decrypt_cert_type' => [
+            'name'      => '解密密钥类型',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+            'value'     => [
+                1 => '公钥',
+                2 => '私钥',
+                3 => '文本',
+            ],
+        ],
+
+        'decrypt_cert' => [
+            'name'      => '解密密钥文本',
+            'type'      => 'varchar(50)',
+        ],
+
+        'decrypt_cert_id' => [
+            'name'      => '解密证书',
+            'type'      => 'int(11)',
+        ],
+    ],
+];

+ 36 - 44
table/sku.php

@@ -1,44 +1,36 @@
-<?php
-return array
-(
-    'name' => '接口规格设置',
-    'struct' => array
-    (
-        'app_func_id' => array
-        (
-            'name'      => '功能id',
-            'type'      => 'int(11)',
-        ),
-
-        'key' => array
-        (
-            'name'      => '规格ID',
-            'type'      => 'varchar(500)',
-        ),
-
-        'price' => array
-        (
-            'name'      => '售价',
-            'type'      => 'decimal(11,2)',
-        ),
-
-        'num' => array
-        (
-            'name'      => '总次数',
-            'type'      => 'int(11)',
-        ),
-
-        'day_num' => array
-        (
-            'name'      => '每天限制次数',
-            'type'      => 'int(11)',
-        ),
-
-        'state' => array
-        (
-            'name'      => '数据状态',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '接口规格设置',
+    'struct' => [
+        'app_func_id' => [
+            'name'      => '功能id',
+            'type'      => 'int(11)',
+        ],
+
+        'key' => [
+            'name'      => '规格ID',
+            'type'      => 'varchar(500)',
+        ],
+
+        'price' => [
+            'name'      => '售价',
+            'type'      => 'decimal(11,2)',
+        ],
+
+        'num' => [
+            'name'      => '总次数',
+            'type'      => 'int(11)',
+        ],
+
+        'day_num' => [
+            'name'      => '每天限制次数',
+            'type'      => 'int(11)',
+        ],
+
+        'state' => [
+            'name'      => '数据状态',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 26 - 32
table/spec.php

@@ -1,32 +1,26 @@
-<?php
-return array
-(
-    'name' => '接口规格设置',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'app_func_id' => array
-        (
-            'name'      => '功能id',
-            'type'      => 'int(11)',
-        ),
-        'name' => array
-        (
-            'name'      => '规格名称',
-            'type'      => 'varchar(200)',
-        ),
-
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-        'state' => array
-        (
-            'name'      => '数据状态',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '接口规格设置',
+    'order' => 'sort asc',
+    'struct' => [
+        'app_func_id' => [
+            'name'      => '功能id',
+            'type'      => 'int(11)',
+        ],
+        'name' => [
+            'name'      => '规格名称',
+            'type'      => 'varchar(200)',
+        ],
+
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+        'state' => [
+            'name'      => '数据状态',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+        ],
+    ],
+];

+ 38 - 47
table/spec_value.php

@@ -1,47 +1,38 @@
-<?php
-return array
-(
-    'name' => '接口规格值设置',
-    'order' => 'sort asc',
-    'struct' => array
-    (
-        'app_func_id' => array
-        (
-            'name'      => '功能id',
-            'type'      => 'int(11)',
-        ),
-        'spec_id' => array
-        (
-            'name'      => '规格ID',
-            'type'      => 'int(11)',
-        ),
-        'value' => array
-        (
-            'name'      => '规格值',
-            'type'      => 'varchar(500)',
-        ),
-        'is_checked' => array
-        (
-            'name'      => '是否选中',
-            'type'      => 'tinyint(1)',
-            'default'   => 1,
-            'value'     => array
-            (
-                1 => '选中',
-                2 => '未选中',
-            )
-        ),
-        'sort' => array
-        (
-            'name'      => '排序',
-            'type'      => 'int(11)',
-            'default'   => '1',
-        ),
-        'state' => array
-        (
-            'name'      => '数据状态',
-            'type'      => 'tinyint(1)',
-            'default'   => '1',
-        ),
-    ),
-);
+<?php
+return [
+    'name' => '接口规格值设置',
+    'order' => 'sort asc',
+    'struct' => [
+        'app_func_id' => [
+            'name'      => '功能id',
+            'type'      => 'int(11)',
+        ],
+        'spec_id' => [
+            'name'      => '规格ID',
+            'type'      => 'int(11)',
+        ],
+        'value' => [
+            'name'      => '规格值',
+            'type'      => 'varchar(500)',
+        ],
+        'is_checked' => [
+            'name'      => '是否选中',
+            'type'      => 'tinyint(1)',
+            'default'   => 1,
+            'value'     => [
+                1 => '选中',
+                2 => '未选中',
+            ]
+        ],
+        'sort' => [
+            'name'      => '排序',
+            'type'      => 'int(11)',
+            'default'   => '1',
+        ],
+        'state' => [
+            'name'      => '数据状态',
+            'type'      => 'tinyint(1)',
+            'default'   => '1',
+        ],
+    ],
+];