修改家庭档案接口

This commit is contained in:
2023-03-21 13:54:54 +08:00
parent cf12f1f0ab
commit 84d1ebbc12
7 changed files with 403 additions and 95 deletions
+17 -7
View File
@@ -92,10 +92,9 @@ class Oss
try {
$ossClient = $this->createClient();
$object = "applet/doctor/card/".$filename;
$ossClient->putObject($this->config['bucket'], $object, $content);
$ossClient->putObject($this->config['bucket'], $filename, $content);
return $object;
return $filename;
}catch(\Exception $e) {
throw new BusinessException($e->getMessage());
}
@@ -112,10 +111,6 @@ class Oss
{
try {
$ossClient = $this->createClient();
// 将图片缩放为固定宽高100 px后,再旋转90°。
$options = array(
OssClient::OSS_PROCESS => $style);
@@ -126,4 +121,19 @@ class Oss
}
}
/**
* 下载文件到内存
* @param string $filename
* @param string $style
* @return string
*/
public function getObjectToRAM(string $filename): string
{
try {
$ossClient = $this->createClient();
return $ossClient->getObject($this->config['bucket'], $filename);
}catch(\Exception $e) {
throw new BusinessException($e->getMessage());
}
}
}