|
@@ -1,9 +1,13 @@
|
|
|
package cn.efunbox.audio.impl;
|
|
|
|
|
|
import cn.efunbox.audio.consts.Status;
|
|
|
+import cn.efunbox.audio.entity.Album;
|
|
|
import cn.efunbox.audio.entity.Device;
|
|
|
+import cn.efunbox.audio.repository.AlbumRepo;
|
|
|
import cn.efunbox.audio.repository.DeviceRepo;
|
|
|
import cn.efunbox.audio.service.DeviceService;
|
|
|
+import cn.efunbox.audio.utils.ApiCode;
|
|
|
+import cn.efunbox.audio.utils.ApiResult;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.data.domain.Page;
|
|
@@ -15,6 +19,7 @@ import org.springframework.util.CollectionUtils;
|
|
|
import java.sql.Timestamp;
|
|
|
import java.util.Date;
|
|
|
import java.util.List;
|
|
|
+import java.util.Objects;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
/**
|
|
@@ -26,6 +31,9 @@ public class DeviceServiceImpl implements DeviceService {
|
|
|
@Autowired
|
|
|
DeviceRepo deviceRepo;
|
|
|
|
|
|
+ @Autowired
|
|
|
+ AlbumRepo albumRepo;
|
|
|
+
|
|
|
@Override
|
|
|
public boolean CheckRegister(Long idChannel, String idDevice){
|
|
|
List<Device> list = deviceRepo.findByChannelDevice(idChannel, idDevice);
|
|
@@ -146,4 +154,13 @@ public class DeviceServiceImpl implements DeviceService {
|
|
|
}
|
|
|
return null;
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public List<Album> findAlbum(String idDevice) {
|
|
|
+ List<Device> devices = deviceRepo.findByDevice(idDevice);
|
|
|
+ if(Objects.isNull(devices)){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return albumRepo.findAlbum(idDevice);
|
|
|
+ }
|
|
|
}
|