public interface Payment {
// 每次增加一个支付渠道,我们就要去维护这个接口一次
// public final static Payment ALI_PAY = new AliPay();
// public final static Payment JD_PAY = new JDPay();
// public final static Payment WECHAT_PAY = new WeChatPay();
// public final static Payment UNION_PAY = new UnionPay();
PayState pay(String uid, double amount);
}
AliPay.class
public class AliPay implements Payment {
public PayState pay(String uid, double amount) {
System.out.println("欢迎使用支付宝");
System.out.println("查询余额,开始扣款");
return new PayState(200,"支付成功",amount);
}
}
JDPay.class
public class JDPay implements Payment {
public PayState pay(String uid, double amount) {
System.out.println("欢迎使用京东白条支付");
System.out.println("查询余额,开始扣款");
return new PayState(200,"支付成功",amount);
}
}
UnionPay.class
public class UnionPay implements Payment {
public PayState pay(String uid, double amount) {
System.out.println("欢迎使用银联卡支付");
System.out.println("查询余额,开始扣款");
return new PayState(200,"支付成功",amount);
}
}
WeChatPay.class
public class WeChatPay implements Payment {
public PayState pay(String uid, double amount) {
System.out.println("欢迎使用微信支付");
System.out.println("直接从微信红包扣款");
return new PayState(200,"支付成功",amount);
}
}
public class Server
{
//用来存储所有连接上来的客户
private List<ServerThread> clients;
public static void main(String[] args)
{
Server s = new Server();
s.startServer(9988);
}
publi
I got serveral questions about auto.offset.reset. This configuration parameter governs how consumer read the message from Kafka when there is no initial offset in ZooKeeper or
two cursors.
Make the first cursor go K steps first.
/*
* 第 13 题:题目:输入一个单向链表,输出该链表中倒数第 k 个节点
*/
public void displayKthItemsBackWard(ListNode head,int k){
ListNode p1=head,p2=head;
一、sh 脚本不执行的原因
sh脚本不执行的原因 只有2个
1.权限不够
2.sh脚本里路径没写完整。
二、解决You have new mail in /var/spool/mail/root
修改/usr/share/logwatch/default.conf/logwatch.conf配置文件
MailTo =
MailFrom
三、查询连接数
$ git push joe prod-2295-1
To [email protected]:joe.le/dr-frontend.git
! [rejected] prod-2295-1 -> prod-2295-1 (non-fast-forward)
error: failed to push some refs to '[email protected]