上传付费测试场景
This commit is contained in:
parent
776dfc2811
commit
cd408bfb7d
52
busi/pay.go
Normal file
52
busi/pay.go
Normal file
@ -0,0 +1,52 @@
|
|||||||
|
package busi
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"legu.airobot/lib"
|
||||||
|
"legu.airobot/pb"
|
||||||
|
)
|
||||||
|
|
||||||
|
//竞技场场景
|
||||||
|
|
||||||
|
var _ lib.IScene = (*PayScene)(nil)
|
||||||
|
|
||||||
|
type PayScene struct {
|
||||||
|
lib.Action
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *PayScene) Info() lib.SceneInfo {
|
||||||
|
return lib.SceneInfo{
|
||||||
|
Name: "支付",
|
||||||
|
Desc: "充值模拟",
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (f *PayScene) Run(ai lib.IRobot) (err error) {
|
||||||
|
var (
|
||||||
|
code pb.ErrorCode
|
||||||
|
)
|
||||||
|
if code = ai.SendMsg("pay", "dailybuy", &pb.PayDailyBuyReq{
|
||||||
|
Id: 1,
|
||||||
|
}, &pb.PayDailyBuyResp{}); code != pb.ErrorCode_Success {
|
||||||
|
ai.Stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
if code = ai.SendMsg("pay", "dailybuy", &pb.PayDailyBuyReq{
|
||||||
|
Id: 2,
|
||||||
|
}, &pb.PayDailyBuyResp{}); code != pb.ErrorCode_Success {
|
||||||
|
ai.Stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
|
||||||
|
if code = ai.SendMsg("privilege", "buyyueka", &pb.PrivilegeBuyYuekaReq{
|
||||||
|
CID: "yueka_lv1",
|
||||||
|
}, &pb.PrivilegeBuyYuekaResp{}); code != pb.ErrorCode_Success {
|
||||||
|
ai.Stop()
|
||||||
|
return
|
||||||
|
}
|
||||||
|
time.Sleep(time.Second)
|
||||||
|
return
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user