using Masuit.Tools.Models;
using Masuit.Tools;
using PVDEMCS.Common;
using PVDEMCS.Common.DI;
using PVDEMCS.Services.Models;
using PVDEMCS.Services.Repositories.Entities;

namespace PVDEMCS.Services.Repositories
{
    /// <summary>
    /// 用户信息 数据层 接口
    /// </summary>
    public interface ISysUserRepository : IDependency
    {
        /// <summary>
        /// 获取用户信息分页列表
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="activated">是否其哟个</param>
        /// <param name="page">当前页</param>
        /// <param name="size">页大小</param>
        /// <returns></returns>
        Result<PagedList<SysUser>> GetSysUserPageList(string userName, bool? activated, int page, int size);

        /// <summary>
        /// 获取用户明细
        /// </summary>
        /// <param name="id">id</param>
        /// <param name="userName">名称</param>
        /// <returns></returns>
        Result<SysUserEntity> GetSysUserDetail(string id, string userName);

        /// <summary>
        /// 添加用户
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Result AddSysUser(SysUserEntity entity);

        /// <summary>
        /// 更新用户
        /// </summary>
        /// <param name="entity"></param>
        /// <returns></returns>
        Result UpdateSysUser(SysUserEntity entity);

        /// <summary>
        /// 更新用户密码
        /// </summary>
        /// <param name="id">用户id</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        Result UpdatePassword(string id, string pwd);

        /// <summary>
        /// 删除用户
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Result DeleteUser(string id);
    }
}
