模拟下单付款 下单付款后, 库存Manager减一,钱包Manager
public class PlayFace
{
private readonly GoodsManager _goodsManager;
private readonly WalletManager _walletManager;
public PlayFace()
{
_goodsManager =new GoodsManager();
_walletManager = new WalletManager();
}
public void Buy()
{
_goodsManager.Buy();
_walletManager.Buy();
}
}
public class GoodsManager
{
public void Buy()
{
Console.WriteLine("商品下单");
}
}
public class WalletManager
{
public void Buy()
{
Console.WriteLine("钱包下单");
}
}
class Program
{
static void Main(string[] args)
{
var playFace = new PlayFace();
playFace.Buy();
}
}