ADD:添加后台管理端接口;

DEL:删除不必要的头部注释;
FIX:修正若干已知错误;
This commit is contained in:
2025-07-13 19:40:10 +08:00
parent 0a45e55cca
commit 270b881437
66 changed files with 8618 additions and 8129 deletions
@@ -0,0 +1,59 @@
<?php
namespace api\controllers\client\v1;
use Yii;
use yii\data\Pagination;
use vendor\huawei\obsclient\Hwobs;
use vendor\huawei\obsclient\TemporarySignature;
use vendor\huawei\obsclient\PostObject;
class ObsController extends Common
{
public function actionIndex()
{
$apis = [
'getkey'=>'获取访问Key',
];
$this->result('您正使用CMTS系统-华为云OBS接口(尚未开启)!', $apis, 200);
}
private function getconf()
{
return [
'id'=> 'ee124c5102064b83bccd2fdda53261cc', //账号ID
'ak'=> '1DYBXUNEPNCIEEQOGGAE',
'sk'=> '0VBI2xPlDB0NtqqVJv3hSFC8DY52G8OYPYNhncGK',
'area'=>'cn-south-1', //华南广州
'endpoint'=>'obs.cn-south-1.myhuaweicloud.com',
'bucketName'=>'hilu-ctms',
];
}
public function actionGetkey()
{
$params = $this->getconf();
$obs = new Hwobs($ak=$params['ak'], $sk=$params['sk'], $endpoint=$params['endpoint'], $t1=30, $t2=10);
}
public function actionGeturl()
{
$params = $this->getconf();
$obs = new TemporarySignature($ak=$params['ak'], $sk=$params['sk'], $endpoint=$params['endpoint'], $t1=30, $t2=10);
$res = $obs->UploadUrl($params['bucketName']);
// $res = $obs->getCors($params['bucketName']);
var_dump($res);
// $this->result('获取上传网址成功!', $res, 200);
}
public function actionGetform()
{
$params = $this->getconf();
$obs = new PostObject($ak=$params['ak'], $sk=$params['sk'], $endpoint=$params['endpoint'], $t1=30, $t2=10);
$obs->init('obs');
$res = $obs->claimPost('hilu-ctms', 'file.jpg');
$url = 'https://'.$params['bucketName'].".".$params['endpoint'];
$res['up_url'] = $url;
$this->result('获取OBS上传准备信息!', $res, 200);
}
}