主线关卡进度测试文件

This commit is contained in:
meixiongfeng 2022-07-13 09:23:43 +08:00
parent 2b49c1f082
commit bce9accc29
2 changed files with 48 additions and 0 deletions

View File

@ -189,6 +189,9 @@ func (r *Robot) onUserLoaded() {
//task
r.RunTask()
// story
r.RunStory()
}
//注册账号

45
cmd/robot/story.go Normal file
View File

@ -0,0 +1,45 @@
package robot
import (
"fmt"
"go_dreamfactory/comm"
"go_dreamfactory/modules/story"
"go_dreamfactory/pb"
"google.golang.org/protobuf/proto"
)
var (
storyBuilders = []*TestCase{
{
desc: "主线数据",
mainType: string(comm.ModuleStory),
subType: story.StoryGetListResp,
req: &pb.StoryGetListReq{},
rsp: &pb.StoryGetListResp{},
print: func(rsp proto.Message) {
out := rsp.(*pb.StoryGetListResp)
for i, v := range out.Data {
fmt.Printf("%d- %v\n", (i + 1), v)
}
},
enabled: true,
}, {
desc: "主线详情",
mainType: string(comm.ModuleStory),
subType: story.StoryChallengeResp,
req: &pb.StoryChallengeReq{
ChapterId: 1,
StoryId: 1,
},
rsp: &pb.StoryChallengeResp{},
// enabled: true,
},
}
)
//声明加入到构建器并发起请求
func (r *Robot) RunStory() {
r.addBuilders(storyBuilders)
r.batchHandleReq()
}