84 lines
2.0 KiB
Go
84 lines
2.0 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.FriendListRsp{},
|
|
enabled: true,
|
|
}, {
|
|
//blacklist
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeBlacklist,
|
|
req: &pb.FriendBlackListReq{},
|
|
rsp: &pb.FriendBlackListRsp{},
|
|
}, {
|
|
//search
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeSearch,
|
|
req: &pb.FriendSearchReq{
|
|
NickName: "", //设置测试参数
|
|
},
|
|
rsp: &pb.FriendSearchRsp{},
|
|
enabled: true,
|
|
}, {
|
|
//apply
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeApply,
|
|
req: &pb.FriendApplyReq{},
|
|
rsp: &pb.FriendApplyRsp{},
|
|
// enabled: true,
|
|
}, {
|
|
//applylist
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeApplyList,
|
|
req: &pb.FriendApplyListReq{},
|
|
rsp: &pb.FriendApplyListRsp{},
|
|
}, {
|
|
//agree
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeAgree,
|
|
req: &pb.FriendAgreeReq{},
|
|
rsp: &pb.FriendAgreeRsp{},
|
|
}, {
|
|
//refuse
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeRefuse,
|
|
req: &pb.FriendAgreeReq{},
|
|
rsp: &pb.FriendAgreeRsp{},
|
|
}, {
|
|
//addblack
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeAddBlack,
|
|
req: &pb.FriendBlackAddReq{
|
|
FriendId: "0_62be9f40f67327fb53039b70",
|
|
},
|
|
rsp: &pb.FriendBlackAddRsp{},
|
|
// enabled: true,
|
|
}, {
|
|
//delblack
|
|
mainType: string(comm.ModuleFriend),
|
|
subType: friend.FriendSubTypeDelBlack,
|
|
req: &pb.FriendDelBlackReq{},
|
|
rsp: &pb.FriendDelBlackRsp{},
|
|
},
|
|
}
|
|
)
|
|
|
|
//声明加入到构建器并发起请求
|
|
func (r *Robot) RunFriend() {
|
|
r.addBuilders(friendBuilders)
|
|
r.handleReq()
|
|
}
|