using DS.Module.Core.Extensions; using DS.Module.UserModule; using DS.WMS.Core.Sys.Entity; using Microsoft.Extensions.DependencyInjection; using NLog; using SqlSugar; namespace DS.Module.MultiLanguage; public class MultiLanguageService:IMultiLanguageService { private readonly IServiceProvider _serviceProvider; private readonly ISqlSugarClient db; private readonly IUser user; private static readonly Logger Logger = LogManager.GetCurrentClassLogger(); /// /// 构造函数 /// /// public MultiLanguageService(IServiceProvider serviceProvider) { _serviceProvider = serviceProvider; db = _serviceProvider.GetRequiredService(); user = _serviceProvider.GetRequiredService(); } public string GetMultiLanguageInfo(string multiCode, string language) { var result = string.Empty; var setInfo = db.Queryable().Where(x => x.MultiCode == multiCode && x.LanguageType == language) .First(); if (setInfo.IsNotNull()) { result = setInfo.Content; } return result; } }