1
0
mirror of https://gitee.com/koogua/course-tencent-cloud.git synced 2025-06-21 03:17:05 +08:00
koogua cbc2e5762a !11 阶段性合并
* 根据app需要作出相应调整
* 路由增加命名name,增加app应用管理
* 完成基本API,增加h5和小程序支付定义
2020-11-10 10:25:16 +08:00

50 lines
924 B
PHP

<?php
namespace App\Http\Api\Controllers;
use App\Services\MyStorage as StorageService;
/**
* @RoutePrefix("/api/upload")
*/
class UploadController extends Controller
{
/**
* @Post("/avatar/img", name="api.upload.avatar_img")
*/
public function uploadAvatarImageAction()
{
$service = new StorageService();
$file = $service->uploadAvatarImage();
if (!$file) {
return $this->jsonError(['msg' => '上传文件失败']);
}
$data = [
'src' => $service->getImageUrl($file->path),
'title' => $file->name,
];
return $this->jsonSuccess(['data' => $data]);
}
/**
* @Post("/im/img", name="api.upload.im_img")
*/
public function uploadImImageAction()
{
}
/**
* @Post("/im/file", name="api.upload.im_file")
*/
public function uploadImFileAction()
{
}
}