| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125 | 
							- <?php
 
- /**
 
-  * token
 
-  */
 
-  
 
- # 定义几个常用的选项
 
- $option = array
 
- (
 
- 	1 => '启用',
 
- 	2 => '关闭',
 
- );
 
- return array
 
- (
 
- 	# 表名
 
- 	'name' => 'token',
 
- 	# 显示给用户看的名称
 
- 	'lang' => 'token',
 
- 	'menu' => false,
 
- 	# 数据结构
 
- 	'struct' => array
 
- 	(
 
- 		'id' 		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'ID',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '',
 
- 			'match' 	=> 'is_numeric',
 
- 			'search'	=> 'order',
 
- 			'list'		=> true,
 
- 		),
 
- 		'site'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '站点',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入站点',
 
- 			'match' 	=> 'is_numeric',
 
- 			//'search'	=> 'order,fulltext',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'token'		=> array
 
- 		(
 
- 			'type' 		=> 'varchar-255',
 
- 			'name' 		=> 'token',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入token',
 
- 			'match' 	=> 'is_string',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'expires_in'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> 'expires_in',
 
- 			'default' 	=> '',
 
- 			'desc' 		=> '请输入expires_in',
 
- 			'match' 	=> 'is_numeric',
 
- 			'update'	=> 'text',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'mdate'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '更新时间',
 
- 			'match' 	=> array('is_numeric', time()),
 
- 			'desc' 		=> '',
 
- 		),
 
- 		
 
- 		'state'		=> array
 
- 		(
 
- 			'type' 		=> 'tinyint-1',
 
- 			'name' 		=> '状态',
 
- 			'default' 	=> '1',
 
- 			'desc' 		=> '请选择状态',
 
- 			'match' 	=> array('is_numeric', 1),
 
- 			'option' 	=> $option,
 
- 			'update'	=> 'radio',
 
- 			'list'		=> true,
 
- 		),
 
- 		
 
- 		'cdate'		=> array
 
- 		(
 
- 			'type' 		=> 'int-11',
 
- 			'name' 		=> '录入时间',
 
- 			'match' 	=> array('is_numeric', time()),
 
- 			'desc' 		=> '',
 
- 			# 只有insert时才生效
 
- 			'insert'	=> true,
 
- 		),
 
- 	),
 
- 	# 更新表结构
 
- 	'alter' => array
 
- 	(
 
- 		1 => array
 
- 		(
 
- 			array('update', 'name', 'site', 'int-11  站点'),
 
- 		),
 
- 		'version' => 1,
 
- 	),
 
- 	'auth' => 'site',
 
- 	
 
- 	# request 请求接口定义
 
- 	'request' => array
 
- 	(
 
- 		# 根据hash取一条数据
 
- 		'info' => array
 
- 		(
 
- 			# 匹配的正则或函数 必填项
 
- 			'where' => array
 
- 			(
 
- 				'site' => 'yes',
 
- 			),
 
- 			'type' => 'one',
 
- 		),
 
- 	),
 
- );
 
 
  |