|
@@ -10,6 +10,7 @@ import cn.efunbox.audio.utils.ApiCode;
|
|
import cn.efunbox.audio.utils.ApiResult;
|
|
import cn.efunbox.audio.utils.ApiResult;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.apache.commons.lang3.StringUtils;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
+import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.Page;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.PageRequest;
|
|
import org.springframework.data.domain.Pageable;
|
|
import org.springframework.data.domain.Pageable;
|
|
@@ -34,6 +35,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|
@Autowired
|
|
@Autowired
|
|
AlbumRepo albumRepo;
|
|
AlbumRepo albumRepo;
|
|
|
|
|
|
|
|
+ @Value("${efunbox.oss.img.url}")
|
|
|
|
+ private String imgURL;
|
|
|
|
+
|
|
@Override
|
|
@Override
|
|
public boolean CheckRegister(Long idChannel, String idDevice){
|
|
public boolean CheckRegister(Long idChannel, String idDevice){
|
|
List<Device> list = deviceRepo.findByChannelDevice(idChannel, idDevice);
|
|
List<Device> list = deviceRepo.findByChannelDevice(idChannel, idDevice);
|
|
@@ -161,6 +165,12 @@ public class DeviceServiceImpl implements DeviceService {
|
|
if(Objects.isNull(devices)){
|
|
if(Objects.isNull(devices)){
|
|
return null;
|
|
return null;
|
|
}
|
|
}
|
|
|
|
+ List<Album> albums = albumRepo.findAlbum(idDevice);
|
|
|
|
+ albums.stream().forEach(album -> {
|
|
|
|
+ if(Objects.nonNull(album.getImage())){
|
|
|
|
+ album.setImage(imgURL + album.getImage());
|
|
|
|
+ }
|
|
|
|
+ });
|
|
return albumRepo.findAlbum(idDevice);
|
|
return albumRepo.findAlbum(idDevice);
|
|
}
|
|
}
|
|
}
|
|
}
|