apimanager add routelist
This commit is contained in:
66
catch/apimanager/model/RouteList.php
Normal file
66
catch/apimanager/model/RouteList.php
Normal file
@@ -0,0 +1,66 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | UCToo [ Universal Convergence Technology ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: UCToo <contact@uctoo.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace catchAdmin\apimanager\model;
|
||||
|
||||
use catchAdmin\apimanager\model\search\RouteListSearch;
|
||||
use catcher\base\CatchModel as Model;
|
||||
/**
|
||||
*
|
||||
* @property int $id
|
||||
* @property string $rule
|
||||
* @property string $route
|
||||
* @property string $method
|
||||
* @property string $name
|
||||
* @property string $domain
|
||||
* @property string $option
|
||||
* @property string $pattern
|
||||
* @property string $title
|
||||
* @property int $created_at
|
||||
* @property int $updated_at
|
||||
* @property int $deleted_at
|
||||
* @property int $creator_id
|
||||
*/
|
||||
class RouteList extends Model
|
||||
{
|
||||
use RouteListSearch;
|
||||
public $field = [
|
||||
//
|
||||
'id',
|
||||
//
|
||||
'rule',
|
||||
//
|
||||
'route',
|
||||
//
|
||||
'method',
|
||||
//
|
||||
'name',
|
||||
//
|
||||
'domain',
|
||||
//
|
||||
'option',
|
||||
//
|
||||
'pattern',
|
||||
//
|
||||
'title',
|
||||
// 创建时间
|
||||
'created_at',
|
||||
// 更新时间
|
||||
'updated_at',
|
||||
// 软删除字段
|
||||
'deleted_at',
|
||||
// 创建人ID
|
||||
'creator_id',
|
||||
];
|
||||
|
||||
public $name = 'route_list';
|
||||
|
||||
}
|
50
catch/apimanager/model/search/RouteListSearch.php
Normal file
50
catch/apimanager/model/search/RouteListSearch.php
Normal file
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
// +----------------------------------------------------------------------
|
||||
// | UCToo [ Universal Convergence Technology ]
|
||||
// +----------------------------------------------------------------------
|
||||
// | Copyright (c) 2014-2021 https://www.uctoo.com All rights reserved.
|
||||
// +----------------------------------------------------------------------
|
||||
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
|
||||
// +----------------------------------------------------------------------
|
||||
// | Author: UCToo <contact@uctoo.com>
|
||||
// +----------------------------------------------------------------------
|
||||
|
||||
namespace catchAdmin\apimanager\model\search;
|
||||
|
||||
use catchAdmin\apimanager\model\ApiCategory;
|
||||
|
||||
trait RouteListSearch
|
||||
{
|
||||
public function searchRuleAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('rule', $value);
|
||||
}
|
||||
|
||||
public function searchRouteAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('route', $value);
|
||||
}
|
||||
|
||||
public function searchMethodAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('method', $value);
|
||||
}
|
||||
|
||||
public function searchNameAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('name', $value);
|
||||
}
|
||||
public function searchDomainAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('domain', $value);
|
||||
}
|
||||
public function searchOptionAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('option', $value);
|
||||
}
|
||||
public function searchPatternAttr($query, $value, $data)
|
||||
{
|
||||
return $query->whereLike('pattern', $value);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user