platform.php 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <?php
  2. $config = array
  3. (
  4. 'source' => 'api/platform',
  5. 'list' => array
  6. (
  7. 'field' => array
  8. (
  9. 'id',
  10. 'name',
  11. 'host',
  12. //'method',
  13. ),
  14. 'data_button' => array
  15. (
  16. '设置' => 'edit',
  17. '证书' => array('route', array
  18. (
  19. 'path' => 'api_manage/platform_cert',
  20. 'param' => array
  21. (
  22. 'set' => array('platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
  23. ),
  24. )),
  25. '加解密' => array('route', array
  26. (
  27. 'path' => 'api_manage/platform_ssl',
  28. 'param' => array
  29. (
  30. 'set' => array('platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
  31. ),
  32. )),
  33. '接口' => array('route', array
  34. (
  35. 'path' => 'api_manage/api',
  36. 'param' => array
  37. (
  38. 'set' => array('platform_id' => 'id', 'menu' => 'api_manage/platform', 'parent' => 'api_manage/platform'),
  39. ),
  40. )),
  41. ),
  42. 'button' => array
  43. (
  44. '新增' => array('fastadd', 'name,host'),
  45. ),
  46. 'search' => array
  47. (
  48. 'name',
  49. ),
  50. ),
  51. 'update' => array
  52. (
  53. 'desc' => "所有参数定义后均可以直接使用,也支持函数,参数值可以是变量、函数、字符串,如果函数中或者字符串中需要增加变量或者常量,请用{}隔开,默认常量:method请求方式,host主机域名,uri请求路径,sign签名,time秒时间戳,timestamp毫秒时间戳,nonce随机值,notify请求回调地址,order_num请求订单号,aad签名附加数据,body请求体参数,body_json请求体参数(json格式)",
  54. 'tab' => array
  55. (
  56. '基本设置' => 'name,host,method,post_method,api/platform_setting',
  57. '标准请求' => 'api/platform_request_header,api/platform_request_body',
  58. '标准响应' => 'api/platform_response_header,api/platform_response_body',
  59. '响应体状态' => 'response_type,response_data,response_msg,response_code,api/platform_response_code',
  60. //'字段转换' => 'api/platform_convert',
  61. '签名设置' => 'sign_method,sign_name,sign_col,sign_verify_col,sign_type,sign_split,sign_split_type,sign_sort,sign_encode,sign_empty,sign_after,sign_verify_set,sign_verify_type',
  62. ),
  63. 'field' => array
  64. (
  65. 'name',
  66. 'host',
  67. 'method' => array
  68. (
  69. 'type' => 'radio',
  70. 'control' => true,
  71. ),
  72. 'post_method' => array
  73. (
  74. 'type' => 'radio',
  75. ),
  76. 'api/platform_setting' => array
  77. (
  78. 'name' => '参数设置',
  79. 'desc' => '设置对接平台需要的参数',
  80. 'where' => array('platform_id' => 'id'),
  81. ),
  82. 'api/platform_request_body' => array
  83. (
  84. 'name' => '请求体设置',
  85. 'desc' => '设置平台标准请求体',
  86. 'where' => array('platform_id' => 'id'),
  87. ),
  88. 'api/platform_request_header' => array
  89. (
  90. 'name' => '请求头设置',
  91. 'desc' => '设置平台标准请求头',
  92. 'where' => array('platform_id' => 'id'),
  93. ),
  94. 'api/platform_response_body' => array
  95. (
  96. 'name' => '标准响应体',
  97. 'desc' => '设置平台标准响应体,只保留填写后的响应体,格式:data[].name,不是列表则为data.name',
  98. 'where' => array('platform_id' => 'id'),
  99. ),
  100. 'api/platform_response_header' => array
  101. (
  102. 'name' => '标准响应头',
  103. 'desc' => '设置平台标准响应头,不填写不保留响应头,格式:data[].name,不是列表则为data.name',
  104. 'where' => array('platform_id' => 'id'),
  105. ),
  106. 'api/platform_convert' => array
  107. (
  108. 'name' => '字段转换',
  109. 'where' => array('platform_id' => 'id'),
  110. 'desc' => '设置之后,所有平台过来的字段,都将按照这个转换规则进行转换',
  111. ),
  112. 'response_type' => array
  113. (
  114. 'type' => 'radio',
  115. //'control' => true,
  116. ),
  117. 'response_data',
  118. 'response_msg',
  119. 'response_code',
  120. 'api/platform_response_code' => array
  121. (
  122. 'name' => '响应状态码',
  123. 'desc' => '设置标准的响应状态码,也可以只设置成功值,其他值均为失败',
  124. 'where' => array('platform_id' => 'id'),
  125. ),
  126. 'sign_name',
  127. 'sign_method' => 'radio',
  128. 'sign_col' => array
  129. (
  130. 'type' => 'textarea',
  131. 'autosize' => array('minRows' => 2),
  132. 'desc' => '按顺序做加密,用+号隔开,为空则所有参数均参与签名',
  133. ),
  134. 'sign_verify_col' => array
  135. (
  136. 'type' => 'textarea',
  137. 'autosize' => array('minRows' => 2),
  138. 'desc' => '同上,为空则与签名参数相同',
  139. ),
  140. 'sign_type' => 'radio',
  141. 'sign_split',
  142. 'sign_split_type' => 'radio',
  143. 'sign_sort' => 'radio',
  144. 'sign_encode' => array
  145. (
  146. 'type' => 'radio',
  147. 'desc' => '【如果参数中包含有特殊字符,是否进行转码】',
  148. ),
  149. 'sign_empty' => array
  150. (
  151. 'type' => 'radio',
  152. 'desc' => '【如果参数中有空值,是否参与签名】',
  153. ),
  154. 'sign_after' => 'radio',
  155. 'sign_verify_type' => array
  156. (
  157. 'type' => 'radio',
  158. 'desc' => '【选择对签名解签,必须选择可以解签的签名加密方式】',
  159. ),
  160. 'sign_verify_set' => 'checkbox',
  161. ),
  162. 'control' => array
  163. (
  164. 'post_method' => array
  165. (
  166. 'method' => 2,
  167. ),
  168. ),
  169. ),
  170. );
  171. $id = Dever::input('id');
  172. if (!$id) {
  173. $config['update']['desc'] = '';
  174. unset($config['update']['tab']);
  175. }
  176. return $config;