device profile data model updates
This commit is contained in:
parent
963efe6dd2
commit
3c665ecd49
@ -15,11 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.data.device.data;
|
package org.thingsboard.server.common.data.device.data;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.thingsboard.server.common.data.DeviceProfileType;
|
import org.thingsboard.server.common.data.DeviceProfileType;
|
||||||
|
|
||||||
@ApiModel
|
@ApiModel
|
||||||
@ -32,7 +32,7 @@ import org.thingsboard.server.common.data.DeviceProfileType;
|
|||||||
@JsonSubTypes.Type(value = DefaultDeviceConfiguration.class, name = "DEFAULT")})
|
@JsonSubTypes.Type(value = DefaultDeviceConfiguration.class, name = "DEFAULT")})
|
||||||
public interface DeviceConfiguration {
|
public interface DeviceConfiguration {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "Device profile type", allowableValues = "DEFAULT")
|
@JsonIgnore
|
||||||
DeviceProfileType getType();
|
DeviceProfileType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,11 +15,11 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.data.device.data;
|
package org.thingsboard.server.common.data.device.data;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.thingsboard.server.common.data.DeviceTransportType;
|
import org.thingsboard.server.common.data.DeviceTransportType;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
@ -37,8 +37,7 @@ import java.io.Serializable;
|
|||||||
@JsonSubTypes.Type(value = Lwm2mDeviceTransportConfiguration.class, name = "LWM2M"),
|
@JsonSubTypes.Type(value = Lwm2mDeviceTransportConfiguration.class, name = "LWM2M"),
|
||||||
@JsonSubTypes.Type(value = SnmpDeviceTransportConfiguration.class, name = "SNMP")})
|
@JsonSubTypes.Type(value = SnmpDeviceTransportConfiguration.class, name = "SNMP")})
|
||||||
public interface DeviceTransportConfiguration extends Serializable {
|
public interface DeviceTransportConfiguration extends Serializable {
|
||||||
|
@JsonIgnore
|
||||||
@ApiModelProperty(position = 1, value = "Device transport type", example = "MQTT")
|
|
||||||
DeviceTransportType getType();
|
DeviceTransportType getType();
|
||||||
|
|
||||||
default void validate() {
|
default void validate() {
|
||||||
|
|||||||
@ -15,15 +15,13 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.data.device.profile;
|
package org.thingsboard.server.common.data.device.profile;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ApiModel
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonTypeInfo(
|
@JsonTypeInfo(
|
||||||
use = JsonTypeInfo.Id.NAME,
|
use = JsonTypeInfo.Id.NAME,
|
||||||
@ -35,7 +33,7 @@ import java.io.Serializable;
|
|||||||
@JsonSubTypes.Type(value = RepeatingAlarmConditionSpec.class, name = "REPEATING")})
|
@JsonSubTypes.Type(value = RepeatingAlarmConditionSpec.class, name = "REPEATING")})
|
||||||
public interface AlarmConditionSpec extends Serializable {
|
public interface AlarmConditionSpec extends Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "String value representing alarm condition type. See method implementation notes for more examples")
|
@JsonIgnore
|
||||||
AlarmConditionSpecType getType();
|
AlarmConditionSpecType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -18,12 +18,9 @@ package org.thingsboard.server.common.data.device.profile;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ApiModel
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonTypeInfo(
|
@JsonTypeInfo(
|
||||||
use = JsonTypeInfo.Id.NAME,
|
use = JsonTypeInfo.Id.NAME,
|
||||||
@ -35,7 +32,6 @@ import java.io.Serializable;
|
|||||||
@JsonSubTypes.Type(value = CustomTimeSchedule.class, name = "CUSTOM")})
|
@JsonSubTypes.Type(value = CustomTimeSchedule.class, name = "CUSTOM")})
|
||||||
public interface AlarmSchedule extends Serializable {
|
public interface AlarmSchedule extends Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "Alarm schedule type. See method implementation notes for more examples", example = "ANY_TIME")
|
|
||||||
AlarmScheduleType getType();
|
AlarmScheduleType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -21,8 +21,8 @@ import lombok.Data;
|
|||||||
import org.thingsboard.server.common.data.alarm.AlarmSeverity;
|
import org.thingsboard.server.common.data.alarm.AlarmSeverity;
|
||||||
import org.thingsboard.server.common.data.validation.NoXss;
|
import org.thingsboard.server.common.data.validation.NoXss;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.TreeMap;
|
import java.util.TreeMap;
|
||||||
|
|
||||||
@ -33,7 +33,7 @@ public class DeviceProfileAlarm implements Serializable {
|
|||||||
@ApiModelProperty(position = 1, value = "String value representing the alarm rule id", example = "highTemperatureAlarmID")
|
@ApiModelProperty(position = 1, value = "String value representing the alarm rule id", example = "highTemperatureAlarmID")
|
||||||
private String id;
|
private String id;
|
||||||
@NoXss
|
@NoXss
|
||||||
@ApiModelProperty(position = 2, value = "String value representing type of the Alarm", example = "High Temperature Alarm")
|
@ApiModelProperty(position = 2, value = "String value representing type of the alarm", example = "High Temperature Alarm")
|
||||||
private String alarmType;
|
private String alarmType;
|
||||||
|
|
||||||
@Valid
|
@Valid
|
||||||
|
|||||||
@ -15,16 +15,14 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.data.device.profile;
|
package org.thingsboard.server.common.data.device.profile;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.thingsboard.server.common.data.DeviceProfileType;
|
import org.thingsboard.server.common.data.DeviceProfileType;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ApiModel
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonTypeInfo(
|
@JsonTypeInfo(
|
||||||
use = JsonTypeInfo.Id.NAME,
|
use = JsonTypeInfo.Id.NAME,
|
||||||
@ -34,7 +32,7 @@ import java.io.Serializable;
|
|||||||
@JsonSubTypes.Type(value = DefaultDeviceProfileConfiguration.class, name = "DEFAULT")})
|
@JsonSubTypes.Type(value = DefaultDeviceProfileConfiguration.class, name = "DEFAULT")})
|
||||||
public interface DeviceProfileConfiguration extends Serializable {
|
public interface DeviceProfileConfiguration extends Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "Device profile type", allowableValues = "DEFAULT")
|
@JsonIgnore
|
||||||
DeviceProfileType getType();
|
DeviceProfileType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -19,15 +19,15 @@ import io.swagger.annotations.ApiModel;
|
|||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
|
|
||||||
import java.io.Serializable;
|
|
||||||
import javax.validation.Valid;
|
import javax.validation.Valid;
|
||||||
|
import java.io.Serializable;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
@ApiModel
|
@ApiModel
|
||||||
@Data
|
@Data
|
||||||
public class DeviceProfileData implements Serializable {
|
public class DeviceProfileData implements Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "JSON object of device profile configuration for device profile type")
|
@ApiModelProperty(position = 1, value = "JSON object of device profile configuration")
|
||||||
private DeviceProfileConfiguration configuration;
|
private DeviceProfileConfiguration configuration;
|
||||||
@Valid
|
@Valid
|
||||||
@ApiModelProperty(position = 2, value = "JSON object of device profile transport configuration")
|
@ApiModelProperty(position = 2, value = "JSON object of device profile transport configuration")
|
||||||
|
|||||||
@ -19,13 +19,10 @@ import com.fasterxml.jackson.annotation.JsonIgnore;
|
|||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
import org.thingsboard.server.common.data.DeviceProfileProvisionType;
|
import org.thingsboard.server.common.data.DeviceProfileProvisionType;
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ApiModel
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
@JsonTypeInfo(
|
@JsonTypeInfo(
|
||||||
use = JsonTypeInfo.Id.NAME,
|
use = JsonTypeInfo.Id.NAME,
|
||||||
@ -37,10 +34,9 @@ import java.io.Serializable;
|
|||||||
@JsonSubTypes.Type(value = CheckPreProvisionedDevicesDeviceProfileProvisionConfiguration.class, name = "CHECK_PRE_PROVISIONED_DEVICES")})
|
@JsonSubTypes.Type(value = CheckPreProvisionedDevicesDeviceProfileProvisionConfiguration.class, name = "CHECK_PRE_PROVISIONED_DEVICES")})
|
||||||
public interface DeviceProfileProvisionConfiguration extends Serializable {
|
public interface DeviceProfileProvisionConfiguration extends Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "String value representing the secret key used to verify provisioning of the device defined in the device profile", example = "bjrj9172va82hvwqtp5b")
|
|
||||||
String getProvisionDeviceSecret();
|
String getProvisionDeviceSecret();
|
||||||
|
|
||||||
@ApiModelProperty(position = 2, value = "Device provisioning strategy for device profile", example = "ALLOW_CREATE_NEW_DEVICES")
|
@JsonIgnore
|
||||||
DeviceProfileProvisionType getType();
|
DeviceProfileProvisionType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -15,14 +15,12 @@
|
|||||||
*/
|
*/
|
||||||
package org.thingsboard.server.common.data.query;
|
package org.thingsboard.server.common.data.query;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
import io.swagger.annotations.ApiModel;
|
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
|
||||||
|
|
||||||
import java.io.Serializable;
|
import java.io.Serializable;
|
||||||
|
|
||||||
@ApiModel
|
|
||||||
@JsonTypeInfo(
|
@JsonTypeInfo(
|
||||||
use = JsonTypeInfo.Id.NAME,
|
use = JsonTypeInfo.Id.NAME,
|
||||||
include = JsonTypeInfo.As.PROPERTY,
|
include = JsonTypeInfo.As.PROPERTY,
|
||||||
@ -34,7 +32,7 @@ import java.io.Serializable;
|
|||||||
@JsonSubTypes.Type(value = ComplexFilterPredicate.class, name = "COMPLEX")})
|
@JsonSubTypes.Type(value = ComplexFilterPredicate.class, name = "COMPLEX")})
|
||||||
public interface KeyFilterPredicate extends Serializable {
|
public interface KeyFilterPredicate extends Serializable {
|
||||||
|
|
||||||
@ApiModelProperty(position = 1, value = "String value representing filter predicate type. See method implementation notes for more examples", example = "BOOLEAN")
|
@JsonIgnore
|
||||||
FilterPredicateType getType();
|
FilterPredicateType getType();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user