apimanager add routelist

This commit is contained in:
uctoo
2021-11-12 16:52:09 +08:00
parent 086951f879
commit e648d1b150
13 changed files with 1096 additions and 326 deletions

View 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';
}

View 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);
}
}