You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
16 lines
292 B
16 lines
292 B
2 years ago
|
package factory
|
||
|
|
||
|
func CreateCashAccept(t int) Casher {
|
||
|
var cash Casher
|
||
|
switch t {
|
||
|
case 1: //正常
|
||
|
cash = new(CashNormal)
|
||
|
case 2: //8折
|
||
|
cash = &CashRebate{moneyRebate: 0.8}
|
||
|
case 3: //满300减50
|
||
|
cash = &CashReturn{moneyCondition: 300, moneyReturn: 50}
|
||
|
default:
|
||
|
}
|
||
|
return cash
|
||
|
}
|