channel_api.php 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248
  1. <?php
  2. $method = array(-1 => '使用渠道标准请求方式');
  3. $method += Dever::db('middleware/channel')->config['set']['method'];
  4. $post_method = Dever::db('middleware/channel')->config['set']['post_method'];
  5. $task = array
  6. (
  7. 1 => '非定时任务',
  8. 2 => '定时轮询任务',
  9. );
  10. $status = array
  11. (
  12. 1 => '可执行',
  13. 2 => '已完成',
  14. );
  15. $response_type = array
  16. (
  17. 1 => '普通文本',
  18. 2 => 'JSON',
  19. 3 => 'XML',
  20. );
  21. return array
  22. (
  23. # 表名
  24. 'name' => 'channel_api',
  25. # 显示给用户看的名称
  26. 'lang' => '渠道接口配置',
  27. # 是否显示在后台菜单
  28. 'order' => -10,
  29. 'menu' => false,
  30. 'info' => '',
  31. # 数据结构
  32. 'struct' => array
  33. (
  34. 'id' => array
  35. (
  36. 'type' => 'int-11',
  37. 'name' => 'ID',
  38. 'default' => '',
  39. 'desc' => '',
  40. 'match' => 'is_numeric',
  41. 'list' => true,
  42. 'order' => 'desc',
  43. ),
  44. 'channel_id' => array
  45. (
  46. 'type' => 'int-11',
  47. 'name' => '渠道id',
  48. 'default' => '1',
  49. 'desc' => '渠道id',
  50. 'match' => 'is_numeric',
  51. 'update' => 'hidden',
  52. 'value' => Dever::input('search_option_channel_id'),
  53. ),
  54. 'name' => array
  55. (
  56. 'type' => 'varchar-150',
  57. 'name' => '接口名称',
  58. 'default' => '',
  59. 'desc' => '接口名称',
  60. 'match' => 'is_string',
  61. 'update' => 'text',
  62. 'search' => 'fulltext',
  63. 'list' => true,
  64. ),
  65. 'uri' => array
  66. (
  67. 'type' => 'varchar-1000',
  68. 'name' => '接口地址',
  69. 'default' => '',
  70. 'desc' => '接口地址',
  71. 'match' => 'is_string',
  72. 'update' => 'text',
  73. 'search' => 'fulltext',
  74. 'list' => true,
  75. ),
  76. 'sign_col' => array
  77. (
  78. 'type' => 'varchar-1000',
  79. 'name' => '签名加密参数-按顺序做加密,用+号隔开,为空则所有字段均参与加密',
  80. 'default' => '',
  81. 'desc' => '签名加密参数',
  82. 'match' => 'option',
  83. 'update' => 'text',
  84. 'tab' => 1,
  85. ),
  86. 'method' => array
  87. (
  88. 'type' => 'tinyint-1',
  89. 'name' => '请求方式',
  90. 'default' => '-1',
  91. 'desc' => '请求方式',
  92. 'match' => 'is_numeric',
  93. 'update' => 'radio',
  94. 'option' => $method,
  95. //'list' => true,
  96. 'control' => 'method',
  97. ),
  98. 'post_method' => array
  99. (
  100. 'type' => 'tinyint-1',
  101. 'name' => '请求头设置',
  102. 'default' => '1',
  103. 'desc' => '请求头设置',
  104. 'match' => 'is_numeric',
  105. 'update' => 'radio',
  106. 'option' => $post_method,
  107. 'show' => 'method=2',
  108. ),
  109. 'middleware-channel_api_request'=> array
  110. (
  111. 'name' => '业务请求参数',
  112. 'default' => '',
  113. 'desc' => '业务请求参数',
  114. 'match' => 'option',
  115. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  116. 'sync' => array('id', 'api_id'),
  117. 'update' => array(1),
  118. ),
  119. 'middleware-channel_api_response'=> array
  120. (
  121. 'name' => '业务响应参数',
  122. 'default' => '',
  123. 'desc' => '业务响应参数',
  124. 'match' => 'option',
  125. # 同步更新另外一个表的内容,两个表相关联的id,更新另一个表的字段
  126. 'sync' => array('id', 'api_id'),
  127. 'update' => array(1),
  128. ),
  129. 'task' => array
  130. (
  131. 'type' => 'tinyint-1',
  132. 'name' => '定时请求',
  133. 'default' => '1',
  134. 'desc' => '定时请求',
  135. 'match' => 'is_numeric',
  136. 'update' => 'radio',
  137. 'option' => $task,
  138. 'control' => 'task',
  139. ),
  140. 'ldate' => array
  141. (
  142. 'type' => 'int-11',
  143. 'name' => '下次执行时间',
  144. 'match' => 'is_numeric',
  145. 'desc' => '请选择执行时间',
  146. 'update' => 'date',
  147. 'callback' => 'maketime',
  148. //'list' => 'date("Y-m-d H:i:s", {ldate})',
  149. 'show' => 'task=2',
  150. ),
  151. 'time' => array
  152. (
  153. 'type' => 'int-11',
  154. 'name' => '每次时间间隔-输入数值为与上次执行时间间隔的秒数,为0则执行一次',
  155. 'default' => '0',
  156. 'match' => 'is_numeric',
  157. 'desc' => '请输入时间间隔',
  158. 'update' => 'text',
  159. 'show' => 'task=2',
  160. ),
  161. 'reorder' => array
  162. (
  163. 'type' => 'int-11',
  164. 'name' => '排序(数值越大越靠前)',
  165. 'default' => '1',
  166. 'desc' => '请输入排序',
  167. 'match' => 'option',
  168. //'update' => 'text',
  169. 'search' => 'order',
  170. 'list_name' => '排序',
  171. 'list' => true,
  172. 'order' => 'desc',
  173. 'edit' => true,
  174. ),
  175. 'status' => array
  176. (
  177. 'type' => 'tinyint-1',
  178. 'name' => '状态',
  179. 'default' => '1',
  180. 'desc' => '请选择状态',
  181. 'match' => 'is_numeric',
  182. 'option' => $status,
  183. 'list' => true,
  184. ),
  185. 'state' => array
  186. (
  187. 'type' => 'tinyint-1',
  188. 'name' => '状态',
  189. 'default' => '1',
  190. 'desc' => '请选择状态',
  191. 'match' => 'is_numeric',
  192. ),
  193. 'cdate' => array
  194. (
  195. 'type' => 'int-11',
  196. 'name' => '录入时间',
  197. 'match' => array('is_numeric', time()),
  198. 'desc' => '',
  199. # 只有insert时才生效
  200. 'insert' => true,
  201. //'search' => 'date',
  202. 'list' => 'date("Y-m-d H:i:s", {cdate})',
  203. ),
  204. ),
  205. 'manage' => array
  206. (
  207. //'insert' => false,
  208. //'edit' => false,
  209. # 自定义快捷新增和编辑
  210. 'button' => array
  211. (
  212. //'新增' => array('fast'),
  213. ),
  214. 'list_button' => array
  215. (
  216. //'edit' => array('编辑'),
  217. //'list' => array('字段列表', 'service_product_col&oper_table=service_product&top_table=service&search_option_product_id={id}'),
  218. )
  219. ),
  220. 'request' => array
  221. (
  222. )
  223. );