捕梦者基础框架API接口
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

114 lines
2.9 KiB

<?php
declare (strict_types=1);
namespace app\api\controller;
use app\api\model\ImageStorages;
use think\App;
/**
* 系统日志
* @package app\api\controller
*/
class UploadLog extends Common
{
public $model = null;
public function __construct(App $app)
{
parent::__construct($app);
$this->model = new \app\api\model\UploadLog();
}
/**
* @OA\Get (
* path="uploadLog/index",tags={"上传日志管理"},summary="获取上传日志列表",description="根据相关参数获取日志列表",
* @OA\Parameter(ref="#/components/parameters/token"),
* @OA\Parameter(name="username",in="query",description="管理员名称",@OA\Schema (type="string")),
* @OA\Parameter(name="model",in="query",description="操作模块",@OA\Schema (type="string")),
* @OA\Parameter (name="page",in="query",description="当前页码",@OA\Schema (type="integer",format="int15")),
* @OA\Parameter (name="limit",in="query",description="分页数量",@OA\Schema (type="integer",format="int15")),
* @OA\Response(
* response=200,
* description="返回管理员用户数据信息",
* ),
* ),
*/
public function index()
{
//接受参数
$_get = $this->request->get();
//指定搜索参数
// $this->model->search_arr = ['current'];
//数据处理
$_data = $this->model->index();
//返回数据
return send_http_status($_data);
}
public function add()
{
//接收参数
$_post = $this->request->post();
//处理并返回参数
$insertId = $this->model->parentAdd($_post);
return send_http_status($insertId, $insertId ? 201 : 202);
}
/**
* @Log [sys_name]在[sys_time] 删除了文件数据
*/
public function delete()
{
//接收参数
$ids = $this->request->param('id');
//验证参数
validate(['ids|id' => 'require|length:1,1000'])->check(['ids' => $ids]);
//处理并返回数据
return send_http_status('', $this->model->parentDel($ids) ? 205 : 206);
}
public function getSiteLists()
{
//数据处理
$_data = $this->model->getLists();
//返回数据
return send_http_status($_data);
}
public function getTagLists()
{
$tagLists = config('dict.sqlfields.image_storage_type');
$senddData = [];
foreach ($tagLists as $key => $val) {
$item = [];
$item['title'] = $key;
$item['name'] = $val;
$senddData[] = $item;
}
return send_http_status($senddData);
}
public function getStorageImages()
{
$model = new ImageStorages();
$model->search_arr = ['title'];
$_data = $model->getStorgaeImagesLists();
//返回数据
return send_http_status($_data);
}
}