channel_api.php 5.1 KB

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