using MessagePack;
#if GameClient
using GameFramework;
#endif

namespace GameMessage
{
    /// <summary>
    /// 管理员权限设置
    /// </summary>
    [Message(MessageCode.ClubManagerPowerRequest)]
    [MessagePackObject]
    public class ClubManagerPowerRequest : MessageData
    {
        /// <summary>
        /// 俱乐部id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 管理员的ID
        /// </summary>
        [Key(1)] public int ManagerUserId;

        /// <summary>
        /// 要设置的管理员权限
        /// </summary>
        [Key(2)] public int Permission;

#if GameClient

        public static ClubManagerPowerRequest Create()
        {
            return ReferencePool.Acquire<ClubManagerPowerRequest>();
        }

        public override void Clear()
        {
            ClubId = 0;
            ManagerUserId = 0;
            Permission = 0;
        }

#endif
    }

    /// <summary>
    /// 管理员权限设置响应
    /// </summary>
    [Message(MessageCode.ClubManagerPowerResponse)]
    [MessagePackObject]
    public class ClubManagePowerResponse : MessageData
    {
        /// <summary>
        /// 俱乐部id
        /// </summary>
        [Key(0)] public int ClubId;

        /// <summary>
        /// 错误消息
        /// </summary>
        [Key(1)] public string ErrorMessage;
    }

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

        [Key(1)] public int ManagerUserId;

        /// <summary>
        /// 升级还是降级
        /// </summary>
        [Key(2)] public int UpOrDown;

#if GameClient
        public static ClubManagerPersonRequest Create()
        {
            return ReferencePool.Acquire<ClubManagerPersonRequest>();
        }

        public override void Clear()
        {
            ClubId = 0;
            ManagerUserId = 0;
            UpOrDown = 0;
        }
#endif
    }

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

        [Key(1)] public int ManagerUserId;

        [Key(2)] public int UpOrDown;

        [Key(3)] public int ResultCode;

        [Key(4)] public string ErrorMessage;
    }
}