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.
42 lines
817 B
42 lines
817 B
|
1 year ago
|
package allpay
|
||
|
|
|
||
|
|
import (
|
||
|
|
"reflect"
|
||
|
|
"server/modules/pay/base"
|
||
|
|
"server/modules/pay/bfpay"
|
||
|
|
"server/modules/pay/grepay"
|
||
|
|
"server/modules/pay/igeekpay"
|
||
|
|
"server/modules/pay/luckinpay"
|
||
|
|
"server/modules/pay/pluspay"
|
||
|
|
|
||
|
|
"github.com/liangdas/mqant/log"
|
||
|
|
)
|
||
|
|
|
||
|
|
type AllPay struct {
|
||
|
|
Invalid struct{}
|
||
|
|
Igeek func(b *base.Base)
|
||
|
|
Plus func(b *base.Base)
|
||
|
|
Luckin func(b *base.Base)
|
||
|
|
BF func(b *base.Base)
|
||
|
|
Grepay func(b *base.Base)
|
||
|
|
}
|
||
|
|
|
||
|
|
var All = &AllPay{}
|
||
|
|
|
||
|
|
func init() {
|
||
|
|
All.Igeek = igeekpay.NewSub
|
||
|
|
All.Plus = pluspay.NewSub
|
||
|
|
All.Luckin = luckinpay.NewSub
|
||
|
|
All.BF = bfpay.NewSub
|
||
|
|
All.Grepay = grepay.NewSub
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewSub(b *base.Base, index int) {
|
||
|
|
ref := reflect.ValueOf(All).Elem().Field(index)
|
||
|
|
if !ref.IsValid() {
|
||
|
|
log.Error("invalid index:%v", index)
|
||
|
|
return
|
||
|
|
}
|
||
|
|
ref.Call([]reflect.Value{reflect.ValueOf(b)})
|
||
|
|
}
|