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.
|
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
|
|
}
|