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;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.thingsboard.server.common.data.DeviceProfileType;
|
||||
|
||||
@ApiModel
|
||||
@ -32,7 +32,7 @@ import org.thingsboard.server.common.data.DeviceProfileType;
|
||||
@JsonSubTypes.Type(value = DefaultDeviceConfiguration.class, name = "DEFAULT")})
|
||||
public interface DeviceConfiguration {
|
||||
|
||||
@ApiModelProperty(position = 1, value = "Device profile type", allowableValues = "DEFAULT")
|
||||
@JsonIgnore
|
||||
DeviceProfileType getType();
|
||||
|
||||
}
|
||||
|
||||
@ -15,11 +15,11 @@
|
||||
*/
|
||||
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.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.thingsboard.server.common.data.DeviceTransportType;
|
||||
|
||||
import java.io.Serializable;
|
||||
@ -37,8 +37,7 @@ import java.io.Serializable;
|
||||
@JsonSubTypes.Type(value = Lwm2mDeviceTransportConfiguration.class, name = "LWM2M"),
|
||||
@JsonSubTypes.Type(value = SnmpDeviceTransportConfiguration.class, name = "SNMP")})
|
||||
public interface DeviceTransportConfiguration extends Serializable {
|
||||
|
||||
@ApiModelProperty(position = 1, value = "Device transport type", example = "MQTT")
|
||||
@JsonIgnore
|
||||
DeviceTransportType getType();
|
||||
|
||||
default void validate() {
|
||||
|
||||
@ -15,15 +15,13 @@
|
||||
*/
|
||||
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.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
@ -35,7 +33,7 @@ import java.io.Serializable;
|
||||
@JsonSubTypes.Type(value = RepeatingAlarmConditionSpec.class, name = "REPEATING")})
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
@ -18,12 +18,9 @@ package org.thingsboard.server.common.data.device.profile;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
@ -35,7 +32,6 @@ import java.io.Serializable;
|
||||
@JsonSubTypes.Type(value = CustomTimeSchedule.class, name = "CUSTOM")})
|
||||
public interface AlarmSchedule extends Serializable {
|
||||
|
||||
@ApiModelProperty(position = 1, value = "Alarm schedule type. See method implementation notes for more examples", example = "ANY_TIME")
|
||||
AlarmScheduleType getType();
|
||||
|
||||
}
|
||||
|
||||
@ -21,8 +21,8 @@ import lombok.Data;
|
||||
import org.thingsboard.server.common.data.alarm.AlarmSeverity;
|
||||
import org.thingsboard.server.common.data.validation.NoXss;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
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")
|
||||
private String id;
|
||||
@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;
|
||||
|
||||
@Valid
|
||||
|
||||
@ -15,26 +15,24 @@
|
||||
*/
|
||||
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.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.thingsboard.server.common.data.DeviceProfileType;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
include = JsonTypeInfo.As.PROPERTY,
|
||||
property = "type")
|
||||
@JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = DefaultDeviceProfileConfiguration.class, name = "DEFAULT")})
|
||||
@JsonSubTypes.Type(value = DefaultDeviceProfileConfiguration.class, name = "DEFAULT")})
|
||||
public interface DeviceProfileConfiguration extends Serializable {
|
||||
|
||||
@ApiModelProperty(position = 1, value = "Device profile type", allowableValues = "DEFAULT")
|
||||
@JsonIgnore
|
||||
DeviceProfileType getType();
|
||||
|
||||
}
|
||||
|
||||
@ -19,15 +19,15 @@ import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
|
||||
import java.io.Serializable;
|
||||
import javax.validation.Valid;
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
@ApiModel
|
||||
@Data
|
||||
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;
|
||||
@Valid
|
||||
@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.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import org.thingsboard.server.common.data.DeviceProfileProvisionType;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
@ -37,10 +34,9 @@ import java.io.Serializable;
|
||||
@JsonSubTypes.Type(value = CheckPreProvisionedDevicesDeviceProfileProvisionConfiguration.class, name = "CHECK_PRE_PROVISIONED_DEVICES")})
|
||||
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();
|
||||
|
||||
@ApiModelProperty(position = 2, value = "Device provisioning strategy for device profile", example = "ALLOW_CREATE_NEW_DEVICES")
|
||||
@JsonIgnore
|
||||
DeviceProfileProvisionType getType();
|
||||
|
||||
}
|
||||
|
||||
@ -15,14 +15,12 @@
|
||||
*/
|
||||
package org.thingsboard.server.common.data.query;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
@ApiModel
|
||||
@JsonTypeInfo(
|
||||
use = JsonTypeInfo.Id.NAME,
|
||||
include = JsonTypeInfo.As.PROPERTY,
|
||||
@ -34,7 +32,7 @@ import java.io.Serializable;
|
||||
@JsonSubTypes.Type(value = ComplexFilterPredicate.class, name = "COMPLEX")})
|
||||
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();
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user