com.hn.im.easemob.comm.body.CommandMessageBody Maven / Gradle / Ivy
package com.hn.im.easemob.comm.body;
import com.fasterxml.jackson.databind.node.ContainerNode;
import com.hn.im.easemob.comm.constant.MsgType;
import cn.hutool.core.util.StrUtil;
import java.util.Map;
public class CommandMessageBody extends MessageBody {
private String action;
public CommandMessageBody(String targetType, String[] targets, String from, Map ext, String action) {
super(targetType, targets, from, ext);
this.action = action;
}
public String getAction() {
return action;
}
public ContainerNode> getBody() {
if(!this.isInit()){
this.getMsgBody().put("type", MsgType.CMD);
this.getMsgBody().put("action", action);
this.setInit(true);
}
return this.getMsgBody();
}
@Override
public Boolean validate() {
return super.validate() && StrUtil.isNotBlank(action);
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy