channel.php 5.1 KB

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