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

namespace Long.Service.AdminService.Basedata
{
    /// <summary>
    /// 系统用户 服务
    /// </summary>
    public class UserService : IUserService
    {
        private readonly IUserDatabase _userDatabase = new UserDatabase();

        /// <summary>
        /// 获取全部实体列表
        /// </summary>
        /// <returns></returns>
        public IEnumerable<User> Get()
        {
            return _userDatabase.Get();
        }

        /// <summary>
        /// 通过条件获取实体列表
        /// </summary>
        /// <param name="queryParamenter"></param>
        /// <returns></returns>
        public IEnumerable<User> Get(QueryParamenter queryParamenter)
        {
            return _userDatabase.Get(queryParamenter);
        }

        /// <summary>
        /// 通过 Id 获取系统用户实体
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public User GetById(long id)
        {
            return _userDatabase.GetFirst(id);
        }
    }
}
