airobot/busi/friend/friend_recommend.go
2022-12-12 08:30:21 +08:00

39 lines
668 B
Go

package friend
import (
"time"
"google.golang.org/protobuf/proto"
"legu.airobot/lib"
"legu.airobot/pb"
)
var _ lib.ICaller = (*FriendRecommend)(nil)
// 好友推荐
type FriendRecommend struct {
lib.Action
}
func (a *FriendRecommend) ShowInfo() lib.CallerInfo {
return lib.CallerInfo{
Key: "friend.randlist",
Desc: "好友推荐",
}
}
func (a *FriendRecommend) BuildReq(store lib.IStore, head *pb.UserMessage) lib.RawReq {
id := time.Now().UnixNano()
var req []byte
if lib.ProtoMarshal(&pb.FriendRandlistReq{}, head) {
data, err := proto.Marshal(head)
if err != nil {
panic(err)
}
req = data
}
return lib.RawReq{ID: id, Req: req}
}