using CloudGaming.Model.DbSqlServer.Db_User;

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace CloudGaming.DtoModel.Account.User;

/// <summary>
/// 用户信息
/// </summary>
public class UserInfo
{
    /// <summary>
    /// 用户昵称
    /// </summary>
    public string NickName { get; set; }

    /// <summary>
    /// 用户id
    /// </summary>
    public int UserId { get; set; }
    /// <summary>
    /// 用户手机号
    /// </summary>
    public string PhoneNum { get; set; }

    /// <summary>
    /// 用户邮箱
    /// </summary>
    public string Email { get; set; }

    /// <summary>
    /// 用户头像
    /// </summary>
    public string UserIcon { get; set; }

    /// <summary>
    /// 用户钻石
    /// </summary>
    public int Diamond { get; set; }

    /// <summary>
    /// 总游玩时间（分钟）
    /// </summary>
    public int TotalGamingTime { get; set; }

    /// <summary>
    /// 用户是否实名认证
    /// </summary>
    public bool IsRealName { get; set; }

    /// <summary>
    /// 是否未成年
    /// </summary>
    public bool IsJuveniles { get; set; }

    /// <summary>
    /// 实名认证名称
    /// </summary>
    public string UserName { get; set; }

    /// <summary>
    /// 身份证号
    /// </summary>
    public string IdCard { get; set; }
    /// <summary>
    /// 包夜卡数据
    /// </summary>

    public UserInfoNightCard NightCard { get; set; } = new UserInfoNightCard();

    /// <summary>
    /// 用户vip信息
    /// </summary>
    public UserInfoPlayGameCard UserVipInfo { get; set; } = new UserInfoPlayGameCard();

    /// <summary>
    /// 用户游玩时间，分钟
    /// </summary>
    public int UserPlayGameTime { get; set; }
}


/// <summary>
/// 包夜卡
/// </summary>
public class UserInfoNightCard
{
    public UserInfoNightCard() { }
    /// <summary>
    /// 是否是包夜卡用户
    /// </summary>
    public bool IsNightCard { get; set; }

    /// <summary>
    /// 包夜卡过期时间
    /// </summary>
    public string NightCardExpireDateTime { get; set; }
}

/// <summary>
/// 会员卡
/// </summary>
public class UserInfoPlayGameCard
{
    public UserInfoPlayGameCard()
    {
        VipNameTips = "";
    }

    /// <summary>
    /// 
    /// </summary>
    /// <param name="t_User_Currency"></param>
    public UserInfoPlayGameCard(T_User_Currency t_User_Currency)
    {
        if (t_User_Currency != null && t_User_Currency.CurrencyType == (int)UserCurrencyType.会员卡)
        {
            if (t_User_Currency.ExpirationAt != null && t_User_Currency.ExpirationAt.Value > DateTime.Now)
            {
                ExpireDateTime = t_User_Currency.ExpirationAt;
                VipNameTips = t_User_Currency.CurrencyName;
            }
        }
    }
    private bool isVip;
    /// <summary>
    /// 是否是vip用户
    /// </summary>
    public bool IsVip
    {
        get
        {
            if (this.ExpireDateTime != null && this.ExpireDateTime.Value > DateTime.Now)
            {
                return true;
            }
            return false;
        }
        set
        {
            isVip = value;
        }
    }

    /// <summary>
    /// Vip过期时间
    /// </summary>
    public DateTime? ExpireDateTime { get; set; }

    /// <summary>
    /// vip显示提示
    /// </summary>
    public string VipNameTips { get; set; }

}