/********************************
 *
 * 作者:吴隆健
 * 创建时间: 2019-06-15 15:47:11
 *
 ********************************/
#if Server
using System;

namespace GameData {

    /// <summary>
    /// 
    /// </summary>
    public class commodity {
        /// <summary>
		/// 商品id
		/// </summary>
		public int id;

        /// <summary>
        /// 商品类型 0游戏币 2房卡 3比赛卷 5都市放心购电子卷 20实物  4都市放心购电子卷 小程序使用.........
        /// </summary>
        public int sty;
		
		/// <summary>
		/// 单价
		/// </summary>
		public int money;
		
		/// <summary>
		/// 商品名称
		/// </summary>
		public string name;
		
		/// <summary>
		/// 价值 如果是游戏 内的物体表示的是游戏内物品的数量
		/// </summary>
		public int worth;
		
		/// <summary>
		/// 商品描述
		/// </summary>
		public string node;
		
		/// <summary>
		/// 0表示未开放  1表示正常上架  2表示已下架
		/// </summary>
		public int state;
		
		/// <summary>
		/// 商品图片数量
		/// </summary>
		public int imgCount;
		
		/// <summary>
		/// 商品库存
		/// </summary>
		public int kuCun;
		
		/// <summary>
		/// 商品其他描述 key_keyValue 配套使用
		/// </summary>
		public string[] key;
		
        /// <summary>
        /// 
        /// </summary>
        public string[] keyValue;
		
        /// <summary>
        /// 
        /// </summary>
		public commodity(){}
		
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
		public override string ToString()
		{
			string str = "";
			str += "玩家id:" + id;
			str += ",商品类型:" +sty;
			str += ",商品单价:" +money;
			str += ",商品名称:" +name;
			str += ",商品价值:" +worth;
			str += ",商品描述:" +node;
			str += ",商品状态:" +state;
			str += ",商品图片数量:" +imgCount;
			str += ",商品库存:" + kuCun;
			
			if(key != null){
				int len = key.Length;
				for(int i=0;i<len;i++)
					str += "," +key[i] + ":" + keyValue[i];
			}
			return str;
			//return string.Format("[commodity Id={0}, Sty={1}, Money={2}, Name={3}, Worth={4}, Node={5}, State={6}, ImgCount={7}, KuCun={8}, Key={9}, KeyValue={10}]", id, sty, money, name, worth, node, state, imgCount, kuCun, key, keyValue);
		}
    }

    /// <summary>
	/// 玩家信息
	/// </summary>
	public class PlayerInfo{
		
		/// <summary>
		/// 用户唯一id
		/// </summary>
		public int userid;
		
		/// <summary>
		/// 收货信息
		/// </summary>
		public ShippingAddress info;// = new ShippingAddress();
		
        /// <summary>
        /// 
        /// </summary>
		public PlayerInfo(){}
		
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
		public override string ToString()
		{
			string str = "";
			str += "玩家id:" + userid;
			str += "用户电话:" + info.phone;
			str += "用户名字:" + info.name;
			str += "用户邮编:" + info.postalcode;
			str += "用户地址:" + info.Address;
			return str;
		}
	}
	#endif
	
	#if Server
	/// <summary>
	/// 收货地址
	/// </summary>
	public class ShippingAddress{
		/// <summary>
		/// 用户电话
		/// </summary>
		public string phone;
		
		/// <summary>
		/// 收货人名字
		/// </summary>
		public string name;
		
		/// <summary>
		/// 邮政编码
		/// </summary>
		public string postalcode;
		
		/// <summary>
		/// 用户地址
		/// </summary>
		public string Address;
		
        /// <summary>
        /// 
        /// </summary>
		public ShippingAddress(){}
	}

	/// <summary>
	/// 兑换记录
	/// </summary>
	public class convertRecord{
		
		/// <summary>
		/// 玩家userid
		/// </summary>
		public int userid;
		
		/// <summary>
		/// 购买数量
		/// </summary>
		public int mallCount;
		
		/// <summary>
		/// 购买时间
		/// </summary>
		public string shipTime;
		
		/// <summary>
		/// 收货信息
		/// </summary>
		public ShippingAddress address;// = new ShippingAddress();
		
		/// <summary>
		/// 数量
		/// </summary>
		public int count;
		
		/// <summary>
		/// 商品id
		/// </summary>
		public int commnid;
		
		/// <summary>
		/// 商品名称
		/// </summary>
		public string commname;
		
		/// <summary>
		/// 商品类型
		/// </summary>
		public int sty;
		
		/// <summary>
		/// 商品价值
		/// </summary>
		public int worth;
		
		/// <summary>
		/// 单价
		/// </summary>
		public int moeny;
		
		/// <summary>
		/// 商品描述
		/// </summary>
		public string code;
		
		/// <summary>
		/// 1表示等待发货  2表示发货中  3表示交易完成
		/// </summary>
		public int state;
		
		/// <summary>
		/// 快递单号
		/// </summary>
		public string kuaididang;
		
        /// <summary>
        /// 
        /// </summary>
		public convertRecord(){}
		
        /// <summary>
        /// 
        /// </summary>
        /// <returns></returns>
		public override string ToString()
		{
			string str = "";
			str += "玩家userid:" + userid;
			str += "玩家兑换次数:" + mallCount;
			str += "兑换时间:" + shipTime;
			str += "玩家电话:" + address.phone;
			str += "玩家名字:" + address.name;
			str += "玩家邮编:" + address.postalcode;
			str += "玩家地址:" + address.Address;
			str += "购买数量:" + count;
			str += "商品id:" + commnid;
			str += "商品名称:" + commname;
			str += "商品类型:" + sty;
			str += "商品价值:" + worth;
			str += "商品单价:" + moeny;
			str += "商品描述:" + code;
			str += "商品状态:" + state;
			str += "快递单号:" + kuaididang;
			return str;
		}
	}
	/// <summary>
	/// 商品包
	/// </summary>
	public class commoditysPack{
		
		/// <summary>
		/// 获取到的商品
		/// </summary>
		public commodity[] commoditys;
		
        /// <summary>
        /// 
        /// </summary>
		public commoditysPack(){}
		
	}

	/// <summary>
	/// 兑换记录包
	/// </summary>
	public class mallrecords{
        /// <summary>
        /// 
        /// </summary>
		public convertRecord[] records;
		
        /// <summary>
        /// 
        /// </summary>
		public mallrecords(){}
	}

}	
#endif

