|
@@ -241,6 +241,7 @@ func (this *ResourceController) VideoUpload() {
|
|
|
savePath += fileName
|
|
|
|
|
|
//上传到阿里云 和 minio
|
|
|
+ resourceUrl := ``
|
|
|
if utils.ObjectStorageClient == "minio" {
|
|
|
err = services.UploadVideoToMinIo(fileName, fpath, savePath)
|
|
|
if err != nil {
|
|
@@ -248,6 +249,7 @@ func (this *ResourceController) VideoUpload() {
|
|
|
br.ErrMsg = "文件上传失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resourceUrl = utils.MinIoImghost + savePath
|
|
|
} else {
|
|
|
err = services.UploadVideoAliyun(fileName, fpath, savePath)
|
|
|
if err != nil {
|
|
@@ -255,10 +257,11 @@ func (this *ResourceController) VideoUpload() {
|
|
|
br.ErrMsg = "文件上传失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resourceUrl = utils.Imghost + savePath
|
|
|
}
|
|
|
utils.FileLog.Info("%s:", time.Now().Format(utils.FormatDateTime))
|
|
|
utils.FileLog.Info("end update oss ")
|
|
|
- resourceUrl := utils.Imghost + savePath
|
|
|
+
|
|
|
|
|
|
item := new(models.Resource)
|
|
|
item.ResourceUrl = resourceUrl
|
|
@@ -415,6 +418,7 @@ func (this *ResourceController) VoiceUpload() {
|
|
|
savePath := utils.Upload_Audio_Dir + time.Now().Format("200601/20060102/")
|
|
|
savePath += fileName
|
|
|
//上传到阿里云 和 minio
|
|
|
+ resourceUrl := ``
|
|
|
if utils.ObjectStorageClient == "minio" {
|
|
|
err = services.UploadVideoToMinIo(fileName, fpath, savePath)
|
|
|
if err != nil {
|
|
@@ -422,6 +426,7 @@ func (this *ResourceController) VoiceUpload() {
|
|
|
br.ErrMsg = "文件上传失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resourceUrl = utils.MinIoImghost + savePath
|
|
|
} else {
|
|
|
err = services.UploadVideoAliyun(fileName, fpath, savePath)
|
|
|
if err != nil {
|
|
@@ -429,10 +434,11 @@ func (this *ResourceController) VoiceUpload() {
|
|
|
br.ErrMsg = "文件上传失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resourceUrl = utils.Imghost + savePath
|
|
|
}
|
|
|
utils.FileLog.Info(fmt.Sprintf("%s:", time.Now().Format(utils.FormatDateTime)))
|
|
|
utils.FileLog.Info("end update oss ")
|
|
|
- resourceUrl := utils.Imghost + savePath
|
|
|
+
|
|
|
|
|
|
item := new(models.Resource)
|
|
|
item.ResourceUrl = resourceUrl
|
|
@@ -577,6 +583,7 @@ func (this *ResourceController) UploadImageBase64() {
|
|
|
savePath += fileName
|
|
|
|
|
|
//上传到阿里云 和 minio
|
|
|
+ resourceUrl := ``
|
|
|
if utils.ObjectStorageClient == "minio" {
|
|
|
err = services.UploadFileToMinIo(fileName, fpath, savePath)
|
|
|
if err != nil {
|
|
@@ -584,6 +591,7 @@ func (this *ResourceController) UploadImageBase64() {
|
|
|
br.ErrMsg = "文件上传失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resourceUrl = utils.MinIoImghost + savePath
|
|
|
} else {
|
|
|
err = services.UploadFileToAliyun(fileName, fpath, savePath)
|
|
|
if err != nil {
|
|
@@ -591,11 +599,12 @@ func (this *ResourceController) UploadImageBase64() {
|
|
|
br.ErrMsg = "文件上传失败,Err:" + err.Error()
|
|
|
return
|
|
|
}
|
|
|
+ resourceUrl = utils.Imghost + savePath
|
|
|
}
|
|
|
utils.FileLog.Info("%s:", time.Now().Format(utils.FormatDateTime))
|
|
|
utils.FileLog.Info("end update oss ")
|
|
|
|
|
|
- resourceUrl := utils.Imghost + savePath
|
|
|
+
|
|
|
|
|
|
item := new(models.Resource)
|
|
|
item.ResourceUrl = resourceUrl
|