using MessagePack;
using Server.Core;

namespace NetWorkMessage
{
    [Message(MessageOpcode.PayInnerRPCRequest)]
    [ResponseType(typeof(PayInnerRPCResponse))]
    [MessagePackObject] 
    public class PayInnerRPCRequest : MessageObject,IRequest
    {
        [Key(0)]public uint RpcId { get; set; }
        [Key(1)]public string TradeNo { get; set; } // 订单号
        [Key(2)]public string UserUUID { get; set; } // 附带得请求UUID
        [Key(3)]public string IP { get; set; } // 附带得请求Ip
        
        public static PayInnerRPCRequest Create()
        {
            PayInnerRPCRequest request = ReferencePool.Fetch<PayInnerRPCRequest>();
            return request;
        }
    }
    
    [Message(MessageOpcode.PayInnerRPCResponse)]
    [MessagePackObject]
    public class PayInnerRPCResponse : MessageObject, IResponse
    {
        [Key(0)]public uint RpcId { get; set; }
        [Key(1)]public int Error { get; set; }
        [Key(2)]public string Message { get; set; }
        [Key(3)]public string Body { get; set; }
        [Key(4)]public int PaymentChannel { get; set; }
    }
    
    [Message(MessageOpcode.PayC2SSuccessNotifyInnerRPCRequest)]
    [ResponseType(typeof(PayC2SSuccessNotifyInnerRPCResponse))]
    [MessagePackObject] 
    public class PayC2SSuccessNotifyInnerRPCRequest : MessageObject, IRequest
    {
        [Key(0)]public uint RpcId { get; set; }
        [Key(1)]public int UserId { get; set; }
        [Key(2)]public int PaymentChannel { get; set; }
        [Key(3)]public string Body { get; set; }
        
        public static PayC2SSuccessNotifyInnerRPCRequest Create()
        {
            PayC2SSuccessNotifyInnerRPCRequest request = ReferencePool.Fetch<PayC2SSuccessNotifyInnerRPCRequest>();
            return request;
        }
    }
    
    [Message(MessageOpcode.PayC2SSuccessNotifyInnerRPCResponse)]
    [MessagePackObject]
    public class PayC2SSuccessNotifyInnerRPCResponse : MessageObject, IResponse
    {
        [Key(0)]public uint RpcId { get; set; }
        [Key(1)]public int Error { get; set; }
        [Key(2)]public string Message { get; set; }
    }
}