From 6e882a77a2cdd00005ee646455b8076acc7d4804 Mon Sep 17 00:00:00 2001 From: Sarath Kumar Purushothaman Date: Fri, 23 Dec 2022 17:01:27 +0530 Subject: [PATCH] error --- .../master/controller/HomeController.java | 6 +- .../master/repos/IUsersRepository.java | 59 ------------------- 2 files changed, 4 insertions(+), 61 deletions(-) delete mode 100644 master/src/main/java/com/lampo/device_lab/master/repos/IUsersRepository.java diff --git a/master/src/main/java/com/lampo/device_lab/master/controller/HomeController.java b/master/src/main/java/com/lampo/device_lab/master/controller/HomeController.java index d45b2ff..97a5482 100644 --- a/master/src/main/java/com/lampo/device_lab/master/controller/HomeController.java +++ b/master/src/main/java/com/lampo/device_lab/master/controller/HomeController.java @@ -35,6 +35,7 @@ import com.lampo.device_lab.master.model.DeviceStatusModel; import com.lampo.device_lab.master.model.HeldBy; import com.lampo.device_lab.master.model.ModelDevice; +import com.lampo.device_lab.master.model.Photo; import com.lampo.device_lab.master.repos.IDeviceRepository; import com.lampo.device_lab.master.repos.IDeviceStatusRepository; import com.lampo.device_lab.master.repos.ITeamRepository; @@ -217,7 +218,8 @@ private String getDeviceType(@NonNull Device device) { private String getPhoneImage(@NonNull Device device) { String name = (device.getDeviceInformation().isAndroid() ? device.getDeviceInformation().getMarketName() : device.getDeviceInformation().getModel()).replaceAll("[\\(\\)]", " "); - return phoneImageService.getPhotoByName(name).stream().findFirst().orElseGet(() -> "default"); + return phoneImageService.getPhotoByName(name).stream().map(Photo::getName).findFirst() + .orElseGet(() -> "default"); } private String getUrl(@NonNull Device device, String clientIp) { @@ -286,4 +288,4 @@ private String getDisplayName(@NonNull Device device) { .collect(Collectors.toList()); } -} +} \ No newline at end of file diff --git a/master/src/main/java/com/lampo/device_lab/master/repos/IUsersRepository.java b/master/src/main/java/com/lampo/device_lab/master/repos/IUsersRepository.java deleted file mode 100644 index 5fa5a90..0000000 --- a/master/src/main/java/com/lampo/device_lab/master/repos/IUsersRepository.java +++ /dev/null @@ -1,59 +0,0 @@ -package com.lampo.device_lab.master.repos; - -import org.springframework.data.mongodb.repository.MongoRepository; - -import com.lampo.device_lab.master.model.User; - -/** - * MIT License
- *
- * - * Copyright (c) [2021] [PharmEasyEngg]
- *
- * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, prepare derivatives of the work, and to permit - * persons to whom the Software is furnished to do so, subject to the following - * conditions:
- *
- * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software.
- *
- * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE - * SOFTWARE.
- *
- * - * - * This software uses open-source dependencies that are listed under the - * licenses - {@link Eclipse - * Public License v2.0}, - * {@link Apache - * License 2.0}, {@link Server Side - * Public License}, - * {@link Mozilla Public - * License 2.0} and {@link MIT - * License}. Please go through the description of the licenses to understand - * the usage agreement.
- *
- * - * By using the license, you agree that you have read, understood and agree to - * be bound by, including without any limitation by these terms and that the - * entire risk as to the quality and performance of the software is with you. - * - */ -public interface IUsersRepository extends MongoRepository { - - User findByEmail(String email); - -}