Files
IM-server-new/common/src/main/java/cn/wildfirechat/pojos/InputTransferGroup.java
T

60 lines
1.6 KiB
Java
Raw Normal View History

2019-03-16 17:04:23 +08:00
/*
* This file is part of the Wildfire Chat package.
* (c) Heavyrain2012 <[email protected]>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
2019-05-22 07:23:09 +08:00
package cn.wildfirechat.pojos;
2019-03-16 17:04:23 +08:00
import cn.wildfirechat.proto.WFCMessage;
import io.netty.util.internal.StringUtil;
public class InputTransferGroup extends InputGroupBase {
private String group_id;
private String new_owner;
public boolean isValide() {
2021-06-01 08:45:00 +08:00
if (StringUtil.isNullOrEmpty(group_id) || StringUtil.isNullOrEmpty(operator) || StringUtil.isNullOrEmpty(new_owner))
return false;
2019-03-16 17:04:23 +08:00
return true;
}
public WFCMessage.TransferGroupRequest toProtoGroupRequest() {
WFCMessage.TransferGroupRequest.Builder groupBuilder = WFCMessage.TransferGroupRequest.newBuilder();
groupBuilder.setGroupId(group_id);
groupBuilder.setNewOwner(new_owner);
2019-05-21 21:55:14 +08:00
if (to_lines != null) {
for (Integer line : to_lines
) {
groupBuilder.addToLine(line);
}
2019-03-16 17:04:23 +08:00
}
2019-05-21 21:55:14 +08:00
if (notify_message != null) {
groupBuilder.setNotifyContent(notify_message.toProtoMessageContent());
}
2019-03-16 17:04:23 +08:00
return groupBuilder.build();
}
public String getGroup_id() {
return group_id;
}
public void setGroup_id(String group_id) {
this.group_id = group_id;
}
public String getNew_owner() {
return new_owner;
}
public void setNew_owner(String new_owner) {
this.new_owner = new_owner;
}
}