go_dreamfactory/cmd/robot/story.go
2022-07-22 11:45:09 +08:00

45 lines
926 B
Go

package robot
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/modules/mainline"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
var (
storyBuilders = []*TestCase{
{
desc: "主线数据",
mainType: string(comm.ModuleMainline),
subType: mainline.MainlineGetListResp,
req: &pb.MainlineGetListReq{},
rsp: &pb.MainlineGetListResp{},
print: func(rsp proto.Message) {
out := rsp.(*pb.MainlineGetListResp)
for i, v := range out.Data {
fmt.Printf("%d- %v\n", (i + 1), v)
}
},
//enabled: true,
}, {
desc: "主线详情",
mainType: string(comm.ModuleMainline),
subType: mainline.MainlineChallengeResp,
req: &pb.MainlineChallengeReq{
MainlineId: 1,
},
rsp: &pb.MainlineChallengeResp{},
// enabled: true,
},
}
)
//声明加入到构建器并发起请求
func (r *Robot) RunMainline() {
r.addBuilders(storyBuilders)
}