package xmlres // Root 对应 XML 根节点 type ShopRoot struct { Items []ShopItem `xml:"item"` // 所有 子节点映射为 Items 切片 } // Item 对应 XML 中的 节点 type ShopItem struct { ItemID string `xml:"itemID,attr"` // 物品ID(属性) Name string `xml:"name,attr"` // 物品名称(属性) ProductID string `xml:"productID,attr"` // 商品ID(属性,可能为空) Price int `xml:"price,attr"` // 金豆价格(属性,整数) Vip float64 `xml:"vip,attr"` // VIP折扣(属性,小数) MoneyType string `xml:"moneyType,attr"` // 货币类型(属性,部分item可能缺失) }