using MessagePack;

namespace GameMessage
{
    /// <summary>
    /// 获取验证码
    /// </summary>
    [Message(MessageCode.PhoneVerifyCodeRequest)]
    [MessagePackObject]
    public class PhoneVerifyCodeRequest : MessageData
    {
        /// <summary>
        /// 手机号
        /// </summary>
        [Key(0)]public string PhoneNumber { get; set; }
        /// <summary>
        /// 验证码用途类型
        /// </summary>
        [Key(1)]public PhoneVerifyCodeType CodeType { get; set; } 
        
#if GameClient
        public static PhoneVerifyCodeRequest Create()
        {
            return GameFramework.ReferencePool.Acquire<PhoneVerifyCodeRequest>();
        }
#endif
    }
    
    [Message(MessageCode.PhoneVerifyCodeResponse)]
    [MessagePackObject]
    public class PhoneVerifyCodeResponse : MessageData
    {
        [Key(0)]public int ErrorCode { get; set; }
        /// <summary>
        /// 剩余冷却时间
        /// </summary>
        [Key(1)]public int RemainTime { get; set; }
    }

    public enum PhoneVerifyCodeType
    {
        Login = 0,// 登录/注册模板
        ResetPassword, // 重置密码模板
        BindPhoneNumber,// 绑定新手机号模板
        GetAccountInfo, //获取账号信息
        JianCaiRace, //建材比赛
    }
}