using Long.Common.Basedata;
using Long.Core.Query;
using Long.DAO.Basedata;

namespace Long.Service.AdminService.Basedata
{
    /// <summary>
    /// 系统用户 服务
    /// </summary>
    public class SystemUserService : ISystemUserService
    {
        private readonly ISystemUserDatabase systemUserDatabase = new SystemUserDatabase();

        /// <summary>
        /// 获取全部实体列表
        /// </summary>
        /// <returns></returns>
        public async Task<IEnumerable<SystemUser>> Get()
        {
            return await systemUserDatabase.GetAsync();
        }

        /// <summary>
        /// 通过条件获取实体列表
        /// </summary>
        /// <param name="queryParamenter"></param>
        /// <returns></returns>
        public async Task<IEnumerable<SystemUser>> Get(QueryParamenter queryParamenter)
        {
            return await systemUserDatabase.GetAsync(queryParamenter);
        }

        /// <summary>
        /// 通过 Id 获取系统用户实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public async Task<SystemUser> GetById(long id)
        {
            return await systemUserDatabase.GetFirstAsync(id);
        }
    }
}
