You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
1.2 KiB
C#
41 lines
1.2 KiB
C#
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();
|
|
|
|
/// <summary>
|
|
/// 构造函数
|
|
/// </summary>
|
|
/// <param name="serviceProvider"></param>
|
|
public MultiLanguageService(IServiceProvider serviceProvider)
|
|
{
|
|
_serviceProvider = serviceProvider;
|
|
db = _serviceProvider.GetRequiredService<ISqlSugarClient>();
|
|
user = _serviceProvider.GetRequiredService<IUser>();
|
|
}
|
|
|
|
public string GetMultiLanguageInfo(string multiCode, string language)
|
|
{
|
|
var result = string.Empty;
|
|
var setInfo = db.Queryable<SysLanguageSet>().Where(x => x.MultiCode == multiCode && x.LanguageType == language)
|
|
.First();
|
|
if (setInfo.IsNotNull())
|
|
{
|
|
result = setInfo.Content;
|
|
}
|
|
|
|
return result;
|
|
}
|
|
|
|
} |