YellowBullShopImpl.java 856 字节
Newer Older
C
chenjianqiang 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
package com.pattern.ProxyPattern.materials.po;

/**
 * 黄牛正在为你服务
 *
 * @author lx
 * @date 2021/11/8 13:28
 **/
public class YellowBullShopImpl implements TicketService {

    private final BeijingStationImpl bjStation;

    public YellowBullShopImpl(BeijingStationImpl bjStation) {
        this.bjStation = bjStation;
    }

    /**
     * 咨询票务
     */
    @Override
    public void consultation(String question) {
        runNote();
        bjStation.consultation(question);
    }

    /**
     * 卖票
     */
    @Override
    public void sellT() {
        runNote();
        bjStation.sellT();
    }

    /**
     * 退票
     */
    @Override
    public void backT() {
        runNote();
        bjStation.backT();
    }


    private void runNote() {
        System.out.println("黄牛正在为你服务。。。");
    }
}