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.
44 lines
1.5 KiB
44 lines
1.5 KiB
2 years ago
|
using System.Threading.Tasks;
|
||
|
using Znyc.Cloudcar.Admin.Commons.Json;
|
||
|
using Znyc.Cloudcar.Admin.Commons.Services;
|
||
|
using Znyc.Cloudcar.Admin.Security.Dtos;
|
||
|
using Znyc.Cloudcar.Admin.Security.Entitys;
|
||
|
using Znyc.Cloudcar.Admin.Security.IRepositories;
|
||
|
using Znyc.Cloudcar.Admin.Security.IServices;
|
||
|
|
||
|
namespace Znyc.Cloudcar.Admin.Security.Services
|
||
|
{
|
||
|
public class AdminUserLogOnService : BaseService<AdminUserLogOnEntity, 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 AdminUserLogOnEntity 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);
|
||
|
}
|
||
|
}
|
||
|
}
|