Browse Source

Add max fields length validation

pull/5509/head^2
Vladyslav_Prykhodko 4 years ago
committed by Andrew Shvayka
parent
commit
f02304e2f3
  1. 1
      common/data/src/main/java/org/thingsboard/server/common/data/ContactBased.java
  2. 1
      common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java
  3. 1
      common/data/src/main/java/org/thingsboard/server/common/data/DeviceProfile.java
  4. 2
      common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetTypeDetails.java
  5. 1
      common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetsBundle.java

1
common/data/src/main/java/org/thingsboard/server/common/data/ContactBased.java

@ -44,6 +44,7 @@ public abstract class ContactBased<I extends UUIDBased> extends SearchTextBasedW
@Length(fieldName = "phone")
@NoXss
protected String phone;
@Length(fieldName = "email")
@NoXss
protected String email;

1
common/data/src/main/java/org/thingsboard/server/common/data/DashboardInfo.java

@ -35,6 +35,7 @@ public class DashboardInfo extends SearchTextBased<DashboardId> implements HasNa
@NoXss
@Length(fieldName = "title")
private String title;
@Length(fieldName = "image", max = 1000000)
private String image;
@Valid
private Set<ShortCustomerInfo> assignedCustomers;

1
common/data/src/main/java/org/thingsboard/server/common/data/DeviceProfile.java

@ -54,6 +54,7 @@ public class DeviceProfile extends SearchTextBased<DeviceProfileId> implements H
@NoXss
@ApiModelProperty(position = 11, value = "Device Profile description. ")
private String description;
@Length(fieldName = "image", max = 1000000)
@ApiModelProperty(position = 12, value = "Either URL or Base64 data of the icon. Used in the mobile application to visualize set of device profiles in the grid view. ")
private String image;
private boolean isDefault;

2
common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetTypeDetails.java

@ -26,7 +26,7 @@ import org.thingsboard.server.common.data.validation.NoXss;
@JsonPropertyOrder({ "alias", "name", "image", "description", "descriptor" })
public class WidgetTypeDetails extends WidgetType {
@NoXss
@Length(fieldName = "image", max = 1000000)
@ApiModelProperty(position = 8, value = "Base64 encoded thumbnail", readOnly = true)
private String image;
@NoXss

1
common/data/src/main/java/org/thingsboard/server/common/data/widget/WidgetsBundle.java

@ -50,6 +50,7 @@ public class WidgetsBundle extends SearchTextBased<WidgetsBundleId> implements H
@ApiModelProperty(position = 5, value = "Title used in search and UI", readOnly = true)
private String title;
@Length(fieldName = "image", max = 1000000)
@Getter
@Setter
@ApiModelProperty(position = 6, value = "Base64 encoded thumbnail", readOnly = true)

Loading…
Cancel
Save