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
2 years ago
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|