using System.Collections.Generic;
using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    [Message(MessageCode.ClubBanGroupEditorRequest)]
    [MessagePackObject]
    public class ClubBanGroupEditorRequest : MessageData
    {
        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 0 普通俱乐部  1 联赛
        /// </summary>
        [Key(1)] public byte OperatorType;

        /// <summary>
        /// 4添加组 1删除组 2往组里面添加人 3从组里面删除人 不用0，防止默认值
        /// </summary>
        [Key(2)] public int Style;

        /// <summary>
        /// 组Id
        /// </summary>
        [Key(3)] public string BanId;

        /// <summary>
        /// 操作的用户
        /// </summary>
        [Key(4)] public List<int> UserIds;

#if GameClient
        public static ClubBanGroupEditorRequest Create(int clubId)
        {
            ClubBanGroupEditorRequest request = ReferencePool.Acquire<ClubBanGroupEditorRequest>();
            request.ClubId = clubId;
            return request;
        }

        public override void Clear()
        {
            OperatorType = 0;
            Style = 0;
            BanId = null;
            UserIds = null;
        }
#endif
    }

    [Message(MessageCode.ClubBanGroupEditorResponse)]
    [MessagePackObject]
    public class ClubBanGroupEditorResponse : MessageData
    {
        /// <summary>
        /// 结果代码，0表示成功
        /// </summary>
        [Key(0)] public int ResultCode;

        /// <summary>
        /// 0 普通俱乐部  1 联赛
        /// </summary>
        [Key(1)] public byte OperatorType;

        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(2)] public int ClubId;

        /// <summary>
        /// 操作类型: 4添加组 1删除组 2往组里面添加人 3从组里面删除人
        /// </summary>
        [Key(3)] public int Style;

        /// <summary>
        /// 组Id
        /// </summary>
        [Key(4)] public string BanId;

        /// <summary>
        /// 用户ID列表
        /// </summary>
        [Key(5)] public List<int> UserIds;
    }

    [Message(MessageCode.ClubBanGroupGetRequest)]
    [MessagePackObject]
    public class ClubBanGroupGetRequest : MessageData
    {
        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 0 表示俱乐部界面 1 表示联赛页面
        /// </summary>
        [Key(1)] public int PageType;

#if GameClient
        public static ClubBanGroupGetRequest Create(int clubId,int pageType)
        {
            ClubBanGroupGetRequest request = ReferencePool.Acquire<ClubBanGroupGetRequest>();
            request.ClubId = clubId;
            request.PageType = pageType;
            return request;
        }
#endif
    }

    [Message(MessageCode.ClubBanGroupGetResponse)]
    [MessagePackObject]
    public class ClubBanGroupGetResponse : MessageData
    {
        [Key(0)] public int ResultCode;

        /// <summary>
        /// 0 表示俱乐部界面 1 表示联赛页面
        /// </summary>
        [Key(1)] public int PageType;

        /// <summary>
        /// 俱乐部Id
        /// </summary>
        [Key(2)] public int ClubId;

        /// <summary>
        /// 封禁组列表
        /// </summary>
        [Key(3)] public List<ClubBanGroup> BanGroups;
    }

    [MessagePackObject]
    public class ClubBanGroup
    {
        /// <summary>
        /// 封禁组Id
        /// </summary>
        [Key(0)] public string Id;

        /// <summary>
        /// 封禁用户信息列表
        /// </summary>
        [Key(1)] public List<ClubBanUserInfo> Users;
    }

    [MessagePackObject]
    public class ClubBanUserInfo
    {
        /// <summary>
        /// 用户昵称
        /// </summary>
        [Key(0)] public string NickName;

        /// <summary>
        /// 用户Id
        /// </summary>
        [Key(1)] public int UserId;

        /// <summary>
        /// 用户性别
        /// </summary>
        [Key(2)] public int Sex;
    }
}