go_dreamfactory/cmd/robot/friend.go
2022-06-27 20:27:49 +08:00

81 lines
2.0 KiB
Go

package robot
import (
"go_dreamfactory/comm"
"go_dreamfactory/modules/friend"
"go_dreamfactory/pb"
)
var (
//friend
friend_builders = []*builder{
{
//list
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_List,
req: &pb.Friend_List_Req{},
rsp: &pb.Friend_List_Rsp{},
enabled: true,
}, {
//blacklist
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_Blacklist,
req: &pb.Friend_BlackList_Req{},
rsp: &pb.Friend_BlackList_Rsp{},
}, {
//search
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_Search,
req: &pb.Friend_Search_Req{
NickName: "", //设置测试参数
},
rsp: &pb.Friend_Search_Rsp{},
}, {
//apply
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_Apply,
req: &pb.Friend_Apply_Req{},
rsp: &pb.Friend_Apply_Rsp{},
enabled: true,
}, {
//applylist
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_ApplyList,
req: &pb.Friend_ApplyList_Req{},
rsp: &pb.Friend_ApplyList_Rsp{},
}, {
//agree
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_Agree,
req: &pb.Friend_Agree_Req{},
rsp: &pb.Friend_Agree_Rsp{},
}, {
//refuse
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_Refuse,
req: &pb.Friend_Agree_Req{},
rsp: &pb.Friend_Agree_Rsp{},
}, {
//addblack
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_AddBlack,
req: &pb.Friend_BlackAdd_Req{
FriendId: "",
},
rsp: &pb.Friend_BlackAdd_Rsp{},
}, {
//delblack
mainType: string(comm.SM_FriendModule),
subType: friend.Friend_SubType_DelBlack,
req: &pb.Friend_DelBlack_Req{},
rsp: &pb.Friend_DelBlack_Rsp{},
},
}
)
//声明加入到构建器并发起请求
func (r *Robot) RunFriend() {
r.addBuilders(friend_builders)
r.handleReq()
}