package chat.module.entity;
|
|
import cn.wildfirechat.proto.ProtoConstants;
|
import cn.wildfirechat.proto.WFCMessage;
|
import frame.object.data.Entity;
|
import frame.object.data.ID;
|
|
public class FriendRequest extends MessageContainer {
|
|
private String id;
|
private String uid;
|
private String friendId;
|
private String reason;
|
private int status;
|
private long dt;
|
private boolean from_read_status;
|
private boolean to_read_status;
|
|
public FriendRequest(String uid, String friendId) {
|
super(null, null);
|
this.id = ID.newValue();
|
this.uid = uid;
|
this.friendId = friendId;
|
this.dt = System.currentTimeMillis();
|
}
|
|
public void load(WFCMessage.AddFriendRequest addFriendRequest) {
|
//1. load group info
|
this.reason = addFriendRequest.getReason();
|
this.status = ProtoConstants.FriendRequestStatus.RequestStatus_Sent;
|
this.to_read_status = false;
|
this.dt = System.currentTimeMillis();
|
}
|
|
@Override
|
public void pushTo(Entity entity) throws Exception {
|
// TODO Auto-generated method stub
|
entity.set("id", id);
|
entity.set("uid", uid);
|
entity.set("friendId", friendId);
|
entity.set("reason", reason);
|
entity.set("status", status);
|
entity.set("dt", dt);
|
entity.set("from_read_status", from_read_status);
|
entity.set("to_read_status", to_read_status);
|
}
|
|
}
|