|
|
|
@ -21,6 +21,7 @@ import com.elink.esua.epdc.dao.OssDao; |
|
|
|
import com.elink.esua.epdc.dto.UploadDTO; |
|
|
|
import com.elink.esua.epdc.entity.OssEntity; |
|
|
|
import com.elink.esua.epdc.service.OssService; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
@ -34,6 +35,7 @@ import java.util.Date; |
|
|
|
import java.util.List; |
|
|
|
import java.util.Map; |
|
|
|
|
|
|
|
@Slf4j |
|
|
|
@Service |
|
|
|
public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implements OssService { |
|
|
|
|
|
|
|
@ -149,4 +151,24 @@ public class OssServiceImpl extends BaseServiceImpl<OssDao, OssEntity> implement |
|
|
|
return new Result<List<String>>().ok(resultList); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
public UploadDTO uploadXxxdVoice(String itemVoiceUrl) { |
|
|
|
String resultUr=""; |
|
|
|
try { |
|
|
|
//实例化url
|
|
|
|
URL url1 = new URL(itemVoiceUrl); |
|
|
|
//载入图片到输入流
|
|
|
|
DataInputStream dataInputStream = new DataInputStream(url1.openStream()); |
|
|
|
resultUr = OssFactory.build().uploadSuffix(dataInputStream, "mp3"); |
|
|
|
log.info("uploadXxxdVoice上传成功,url:::"+resultUr); |
|
|
|
} catch (MalformedURLException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} catch (IOException e) { |
|
|
|
e.printStackTrace(); |
|
|
|
} |
|
|
|
UploadDTO uploadDTO=new UploadDTO(); |
|
|
|
uploadDTO.setUrl(resultUr); |
|
|
|
return uploadDTO; |
|
|
|
} |
|
|
|
} |
|
|
|
|