platform.php 6.5 KB

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