You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.4 KiB
43 lines
1.4 KiB
using System.Threading.Tasks;
|
|
using Znyc.Admin.Commons.Json;
|
|
using Znyc.Admin.Commons.Services;
|
|
using Znyc.Admin.Security.Dtos;
|
|
using Znyc.Admin.Security.Entitys;
|
|
using Znyc.Admin.Security.IRepositories;
|
|
using Znyc.Admin.Security.IServices;
|
|
|
|
namespace Znyc.Admin.Security.Services
|
|
{
|
|
public class AdminUserLogOnService : BaseService<AdminUserLogOn, UserLogOnOutputDto, long>, IAdminUserLogOnService
|
|
{
|
|
private readonly IAdminUserLogOnRepository _userLogOnRepository;
|
|
|
|
public AdminUserLogOnService(IAdminUserLogOnRepository repository) : base(repository)
|
|
{
|
|
_userLogOnRepository = repository;
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据会员ID获取用户登录信息实体
|
|
/// </summary>
|
|
/// <param name="userId"></param>
|
|
/// <returns></returns>
|
|
public AdminUserLogOn GetByUserId(long userId)
|
|
{
|
|
return _userLogOnRepository.GetByUserId(userId);
|
|
}
|
|
|
|
/// <summary>
|
|
/// 根据会员ID获取用户登录信息实体
|
|
/// </summary>
|
|
/// <param name="info">主题配置信息</param>
|
|
/// <param name="userId">用户Id</param>
|
|
/// <returns></returns>
|
|
public async Task<bool> SaveUserTheme(UserThemeInputDto info, long userId)
|
|
{
|
|
string themeJsonStr = info.ToJson();
|
|
string where = $"UserId='{userId}'";
|
|
return await _userLogOnRepository.UpdateTableFieldAsync("Theme", themeJsonStr, where);
|
|
}
|
|
}
|
|
}
|