using System;
using Hncore.Pass.BaseInfo.Models;

namespace Hncore.Pass.BaseInfo.Response
{
    public class UserLoginResponse
    {
        public string Token { get; set; }

        public WxMpUserModel MpUser{get;set;}

        public UserLoginModel User { get; set; }
    }
    public class UserLoginModel
    {
        public int Id { get; set; }
        public int TenantId { get; set; }
        public string LoginCode { get; set; }
        /// <summary>
        /// 微信昵称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 微信头像
        /// </summary>
        public string Phone { get; set; }

        /// <summary>
        /// 注册来源
        /// </summary>
        public string Profile { get; set; }
        /// <summary>
        /// 状态
        /// </summary>
        public int Enabled { get; set; }

        /// <summary>
        /// 头像地址[30
        /// </summary>
        public string PhotoUrl { get; set; }

        /// <summary>
        /// 是否主管理员权限
        /// </summary>
        public DateTime? LastLoginDate { get; set; }

        public int Sex { get; set; }
        public string OpenId { get; set; }
        public UserLoginModel FromEntity(User manager)
        {
            Id = manager.Id;
            LastLoginDate = manager.LastLoginDate;
            TenantId = manager.TenantId;
            LoginCode = manager.LoginCode;
            Phone = manager.Phone;
            LoginCode = manager.LoginCode;
            Profile = manager.Profile;
            Enabled = manager.Enabled;
            PhotoUrl = manager.PhotoUrl;
            return this;
        }
    }

    public class WxMpUserModel
    {
        public string AppId { get; set; }

        public string OpenId { get; set; }
    }
}