channel.php 8.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400
  1. <?php
  2. $sign_col = '';
  3. $sign_method = array
  4. (
  5. -1 => '不加密',
  6. 1 => 'md5',
  7. 2 => 'sha256',
  8. );
  9. $sign_type = array
  10. (
  11. 1 => 'value+value形式',
  12. 2 => 'key=value&key=value形式',
  13. );
  14. $sign_sort = array
  15. (
  16. 1 => '按照请求加密参数顺序排序',
  17. 2 => '按照首字母正序排序',
  18. );
  19. $sign_after = array
  20. (
  21. 1 => '不处理',
  22. 2 => '转大写',
  23. 3 => '转小写',
  24. );
  25. $type = array
  26. (
  27. 1 => '标准请求体',
  28. 2 => '标准请求头',
  29. );
  30. $method = array
  31. (
  32. 1 => 'get',
  33. 2 => 'post',
  34. );
  35. $post_method = array
  36. (
  37. 1 => '普通表单:application/x-www-form-urlencoded',
  38. 2 => '文件表单:multipart/form-data',
  39. 3 => 'JSON:application/json',
  40. //4 => 'XML:text/xml',
  41. );
  42. $response_state = array
  43. (
  44. 1 => '是',
  45. 2 => '否',
  46. );
  47. $response_type = array
  48. (
  49. 1 => '普通文本',
  50. 2 => 'JSON',
  51. 3 => 'XML',
  52. );
  53. return array
  54. (
  55. # 表名
  56. 'name' => 'channel',
  57. # 显示给用户看的名称
  58. 'lang' => '渠道设置',
  59. # 是否显示在后台菜单
  60. 'order' => 10,
  61. 'set' => array
  62. (
  63. 'method' => $method,
  64. 'post_method' => $post_method,
  65. ),
  66. # 数据结构
  67. 'struct' => array
  68. (
  69. 'id' => array
  70. (
  71. 'type' => 'int-11',
  72. 'name' => 'ID',
  73. 'default' => '',
  74. 'desc' => '',
  75. 'match' => 'is_numeric',
  76. 'list' => true,
  77. 'order' => 'desc',
  78. ),
  79. 'name' => array
  80. (
  81. 'type' => 'varchar-150',
  82. 'name' => '渠道名称',
  83. 'default' => '',
  84. 'desc' => '渠道名称',
  85. 'match' => 'is_string',
  86. 'update' => 'text',
  87. 'search' => 'fulltext',
  88. 'list' => true,
  89. 'edit' => true,
  90. ),
  91. 'appkey' => array
  92. (
  93. 'type' => 'varchar-150',
  94. 'name' => '渠道APPKEY',
  95. 'default' => '',
  96. 'desc' => '渠道APPKEY',
  97. 'match' => 'is_string',
  98. 'update' => 'text',
  99. 'search' => 'fulltext',
  100. 'list' => true,
  101. ),
  102. 'appsecret' => array
  103. (
  104. 'type' => 'varchar-150',
  105. 'name' => '渠道APPSecret',
  106. 'default' => '',
  107. 'desc' => '渠道APPSecret',
  108. 'match' => 'is_string',
  109. 'update' => 'text',
  110. 'search' => 'fulltext',
  111. //'list' => true,
  112. ),
  113. 'host' => array
  114. (
  115. 'type' => 'varchar-1000',
  116. 'name' => '渠道接口域名',
  117. 'default' => '',
  118. 'desc' => '渠道接口域名',
  119. 'match' => 'is_string',
  120. 'update' => 'text',
  121. 'search' => 'fulltext',
  122. 'list' => true,
  123. ),
  124. 'sign_method' => array
  125. (
  126. 'type' => 'tinyint-1',
  127. 'name' => '签名加密方式',
  128. 'default' => '1',
  129. 'desc' => '签名加密方式',
  130. 'match' => 'is_numeric',
  131. 'update' => 'radio',
  132. 'option' => $sign_method,
  133. 'tab' => 1,
  134. ),
  135. 'sign_col' => array
  136. (
  137. 'type' => 'varchar-1000',
  138. 'name' => '签名加密参数-按顺序做加密,用+号隔开,为空则所有字段均参与加密',
  139. 'default' => '',
  140. 'desc' => '签名加密参数',
  141. 'match' => 'option',
  142. 'update' => 'text',
  143. 'tab' => 1,
  144. ),
  145. 'sign_type' => array
  146. (
  147. 'type' => 'tinyint-1',
  148. 'name' => '签名加密形式',
  149. 'default' => '1',
  150. 'desc' => '签名加密形式',
  151. 'match' => 'is_numeric',
  152. 'update' => 'radio',
  153. 'option' => $sign_type,
  154. 'tab' => 1,
  155. ),
  156. 'sign_sort' => array
  157. (
  158. 'type' => 'tinyint-1',
  159. 'name' => '签名加密排序',
  160. 'default' => '1',
  161. 'desc' => '签名加密排序',
  162. 'match' => 'is_numeric',
  163. 'update' => 'radio',
  164. 'option' => $sign_sort,
  165. 'tab' => 1,
  166. ),
  167. 'sign_after' => array
  168. (
  169. 'type' => 'tinyint-1',
  170. 'name' => '签名加密后处理',
  171. 'default' => '1',
  172. 'desc' => '签名加密后处理',
  173. 'match' => 'is_numeric',
  174. 'update' => 'radio',
  175. 'option' => $sign_after,
  176. 'tab' => 1,
  177. ),
  178. 'method' => array
  179. (
  180. 'type' => 'tinyint-1',
  181. 'name' => '标准请求方式',
  182. 'default' => '1',
  183. 'desc' => '标准请求方式',
  184. 'match' => 'is_numeric',
  185. 'update' => 'radio',
  186. 'option' => $method,
  187. //'list' => true,
  188. 'control' => 'method',
  189. 'tab' => 2,
  190. ),
  191. 'post_method' => array
  192. (
  193. 'type' => 'tinyint-1',
  194. 'name' => '标准请求头设置',
  195. 'default' => '1',
  196. 'desc' => '标准请求头设置',
  197. 'match' => 'is_numeric',
  198. 'update' => 'radio',
  199. 'option' => $post_method,
  200. 'show' => 'method=2',
  201. 'tab' => 2,
  202. ),
  203. 'type' => array
  204. (
  205. 'type' => 'varchar-20',
  206. 'name' => '是否有标准请求参数',
  207. 'default' => '1,2',
  208. 'desc' => '是否有标准请求参数',
  209. 'match' => 'is_string',
  210. 'update' => 'checkbox',
  211. 'option' => $type,
  212. //'list' => true,
  213. 'control' => 'type',
  214. 'tab' => 2,
  215. ),
  216. 'middleware-channel_request_body'=> array
  217. (
  218. 'name' => '标准请求体参数',
  219. 'default' => '',
  220. 'desc' => '标准请求体参数',
  221. 'match' => 'option',
  222. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  223. 'sync' => array('id', 'channel_id'),
  224. 'update' => array(1),
  225. 'show' => 'type=1',
  226. 'tab' => 2,
  227. ),
  228. 'middleware-channel_request_header'=> array
  229. (
  230. 'name' => '标准请求头参数',
  231. 'default' => '',
  232. 'desc' => '标准请求头参数',
  233. 'match' => 'option',
  234. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  235. 'sync' => array('id', 'channel_id'),
  236. 'update' => array(1),
  237. 'show' => 'type=2',
  238. 'tab' => 2,
  239. ),
  240. 'response_state' => array
  241. (
  242. 'type' => 'tinyint-1',
  243. 'name' => '是否有标准响应参数',
  244. 'default' => '1',
  245. 'desc' => '是否有标准响应参数',
  246. 'match' => 'is_numeric',
  247. 'update' => 'radio',
  248. 'option' => $response_state,
  249. //'list' => true,
  250. 'control' => 'response_state',
  251. 'tab' => 3,
  252. ),
  253. 'response_type' => array
  254. (
  255. 'type' => 'tinyint-1',
  256. 'name' => '响应数据类型',
  257. 'default' => '1',
  258. 'desc' => '响应数据类型',
  259. 'match' => 'is_numeric',
  260. 'update' => 'radio',
  261. 'option' => $response_type,
  262. 'tab' => 3,
  263. 'show' => 'response_state=1',
  264. ),
  265. 'response_data' => array
  266. (
  267. 'type' => 'varchar-100',
  268. 'name' => '响应业务数据字段名',
  269. 'default' => '',
  270. 'desc' => '响应业务数据字段名',
  271. 'match' => 'is_string',
  272. 'update' => 'text',
  273. 'tab' => 3,
  274. 'show' => 'response_state=1',
  275. ),
  276. 'response_msg' => array
  277. (
  278. 'type' => 'varchar-100',
  279. 'name' => '响应信息字段名',
  280. 'default' => '',
  281. 'desc' => '响应信息字段名',
  282. 'match' => 'is_string',
  283. 'update' => 'text',
  284. 'tab' => 3,
  285. 'show' => 'response_state=1',
  286. ),
  287. 'response_code' => array
  288. (
  289. 'type' => 'varchar-100',
  290. 'name' => '响应状态码字段名',
  291. 'default' => '',
  292. 'desc' => '响应状态码字段名',
  293. 'match' => 'is_string',
  294. 'update' => 'text',
  295. 'tab' => 3,
  296. 'show' => 'response_state=1',
  297. ),
  298. 'middleware-channel_response_code'=> array
  299. (
  300. 'name' => '响应状态码列表-设置标准的响应状态码,也可以只设置成功值,其他值均为失败',
  301. 'default' => '',
  302. 'desc' => '响应状态码列表',
  303. 'match' => 'option',
  304. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  305. 'sync' => array('id', 'channel_id'),
  306. 'update' => array(1),
  307. 'show' => 'response_state=1',
  308. 'tab' => 3,
  309. ),
  310. 'reorder' => array
  311. (
  312. 'type' => 'int-11',
  313. 'name' => '排序(数值越大越靠前)',
  314. 'default' => '1',
  315. 'desc' => '请输入排序',
  316. 'match' => 'option',
  317. //'update' => 'text',
  318. 'search' => 'order',
  319. 'list_name' => '排序',
  320. 'list' => true,
  321. 'order' => 'desc',
  322. 'edit' => true,
  323. ),
  324. 'state' => array
  325. (
  326. 'type' => 'tinyint-1',
  327. 'name' => '状态',
  328. 'default' => '1',
  329. 'desc' => '请选择状态',
  330. 'match' => 'is_numeric',
  331. ),
  332. 'cdate' => array
  333. (
  334. 'type' => 'int-11',
  335. 'name' => '录入时间',
  336. 'match' => array('is_numeric', time()),
  337. 'desc' => '',
  338. # 只有insert时才生效
  339. 'insert' => true,
  340. //'search' => 'date',
  341. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  342. ),
  343. ),
  344. 'manage' => array
  345. (
  346. 'tab' => array('基本设置', '签名加密', '标准请求', '标准响应'),
  347. 'button' => array
  348. (
  349. //'类型配置' => array('list', 'supplier_type&oper_parent=supplier'),
  350. ),
  351. 'list_button' => array
  352. (
  353. //'location' => array('产品设置', Dever::url('lib/channel.setProduct', 'middleware')),
  354. 'list' => array('业务接口配置', 'channel_api&oper_table=channel&search_option_channel_id={id}'),
  355. )
  356. ),
  357. 'request' => array
  358. (
  359. )
  360. );