前台部分接口

This commit is contained in:
2025-05-07 14:48:34 +08:00
parent 6e963b23b0
commit d3bb8380e2
19 changed files with 575 additions and 62 deletions

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

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

View 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(),
'轮播图列表'
);
}
}

View File

@@ -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(),
'获取成功'
);
}
}