things db config and sdk

This commit is contained in:
imhao183
2020-05-01 12:38:27 +08:00
committed by heavyrain2012
parent 739452830d
commit e771794bc0
17 changed files with 355 additions and 14 deletions
@@ -19,6 +19,8 @@ public interface APIPath {
String Create_User = "/admin/user/create";
String Destroy_User = "/admin/user/destroy";
String Create_Robot = "/admin/robot/create";
String CreateOrUpdate_Device = "/admin/device/create";
String Get_Device = "/admin/device/get";
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";
@@ -0,0 +1,60 @@
/*
* 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 cn.wildfirechat.proto.WFCMessage;
import io.netty.util.internal.StringUtil;
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) {
this.deviceId = deviceId;
this.owner = owner;
this.type = type;
this.data = data;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public int getType() {
return type;
}
public void setType(int type) {
this.type = type;
}
public byte[] getData() {
return data;
}
public void setData(byte[] data) {
this.data = data;
}
}
@@ -0,0 +1,56 @@
/*
* 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 cn.wildfirechat.proto.WFCMessage;
import io.netty.util.internal.StringUtil;
public class InputCreateDevice {
private String deviceId;
private String owner;
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 String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
@@ -0,0 +1,21 @@
/*
* 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;
public class InputDeviceId {
private String deviceId;
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
}
@@ -0,0 +1,45 @@
/*
* 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;
public class OutputCreateDevice {
private String deviceId;
private String token;
private String secret;
public OutputCreateDevice(String userId, String token, String secret) {
this.deviceId = userId;
this.token = token;
this.secret = secret;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
}
@@ -0,0 +1,74 @@
/*
* 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 cn.wildfirechat.proto.WFCMessage;
public class OutputDevice {
private int state;
private String deviceId;
private String token;
private String secret;
private String owner;
private String extra;
public OutputDevice(String deviceId, String token, String secret) {
this.deviceId = deviceId;
this.token = token;
this.secret = secret;
}
public String getDeviceId() {
return deviceId;
}
public void setDeviceId(String deviceId) {
this.deviceId = deviceId;
}
public String getToken() {
return token;
}
public void setToken(String token) {
this.token = token;
}
public String getSecret() {
return secret;
}
public void setSecret(String secret) {
this.secret = secret;
}
public int getState() {
return state;
}
public void setState(int state) {
this.state = state;
}
public String getOwner() {
return owner;
}
public void setOwner(String owner) {
this.owner = owner;
}
public String getExtra() {
return extra;
}
public void setExtra(String extra) {
this.extra = extra;
}
}
@@ -8,7 +8,7 @@ public class ProtoConstants {
int ConversationType_Group = 1;
int ConversationType_ChatRoom = 2;
int ConversationType_Channel = 3;
int ConversationType_Thing = 4;
int ConversationType_Things = 4;
}
//message GroupInfo -> type