using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 激活推广员请求
    /// </summary>
    [Message(MessageCode.ActivatePromotionRequest)]
    [MessagePackObject()]
    public class ActivatePromotionRequest : MessageData
    {
#if GameClient
        public static ActivatePromotionRequest Create()
        {
            return ReferencePool.Acquire<ActivatePromotionRequest>();
        }
#endif
    }
    
    /// <summary>
    /// 激活推广员响应
    /// </summary>
    [Message(MessageCode.ActivatePromotionResponse)]
    [MessagePackObject()]
    public class ActivatePromotionResponse : MessageData
    {
        [Key(0)]
        public int ResultCode;
    }

    /// <summary>
    /// 获取推广员信息请求
    /// </summary>
    [Message(MessageCode.GetUserIsPromotionRequest)]
    [MessagePackObject()]
    public class GetUserIsPromotionRequest : MessageData
    {
#if GameClient
        public static GetUserIsPromotionRequest Create()
        {
            return ReferencePool.Acquire<GetUserIsPromotionRequest>();
        }
#endif
    }
    
    /// <summary>
    /// 获取推广员信息响应
    /// </summary>
    [Message(MessageCode.GetUserIsPromotionResponse)]
    [MessagePackObject()]
    public class GetUserIsPromotionResponse : MessageData
    {
        /// <summary>
        /// 是否推广员
        /// </summary>
        [Key(0)]
        public bool IsPromoter;
    }

    /// <summary>
    /// 获取推广员奖励请求
    /// </summary>
    [Message(MessageCode.GetPromotionRewardDataRequest)]
    [MessagePackObject()]
    public class GetPromotionRewardDataRequest : MessageData
    {
        /// <summary>
        /// 年
        /// </summary>
        [Key(0)]
        public int Year;

        /// <summary>
        /// 月
        /// </summary>
        [Key(1)]
        public int Month;

#if GameClient
        public static GetPromotionRewardDataRequest Create(int year,int month)
        {
            GetPromotionRewardDataRequest request = ReferencePool.Acquire<GetPromotionRewardDataRequest>();
            request.Year = year;
            request.Month = month;
            return request;
        }
#endif
    }

    /// <summary>
    /// 获取推广员奖励响应
    /// </summary>
    [Message(MessageCode.GetPromotionRewardDataResponse)]
    [MessagePackObject()]
    public class GetPromotionRewardDataResponse : MessageData
    {
        [Key(0)]
        public PromotionRewardDataInfo[] RewardDataInfos;
    }

    [MessagePackObject()]
    public class PromotionRewardDataInfo
    {
        /// <summary>
        /// 上次登录的时间
        /// </summary>
        [Key(0)]
        public long LastLoginTime;

        /// <summary>
        /// 注册时间
        /// </summary>
        [Key(1)]
        public long RegTime;

        /// <summary>
        /// 玩家昵称
        /// </summary>
        [Key(2)]
        public string NickName;

        /// <summary>
        /// 行为类型
        /// </summary>
        [Key(3)]
        public byte BehaviorType;

        [Key(4)]
        public int Id;

        /// <summary>
        /// 奖励类型
        /// </summary>
        [Key(5)]
        public int RewardType;

        /// <summary>
        /// 奖励数值
        /// </summary>
        [Key(6)]
        public int RewardValue;
    }
}