项目相关接口、图片视频上传
This commit is contained in:
48
app/Http/Controllers/UploadController.php
Normal file
48
app/Http/Controllers/UploadController.php
Normal file
@@ -0,0 +1,48 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\BaseApp\BaseController;
|
||||
use App\Service\common\UploadService;
|
||||
use App\Service\ProjectService;
|
||||
use App\Service\RoleService;
|
||||
use Illuminate\Http\JsonResponse;
|
||||
|
||||
class UploadController extends BaseController
|
||||
{
|
||||
//
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->service = UploadService::getInstance();
|
||||
}
|
||||
|
||||
/**
|
||||
* 图片上传
|
||||
* @Method POST
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function image()
|
||||
{
|
||||
$file = request()->file('file');
|
||||
return jok(
|
||||
$this->service->uploadImage($file),
|
||||
'上传成功'
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* 视频上传
|
||||
* @Method POST
|
||||
* @return JsonResponse
|
||||
*/
|
||||
public function video()
|
||||
{
|
||||
$file = request()->file('file');
|
||||
return jok(
|
||||
$this->service->uploadVideo($file),
|
||||
'上传成功'
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user