Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

设备实例的请求类及测试 #7

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
package org.jetlinks.sdk.model.device.info;

import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.jetlinks.sdk.model.EnumInfo;

import java.util.List;
import java.util.Map;

@Getter
@Setter
public class DeviceInstance {

@Schema(description = "设备ID(只能由数字,字母,下划线和中划线组成)")
private String id;

@Schema(description = "图片地址")
private String photoUrl;

@Schema(description = "设备名称")
private String name;

@Schema(description = "设备类型")
private EnumInfo<String> deviceType;

@Schema(description = "说明")
private String describe;

@Schema(description = "产品ID")
private String productId;

@Schema(description = "产品名称")
private String productName;

@Schema(description = "配置信息")
private Map<String, Object> configuration;

@Schema(description = "派生(独立)物模型")
private String deriveMetadata;

@Schema(
description = "状态(只读)"
, accessMode = Schema.AccessMode.READ_ONLY
, defaultValue = "notActive"
)
private EnumInfo<String> state;

@Schema(
description = "创建者ID(只读)"
, accessMode = Schema.AccessMode.READ_ONLY
)
private String creatorId;

@Schema(
description = "创建者名称(只读)"
, accessMode = Schema.AccessMode.READ_ONLY
)
private String creatorName;

@Schema(
description = "创建时间(只读)"
, accessMode = Schema.AccessMode.READ_ONLY
)
private Long createTime;
@Schema(description = "激活时间"
, accessMode = Schema.AccessMode.READ_ONLY
)
private Long registryTime;

@Schema(description = "父级设备ID")
private String parentId;

@Schema(description = "设备特性")
private List<EnumInfo<String> > features;

@Schema(
description = "修改时间"
, accessMode = Schema.AccessMode.READ_ONLY
)
private Long modifyTime;

@Schema(
description = "修改人ID"
, accessMode = Schema.AccessMode.READ_ONLY
)
private String modifierId;

@Schema(
description = "修改人名称"
, accessMode = Schema.AccessMode.READ_ONLY
)
private String modifierName;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package org.jetlinks.sdk.model.device.info;

import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.jetlinks.sdk.model.EnumInfo;

@Setter
@Getter
public class DeviceOperationLog {
@Schema(description = "日志ID")
private String id;

@Schema(description = "设备ID")
private String deviceId;

@Schema(description = "产品ID")
private String productId;

@Schema(description = "日志类型")
private EnumInfo<String> type;

@Schema(description = "创建时间")
private long createTime;

@Schema(description = "日志内容")
private Object content;

@Schema(description = "消息ID")
private String messageId;

@Hidden
private String orgId;

@Schema(description = "数据时间")
private long timestamp;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
package org.jetlinks.sdk.model.device.info;

import io.swagger.v3.oas.annotations.Hidden;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Getter;
import lombok.Setter;
import org.jetlinks.core.message.property.ReportPropertyMessage;
import org.jetlinks.core.metadata.types.GeoPoint;

import java.util.Date;


@Getter
@Setter
public class DeviceProperty {

@Schema(description = "ID")
private String id;

@Schema(description = "设备ID")
private String deviceId;

@Schema(description = "属性ID")
private String property;

@Schema(description = "属性名")
private String propertyName;

@Schema(description = "类型")
private String type;

@Schema(description = "单位")
private String unit;

@Hidden
private Object numberValue;

@Hidden
private Object objectValue;

@Hidden
private Date timeValue;

@Hidden
private String stringValue;

@Hidden
private GeoPoint geoValue;

@Schema(description = "属性值")
private Object value;

@Schema(description = "格式化值")
private Object formatValue;

@Schema(description = "创建时间")
private long createTime;

@Schema(description = "数据时间")
private long timestamp;

@Schema(description = "格式化后的时间,在聚合查询时此字段有值")
private String formatTime;

/**
* 设备状态值,如果是查询的数据库,此字段可能为{@link null}
*
* @see ReportPropertyMessage#getPropertyStates()
*/
@Schema(description = "状态值")
private String state;

}
Loading