things api and db
This commit is contained in:
@@ -21,6 +21,7 @@ public interface APIPath {
|
||||
String Create_Robot = "/admin/robot/create";
|
||||
String CreateOrUpdate_Device = "/admin/device/create";
|
||||
String Get_Device = "/admin/device/get";
|
||||
String Get_User_Devices = "/admin/device/user_devices";
|
||||
String User_Get_Token = "/admin/user/get_token";
|
||||
String User_Update_Block_Status = "/admin/user/update_block_status";
|
||||
String User_Get_Info = "/admin/user/get_info";
|
||||
|
||||
@@ -15,13 +15,11 @@ import java.util.List;
|
||||
|
||||
public class ForwardDeviceMessageData {
|
||||
private String deviceId;
|
||||
private String owner;
|
||||
private int type;
|
||||
private byte[] data;
|
||||
|
||||
public ForwardDeviceMessageData(String deviceId, String owner, int type, byte[] data) {
|
||||
public ForwardDeviceMessageData(String deviceId, int type, byte[] data) {
|
||||
this.deviceId = deviceId;
|
||||
this.owner = owner;
|
||||
this.type = type;
|
||||
this.data = data;
|
||||
}
|
||||
@@ -34,14 +32,6 @@ public class ForwardDeviceMessageData {
|
||||
this.deviceId = deviceId;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
}
|
||||
|
||||
public int getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
@@ -12,30 +12,19 @@ package cn.wildfirechat.pojos;
|
||||
import cn.wildfirechat.proto.WFCMessage;
|
||||
import io.netty.util.internal.StringUtil;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class InputCreateDevice {
|
||||
private String deviceId;
|
||||
private String owner;
|
||||
private List<String> owners;
|
||||
private String extra;
|
||||
|
||||
public WFCMessage.Device toDevice() {
|
||||
WFCMessage.Device.Builder builder = WFCMessage.Device.newBuilder();
|
||||
if (!StringUtil.isNullOrEmpty(deviceId))
|
||||
builder.setUid(deviceId);
|
||||
if (!StringUtil.isNullOrEmpty(owner))
|
||||
builder.setOwner(owner);
|
||||
if (!StringUtil.isNullOrEmpty(extra))
|
||||
builder.setExtra(extra);
|
||||
builder.setState(0);
|
||||
return builder.build();
|
||||
public List<String> getOwners() {
|
||||
return owners;
|
||||
}
|
||||
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
public void setOwners(List<String> owners) {
|
||||
this.owners = owners;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
|
||||
@@ -10,12 +10,14 @@ package cn.wildfirechat.pojos;
|
||||
|
||||
import cn.wildfirechat.proto.WFCMessage;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OutputDevice {
|
||||
private int state;
|
||||
private String deviceId;
|
||||
private String token;
|
||||
private String secret;
|
||||
private String owner;
|
||||
private List<String> owners;
|
||||
private String extra;
|
||||
|
||||
public OutputDevice(String deviceId, String token, String secret) {
|
||||
@@ -56,12 +58,12 @@ public class OutputDevice {
|
||||
this.state = state;
|
||||
}
|
||||
|
||||
public String getOwner() {
|
||||
return owner;
|
||||
public List<String> getOwners() {
|
||||
return owners;
|
||||
}
|
||||
|
||||
public void setOwner(String owner) {
|
||||
this.owner = owner;
|
||||
public void setOwners(List<String> owners) {
|
||||
this.owners = owners;
|
||||
}
|
||||
|
||||
public String getExtra() {
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* 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.
|
||||
*/
|
||||
|
||||
package cn.wildfirechat.pojos;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
public class OutputDeviceList {
|
||||
private List<OutputDevice> devices;
|
||||
|
||||
public List<OutputDevice> getDevices() {
|
||||
return devices;
|
||||
}
|
||||
|
||||
public void setDevices(List<OutputDevice> devices) {
|
||||
this.devices = devices;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user