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.
50 lines
1.1 KiB
50 lines
1.1 KiB
<?php
|
|
|
|
|
|
namespace app\api\controller;
|
|
|
|
|
|
|
|
use app\api\logic\ArticleLogic;
|
|
use app\api\logic\ResourceLogic;
|
|
use app\common\basics\Api;
|
|
use app\common\server\JsonServer;
|
|
|
|
class Resource extends Api
|
|
{
|
|
public $like_not_need_login = ['category', 'lists', 'detail'];
|
|
/**
|
|
* @Notes: 文章分类
|
|
* @Author: 张无忌
|
|
*/
|
|
public function category()
|
|
{
|
|
$get = $this->request->get();
|
|
$lists = ResourceLogic::category($get);
|
|
return JsonServer::success('获取成功', $lists);
|
|
}
|
|
|
|
/**
|
|
* @Notes: 文章列表
|
|
* @Author: 张无忌
|
|
*/
|
|
public function lists()
|
|
{
|
|
$get = $this->request->get();
|
|
$get['page_no'] = $this->page_no;
|
|
$get['page_size'] = $this->page_size;
|
|
$lists = ResourceLogic::lists($get);
|
|
return JsonServer::success('获取成功', $lists);
|
|
}
|
|
|
|
/**
|
|
* @Notes: 文章详细
|
|
* @Author: 张无忌
|
|
*/
|
|
public function detail()
|
|
{
|
|
$id = $this->request->get('id');
|
|
$detail = ResourceLogic::detail($id,$this->user_id);
|
|
return JsonServer::success('获取成功', $detail);
|
|
}
|
|
}
|