using Microsoft.Extensions.Logging; using SlnMesnac.Model.domain; using SlnMesnac.Repository.service.@base; using System; using System.Collections.Generic; using System.Linq.Expressions; using System.Security.Cryptography; using System.Text; namespace SlnMesnac.Repository.service.Impl { public class VisionSettingServiceImpl : BaseServiceImpl, IVisionSettingService { private ILogger _logger; public VisionSettingServiceImpl(Repository repository, ILogger logger) : base(repository) { _logger = logger; } public List GetList() { try { var res = _rep.GetList(); if (res == null) { return new List(); } return res; } catch (Exception ex) { _logger.LogError($"获取视觉配置列表错误"); return new List(); } } public List GetList(Expression> expression) { try { var res = _rep.GetList(expression); if (res == null) { return new List(); } return res; } catch (Exception ex) { _logger.LogError($"获取视觉配置列表错误"); return new List(); } } public VisionSetting GetVisionSettingByAMRGUID(string guid) { try { var res = _rep.GetSingle(x => x.AMRGUID == guid); if (res == null) { return new VisionSetting(); } return res; } catch(Exception ex) { _logger.LogError($"根据AMRGUID获取视觉配置错误"); return new VisionSetting(); } } public VisionSetting GetVisionSettingByID(string id) { try { var res = _rep.GetSingle(x => x.VisionID == id); if (res == null) { return new VisionSetting(); } return res; } catch (Exception ex) { _logger.LogError($"根据VisionID获取视觉配置错误"); return new VisionSetting(); } } } }