基础功能、图片上传

This commit is contained in:
2025-05-12 16:13:46 +08:00
parent 8e30209540
commit 4f2e662b7d
16 changed files with 533 additions and 211 deletions

View File

@@ -0,0 +1,47 @@
<?php
namespace App\Http\Controllers\Api;
use App\BaseApp\BaseController;
use App\Service\common\UploadService;
use Illuminate\Http\JsonResponse;
class UploadController extends BaseController
{
//
public function __construct()
{
parent::__construct();
$this->service = UploadService::getInstance();
}
/**
* 图片上传
* @Method POST
* @return JsonResponse
* @throws \Exception
*/
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),
'上传成功'
);
}
}