channel.php 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235
  1. <?php
  2. $sign_method = array
  3. (
  4. 1 => 'md5',
  5. 2 => 'sha256',
  6. );
  7. $type = array
  8. (
  9. 1 => '标准请求体',
  10. 2 => '标准请求头',
  11. );
  12. $method = array
  13. (
  14. 1 => 'get',
  15. 2 => 'post',
  16. );
  17. $post_method = array
  18. (
  19. 1 => '普通表单:application/x-www-form-urlencoded',
  20. 2 => '文件表单:multipart/form-data',
  21. 3 => 'JSON:application/json',
  22. //4 => 'XML:text/xml',
  23. );
  24. return array
  25. (
  26. # 表名
  27. 'name' => 'channel',
  28. # 显示给用户看的名称
  29. 'lang' => '渠道设置',
  30. # 是否显示在后台菜单
  31. 'order' => 10,
  32. 'set' => array
  33. (
  34. 'method' => $method,
  35. 'post_method' => $post_method,
  36. ),
  37. # 数据结构
  38. 'struct' => array
  39. (
  40. 'id' => array
  41. (
  42. 'type' => 'int-11',
  43. 'name' => 'ID',
  44. 'default' => '',
  45. 'desc' => '',
  46. 'match' => 'is_numeric',
  47. 'list' => true,
  48. 'order' => 'desc',
  49. ),
  50. 'name' => array
  51. (
  52. 'type' => 'varchar-150',
  53. 'name' => '渠道名称',
  54. 'default' => '',
  55. 'desc' => '渠道名称',
  56. 'match' => 'is_string',
  57. 'update' => 'text',
  58. 'search' => 'fulltext',
  59. 'list' => true,
  60. 'edit' => true,
  61. ),
  62. 'appid' => array
  63. (
  64. 'type' => 'varchar-150',
  65. 'name' => '渠道APPID',
  66. 'default' => '',
  67. 'desc' => '渠道APPID',
  68. 'match' => 'is_string',
  69. 'update' => 'text',
  70. 'search' => 'fulltext',
  71. 'list' => true,
  72. ),
  73. 'appkey' => array
  74. (
  75. 'type' => 'varchar-150',
  76. 'name' => '渠道APPKEY',
  77. 'default' => '',
  78. 'desc' => '渠道APPKEY',
  79. 'match' => 'is_string',
  80. 'update' => 'text',
  81. //'search' => 'fulltext',
  82. //'list' => true,
  83. ),
  84. 'host' => array
  85. (
  86. 'type' => 'varchar-1000',
  87. 'name' => '渠道接口域名',
  88. 'default' => '',
  89. 'desc' => '渠道接口域名',
  90. 'match' => 'is_string',
  91. 'update' => 'text',
  92. 'search' => 'fulltext',
  93. 'list' => true,
  94. ),
  95. 'sign_method' => array
  96. (
  97. 'type' => 'tinyint-1',
  98. 'name' => '请求加密方式',
  99. 'default' => '1',
  100. 'desc' => '请求加密方式',
  101. 'match' => 'is_numeric',
  102. 'update' => 'radio',
  103. 'option' => $sign_method,
  104. ),
  105. 'method' => array
  106. (
  107. 'type' => 'tinyint-1',
  108. 'name' => '标准请求方式',
  109. 'default' => '1',
  110. 'desc' => '标准请求方式',
  111. 'match' => 'is_numeric',
  112. 'update' => 'radio',
  113. 'option' => $method,
  114. //'list' => true,
  115. 'control' => 'method',
  116. ),
  117. 'post_method' => array
  118. (
  119. 'type' => 'tinyint-1',
  120. 'name' => '标准请求头设置',
  121. 'default' => '1',
  122. 'desc' => '标准请求头设置',
  123. 'match' => 'is_numeric',
  124. 'update' => 'radio',
  125. 'option' => $post_method,
  126. 'show' => 'method=2',
  127. ),
  128. 'type' => array
  129. (
  130. 'type' => 'varchar-20',
  131. 'name' => '是否有标准请求参数',
  132. 'default' => '1,2',
  133. 'desc' => '是否有标准请求参数',
  134. 'match' => 'is_numeric',
  135. 'update' => 'checkbox',
  136. 'option' => $type,
  137. //'list' => true,
  138. 'control' => 'type',
  139. ),
  140. 'middleware-channel_request_body'=> array
  141. (
  142. 'name' => '标准请求体参数',
  143. 'default' => '',
  144. 'desc' => '标准请求体参数',
  145. 'match' => 'option',
  146. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  147. 'sync' => array('id', 'channel_id'),
  148. 'update' => array(1),
  149. 'show' => 'type=1',
  150. ),
  151. 'middleware-channel_request_header'=> array
  152. (
  153. 'name' => '标准请求头参数',
  154. 'default' => '',
  155. 'desc' => '标准请求头参数',
  156. 'match' => 'option',
  157. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  158. 'sync' => array('id', 'channel_id'),
  159. 'update' => array(1),
  160. 'show' => 'type=2',
  161. ),
  162. 'reorder' => array
  163. (
  164. 'type' => 'int-11',
  165. 'name' => '排序(数值越大越靠前)',
  166. 'default' => '1',
  167. 'desc' => '请输入排序',
  168. 'match' => 'option',
  169. //'update' => 'text',
  170. 'search' => 'order',
  171. 'list_name' => '排序',
  172. 'list' => true,
  173. 'order' => 'desc',
  174. 'edit' => true,
  175. ),
  176. 'state' => array
  177. (
  178. 'type' => 'tinyint-1',
  179. 'name' => '状态',
  180. 'default' => '1',
  181. 'desc' => '请选择状态',
  182. 'match' => 'is_numeric',
  183. ),
  184. 'cdate' => array
  185. (
  186. 'type' => 'int-11',
  187. 'name' => '录入时间',
  188. 'match' => array('is_numeric', time()),
  189. 'desc' => '',
  190. # 只有insert时才生效
  191. 'insert' => true,
  192. //'search' => 'date',
  193. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  194. ),
  195. ),
  196. 'manage' => array
  197. (
  198. //'tab' => array('基本设置', '联系人信息', '认证信息'),
  199. 'button' => array
  200. (
  201. //'类型配置' => array('list', 'supplier_type&oper_parent=supplier'),
  202. ),
  203. 'list_button' => array
  204. (
  205. //'location' => array('产品设置', Dever::url('lib/channel.setProduct', 'middleware')),
  206. 'list' => array('业务接口配置', 'channel_api&oper_table=channel&search_option_channel_id={id}'),
  207. )
  208. ),
  209. 'request' => array
  210. (
  211. )
  212. );