前台部分接口
This commit is contained in:
18
app/Http/Controllers/CollectionController.php
Normal file
18
app/Http/Controllers/CollectionController.php
Normal file
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\CollectionService;
|
||||
|
||||
class CollectionController extends BaseController
|
||||
{
|
||||
//
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = CollectionService::getInstance();
|
||||
$this->insertField = ['project_id'];
|
||||
}
|
||||
}
|
||||
21
app/Http/Controllers/FileController.php
Normal file
21
app/Http/Controllers/FileController.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\FileService;
|
||||
use App\Service\ProjectService;
|
||||
use App\Service\RoleService;
|
||||
|
||||
class FileController extends BaseController
|
||||
{
|
||||
//
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = FileService::getInstance();
|
||||
$this->insertField = ['url', 's'];
|
||||
$this->updateField = ['id', 'url', 's'];
|
||||
}
|
||||
}
|
||||
36
app/Http/Controllers/HomeController.php
Normal file
36
app/Http/Controllers/HomeController.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\HomeService;
|
||||
use App\Service\ProjectService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
use Psr\Container\ContainerExceptionInterface;
|
||||
use Psr\Container\NotFoundExceptionInterface;
|
||||
|
||||
class HomeController extends BaseController
|
||||
{
|
||||
//
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = HomeService::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* 轮播图列表
|
||||
* @Method GET
|
||||
* @return JsonResponse
|
||||
* @throws ContainerExceptionInterface
|
||||
* @throws NotFoundExceptionInterface
|
||||
*/
|
||||
public function carousel(): JsonResponse
|
||||
{
|
||||
return jok(
|
||||
$this->service->carousel(),
|
||||
'轮播图列表'
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -53,4 +53,32 @@ class UserController extends BaseController
|
||||
'重置密码成功'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户信息
|
||||
* @Method GET
|
||||
* @return JsonResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function myInfo(): JsonResponse
|
||||
{
|
||||
return jok(
|
||||
$this->service->myInfo(),
|
||||
'获取成功'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取当前用户信息
|
||||
* @Method GET
|
||||
* @return JsonResponse
|
||||
* @throws Exception
|
||||
*/
|
||||
public function userStats(): JsonResponse
|
||||
{
|
||||
return jok(
|
||||
$this->service->userStats(),
|
||||
'获取成功'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user