package robot import ( "go_dreamfactory/comm" "go_dreamfactory/modules/friend" "go_dreamfactory/pb" ) var ( //friend friendBuilders = []*builder{ { //list 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{}, }, { //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_62bd1c804cf36044f36bff33", }, 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() }