multi-store/app/api/controller/UploadController.php

43 lines
838 B
PHP
Raw Normal View History

2024-05-30 21:37:55 +08:00
<?php
2024-06-04 16:51:26 +08:00
2024-05-30 21:37:55 +08:00
namespace app\api\controller;
2024-06-04 16:51:26 +08:00
2024-05-30 21:37:55 +08:00
use app\common\service\UploadService;
use Exception;
2024-06-14 15:53:47 +08:00
2024-06-04 16:51:26 +08:00
2024-05-30 21:37:55 +08:00
class UploadController extends BaseApiController
{
/**
* @notes 上传图片
* @author 乔峰
* @date 2021/12/29 16:27
*/
public function image()
{
try {
$cid = $this->request->post('cid', 0);
$result = UploadService::image($cid);
return $this->success('上传成功', $result);
2024-06-04 16:37:27 +08:00
} catch (\Exception $e) {
2024-05-30 21:37:55 +08:00
return $this->fail($e->getMessage());
}
}
2024-06-04 16:51:26 +08:00
2024-05-30 21:37:55 +08:00
/**
* @notes 上传视频
* @author 乔峰
* @date 2021/12/29 16:27
*/
public function video()
{
try {
$cid = $this->request->post('cid', 0);
$result = UploadService::video($cid);
return $this->success('上传成功', $result);
} catch (Exception $e) {
return $this->fail($e->getMessage());
}
}
2024-06-04 16:51:26 +08:00
}