go_dreamfactory/cmd/robot/friend.go
2022-07-04 14:56:06 +08:00

95 lines
2.2 KiB
Go

package robot
import (
"go_dreamfactory/comm"
"go_dreamfactory/modules/friend"
"go_dreamfactory/pb"
)
var (
//friend
friendBuilders = []*TestCase{
{
//list
Desc: "好友列表",
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeList,
req: &pb.FriendListReq{},
rsp: &pb.FriendListResp{},
// enabled: true,
}, {
//blacklist
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeBlacklist,
req: &pb.FriendBlackListReq{},
rsp: &pb.FriendBlackListResp{},
// enabled: true,
}, {
//search
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeSearch,
req: &pb.FriendSearchReq{
NickName: "乐谷745", //设置测试参数
},
rsp: &pb.FriendSearchResp{},
// enabled: true,
}, {
//apply
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeApply,
req: &pb.FriendApplyReq{
FriendId: "0_62c28ab569b7d416cf9eb8c7",
},
rsp: &pb.FriendApplyResp{},
// enabled: true,
}, {
//applylist
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeApplyList,
req: &pb.FriendApplyListReq{},
rsp: &pb.FriendApplyListResp{},
enabled: true,
}, {
//agree
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeAgree,
req: &pb.FriendAgreeReq{
FriendIds: []string{"0_62c28ab569b7d416cf9eb8c7"},
},
rsp: &pb.FriendAgreeResp{},
// enabled: true,
}, {
//refuse
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeRefuse,
req: &pb.FriendRefuseReq{
FriendIds: []string{"0_62c28bcb69b7d416cf9eb8c9"},
},
rsp: &pb.FriendRefuseResp{},
enabled: true,
}, {
//addblack
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeAddBlack,
req: &pb.FriendBlackAddReq{
FriendId: "0_62c26323e5cc5577d41bf591",
},
rsp: &pb.FriendBlackAddResp{},
// enabled: true,
}, {
//delblack
mainType: string(comm.ModuleFriend),
subType: friend.FriendSubTypeDelBlack,
req: &pb.FriendDelBlackReq{},
rsp: &pb.FriendDelBlackResp{},
// enabled: true,
},
}
)
//声明加入到构建器并发起请求
func (r *Robot) RunFriend() {
r.addBuilders(friendBuilders)
r.handleReq()
}