dtos

package
v0.0.0-...-68b20d9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2023 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Overview

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

******************************************************************************

  • Copyright 2017 Dell Inc.
  • Copyright (c) 2019 Intel Corporation *
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at *
  • http://www.apache.org/licenses/LICENSE-2.0 *
  • Unless required by applicable law or agreed to in writing, software distributed under the License
  • is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
  • or implied. See the License for the specific language governing permissions and limitations under
  • the License. ******************************************************************************

Index

Constants

View Source
const (
	SYSTEM_ALERT  models.AlertType = iota + 1 // 系统告警
	DRIVER_ALERT                              // 驱动告警
	LICENSE_ALERT                             //证书过期
)
View Source
const (
	ERROR  models.AlertLevel = iota + 1 // 告警级别:错误
	WARN                                // 告警级别:警告
	NOTIFY                              // 告警级别: 通知
)
View Source
const (
	BackupFileTypeDbResource = "db_resource"
	BackupFileTypeDbExpert   = "db_expert"
	BackupFileTypeDbGateway  = "db_gateway"
	BackupFileTypeCheck      = "check.json"
	BackupUnZipDir           = "/tmp/edge-recover"
)
View Source
const (
	PageDefault        = 1
	PageSizeDefault    = 10
	PageSizeMaxDefault = 1000
)
View Source
const (
	DevicesFilename = "Devices"
)

Variables

View Source
var (
	FuncPointImmutableHeader = []string{"DP ID", "Name", "DataType", "TransferType"}
	FuncPointIntegerHeader   = []string{"Scale", "ValueType"}
)

Functions

func AdvanceConfigFromDTOToModel

func AdvanceConfigFromDTOToModel(config AdvanceConfig) models.AdvanceConfig

func ApiParamsArrayToString

func ApiParamsArrayToString(arr []string) string

func ApiParamsStringToArray

func ApiParamsStringToArray(str string) []string

func CorrectionPageParam

func CorrectionPageParam(query *BaseSearchConditionQuery)

校验并设置page参数

func CorrectionPageRequest

func CorrectionPageRequest(query *PageRequest)

校验并设置PageRequest参数

func DeviceServiceFromDeviceServiceAddRequest

func DeviceServiceFromDeviceServiceAddRequest(ds DeviceServiceAddRequest) models.DeviceService

func FromDTOServiceStatsToModel

func FromDTOServiceStatsToModel(s ServiceStats) models.ServiceStats

func FromDeviceLibraryRpcToModel

func FromDeviceLibraryRpcToModel(p *DeviceLibraryAddRequest) models.DeviceLibrary

func FromYamlStrToMap

func FromYamlStrToMap(yamlStr string) (m map[string]interface{}, err error)

func GetLibrarySimpleBaseConfig

func GetLibrarySimpleBaseConfig() string

func GetModelPropertyEventActionByThingModelTemplate

func GetModelPropertyEventActionByThingModelTemplate(thingModelJSON string) (properties []models.Properties, events []models.Events, actions []models.Actions)

func ReplaceDataResourceModelFields

func ReplaceDataResourceModelFields(ds *models.DataResource, patch UpdateDataResource)

func ReplaceDeviceLibraryModelFieldsWithDTO

func ReplaceDeviceLibraryModelFieldsWithDTO(deviceLibrary *models.DeviceLibrary, patch UpdateDeviceLibrary)

func ReplaceDeviceModelFields

func ReplaceDeviceModelFields(ds *models.Device, patch DeviceUpdateRequest)

func ReplaceDeviceServiceModelFieldsWithDTO

func ReplaceDeviceServiceModelFieldsWithDTO(ds *models.DeviceService, patch DeviceServiceUpdateRequest)

func ReplaceDockerConfigModelFieldsWithDTO

func ReplaceDockerConfigModelFieldsWithDTO(ds *models.DockerConfig, patch DockerConfigUpdateRequest)

func ReplaceRuleEngineModelFields

func ReplaceRuleEngineModelFields(ds *models.RuleEngine, patch RuleEngineUpdateRequest)

func ReplaceRuleFields

func ReplaceRuleFields(ds *models.AlertRule, patch RuleFieldUpdate)

func ReplaceRuleModelFields

func ReplaceRuleModelFields(ds *models.AlertRule, patch RuleUpdateRequest)

func ReplaceSceneModelFields

func ReplaceSceneModelFields(scene *models.Scene, req SceneUpdateRequest)

func ToAlertContent

func ToAlertContent(req ReportAlertsReq) models.AlertContent

Types

type Action

type Action struct {
	ProductID   string `json:"product_id"`
	ProductName string `json:"product_name"`
	DeviceID    string `json:"device_id"`
	DeviceName  string `json:"device_name"`
	Code        string `json:"code"`
	DataType    string `json:"data_type"`
	Value       string `json:"value"`
}

type Actions

type Actions struct {
	Rest     map[string]interface{} `json:"rest,omitempty"`
	MQTT     map[string]interface{} `json:"mqtt,omitempty"`
	Kafka    map[string]interface{} `json:"kafka,omitempty"`
	Zmq      map[string]interface{} `json:"zmq,omitempty"`
	Redis    map[string]interface{} `json:"redis,omitempty"`
	Influx   map[string]interface{} `json:"influx,omitempty"`
	Tdengine map[string]interface{} `json:"tdengine,omitempty"`
}

func GetRuleAlertEkuiperActions

func GetRuleAlertEkuiperActions(actionUrl string) []Actions

func GetRuleSceneEkuiperActions

func GetRuleSceneEkuiperActions(actionUrl string) []Actions

type AddDataResourceReq

type AddDataResourceReq struct {
	Name   string                 `json:"name"`
	Type   string                 `json:"type"`
	Option map[string]interface{} `json:"option"`
}

type AddMqttAuthInfoRequest

type AddMqttAuthInfoRequest struct {
	Id           string `json:"id"`
	ClientId     string `json:"client_id"`
	UserName     string `json:"username"`
	Password     string `json:"password"`
	ResourceId   string `json:"resource_id"`
	ResourceType string `json:"resource_type"`
}

type AdvanceConfig

type AdvanceConfig struct {
	// 日志级别 默认为DEBUG
	LogLevel constants.LogLevel
	// 持久化存储开关 默认关闭
	PersistStorage bool
	// 存储时长 默认为0
	StorageHour int32
}

func AdvanceConfigFromModelToDTO

func AdvanceConfigFromModelToDTO(config models.AdvanceConfig) AdvanceConfig

type AgentRequest

type AgentRequest struct {
	Cmd            string   `json:"cmd"`
	Args           []string `json:"args"`
	TimeoutSeconds int      `json:"timeout_seconds"`
}

type AgentResponse

type AgentResponse struct {
	Operation    string `json:"operation"`
	Service      string `json:"service"`
	Executor     string `json:"executor"`
	Success      bool   `json:"success"`
	ErrorMessage string `json:"errorMessage"`
}

type Alert

type Alert struct {
	Count      int    `json:"count"`
	AlertLevel string `json:"alert_level"`
}

type AlertAddRequest

type AlertAddRequest struct {
	DeviceId    string `json:"device_id"`
	TriggerTime int64  `json:"trigger_time"` //触发时间
	RuleId      string `json:"rule_id"`
	Content     string `json:"content"`
}

type AlertContentDTO

type AlertContentDTO struct {
	ServiceName string            `json:"name"`                                           // 服务名
	Type        models.AlertType  `json:"type" binding:"oneof=1 2" swaggertype:"integer"` // 告警类型
	TypeValue   string            `json:"typeValue"`
	Level       models.AlertLevel `json:"level" binding:"oneof=1 2 3" swaggertype:"integer"` // 告警级别
	LevelValue  string            `json:"levelValue"`
	T           int64             `json:"time"`    // 告警时间
	Content     string            `json:"content"` // 告警内容
}

AlertContent 服务和驱动上报告警消息

func AlertContentToDTO

func AlertContentToDTO(ac models.AlertContent) AlertContentDTO

type AlertPlateQueryResponse

type AlertPlateQueryResponse struct {
	Count      int                  `json:"count"`
	AlertLevel constants.AlertLevel `json:"alert_level"`
}

type AlertRuleSearchQueryRequest

type AlertRuleSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
	Status                   string `schema:"status,omitempty"`
	Msg                      string `schema:"msg,omitempty"`
}

type AlertRuleSearchQueryResponse

type AlertRuleSearchQueryResponse struct {
	Id          string               `json:"id"`
	Name        string               `json:"name"`
	Description string               `json:"description"`
	AlertType   constants.AlertType  `json:"alert_type"`
	AlertLevel  constants.AlertLevel `json:"alert_level"`
	Created     int64                `json:"created"`
	Status      constants.RuleStatus `json:"status"`
	SubRule     []SubRule            `json:"sub_rule"`
}

func RuleSearchQueryResponseFromModel

func RuleSearchQueryResponseFromModel(p models.AlertRule) AlertRuleSearchQueryResponse

type AlertSearchQueryRequest

type AlertSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
	AlertLevel               string `schema:"alert_level,omitempty"`
	Status                   string `schema:"status,omitempty"`
	TriggerStartTime         int    `schema:"trigger_start_time,omitempty"`
	TriggerEndTime           int    `schema:"trigger_end_time,omitempty"`
}

type AlertSearchQueryResponse

type AlertSearchQueryResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	//Description string               `json:"description"`
	AlertResult string               `json:"alert_result"`
	AlertLevel  constants.AlertLevel `json:"alert_level"`
	TriggerTime int64                `json:"trigger_time"`
	TreatedTime int64                `json:"treated_time"`
	Status      string               `json:"status"`
	Message     string               `json:"message"`
	IsSend      bool                 `json:"is_send"`
}

type AlertTreatedRequest

type AlertTreatedRequest struct {
	Id      string `json:"id"`
	Message string `json:"message"`
}

type ApiOrderBy

type ApiOrderBy struct {
	Key    string
	IsDesc bool
}

* 前端/后端请求查询的通用order by,查询key必须是models里存在的值 比如 通过models.Device.ProductName 排序, 那么key的值为 ProductName或则对应的数据库字段 product_name, 不能是 pn

func ApiParamsStringToOrderBy

func ApiParamsStringToOrderBy(str string) []ApiOrderBy

type AppServiceConfig

type AppServiceConfig struct {
	Log struct {
		LogLevel string
		LogPath  string
	}
	Tedge struct {
		Host string
		Port int32
	}
	Server struct {
		ID   string
		Name string
		Host string
		Port int32
	}
	//应用私有配置
	CustomConfig map[string]interface{}
}

type AuthorizationInfo

type AuthorizationInfo struct {
	AK         string
	SK         string
	Regions    string
	ProjectId  string
	InstanceId string
	Endpoint   string
	MqttHost   string
	MqttPort   string
}

type BackupCommand

type BackupCommand struct {
	BackupType int
}

type BackupFileCheck

type BackupFileCheck struct {
	GatewayId string `json:"gateway_id"`
	Version   string `json:"version"`
}

备份/恢复时的校验文件

type BaseRequest

type BaseRequest struct {
	Versionable `json:",inline"`
	RequestId   string `json:"requestId" validate:"len=0|uuid"`
}

Request defines the base content for request DTOs (data transfer objects). This object and its properties correspond to the BaseRequest object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BaseRequest

func NewBaseRequest

func NewBaseRequest() BaseRequest

type BaseResponse

type BaseResponse struct {
	Versionable `json:",inline"`
	RequestId   string      `json:"requestId"`
	Message     interface{} `json:"message,omitempty"`
	StatusCode  int         `json:"statusCode"`
}

BaseResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BaseResponse

func NewBaseResponse

func NewBaseResponse(requestId string, message string, statusCode int) BaseResponse

type BaseSearchConditionQuery

type BaseSearchConditionQuery struct {
	Page     int    `schema:"page,omitempty" form:"page"`
	PageSize int    `schema:"pageSize,omitempty" form:"pageSize" json:"pageSize"`
	Id       string `schema:"id,omitempty" form:"id"`
	Ids      string `schema:"ids,omitempty" form:"ids"`
	LikeId   string `schema:"likeId,omitempty" form:"likeId"`
	Name     string `schema:"name,omitempty" form:"name"`
	NameLike string `schema:"nameLike,omitempty" form:"nameLike"`
	IsAll    bool   `schema:"isAll,omitempty" form:"isAll"`
	OrderBy  string `schema:"orderBy,omitempty" form:"orderBy"`
}

func (BaseSearchConditionQuery) GetPage

func (req BaseSearchConditionQuery) GetPage() (int, int)

type BaseWithIdResponse

type BaseWithIdResponse struct {
	BaseResponse `json:",inline"`
	Id           string `json:"id"`
}

BaseWithIdResponse defines the base content for response DTOs (data transfer objects). This object and its properties correspond to the BaseWithIdResponse object in the APIv2 specification: https://app.swaggerhub.com/apis-docs/EdgeXFoundry1/core-data/2.x#/BaseWithIdResponse

func NewBaseWithIdResponse

func NewBaseWithIdResponse(requestId string, message string, statusCode int, id string) BaseWithIdResponse

type BatchData

type BatchData struct {
	Properties map[string]BatchProperty `json:"properties"`
	Events     map[string]BatchEvent    `json:"events"`
}

type BatchEvent

type BatchEvent struct {
	//EventTime    int64                  `json:"eventTime"`
	OutputParams map[string]interface{} `json:"outputParams"`
}

type BatchProperty

type BatchProperty struct {
	Value interface{} `json:"value"`
}

type CallbackHandler

type CallbackHandler func(context.Context, CallbackMessage)

type CallbackMessage

type CallbackMessage struct {
	Error error
}

type CategoryTemplateRequest

type CategoryTemplateRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	CategoryName             string `schema:"category_name"`
	Scene                    string `schema:"scene"`
}

type CategoryTemplateResponse

type CategoryTemplateResponse struct {
	Id           string `json:"id"`
	CategoryName string `json:"category_name"` //品类名称
	CategoryKey  string `json:"category_key"`
	Scene        string `json:"scene"` //所属场景
}

type CategoryTemplateSyncRequest

type CategoryTemplateSyncRequest struct {
	VersionName string `json:"version_name"`
}

type ClientInfo

type ClientInfo struct {
	Address string
	// 是否启用tls
	UseTLS bool
	// ca cert
	CertFilePath string
	// mqtt clientId
	ClientId string
	// mqtt username
	Username string
	// mqtt password
	Password string
}

ClientInfo provides the host and port of another service in tedge.

type CloudInstanceConfig

type CloudInstanceConfig struct {
	Logger        CloudInstanceLogConfig
	Clients       map[string]ClientInfo
	Authorization AuthorizationInfo
	Service       ServiceInfo
}

type CloudInstanceLogConfig

type CloudInstanceLogConfig struct {
	FileName  string
	LogSwitch bool
	LogFilter []string
}

type CmdRequest

type CmdRequest struct {
	Cid      string
	Protocol int32
	S        int64
	T        int64
	Data     []byte // json encode
}

北向指令

func (CmdRequest) String

func (cr CmdRequest) String() string

type CommandQueryRequest

type CommandQueryRequest struct {
	DeviceId string `form:"device_id" binding:"required"`
}

type CommandResponse

type CommandResponse struct {
	Id        string                 `json:"id"`       // uuid
	Cid       string                 `json:"cid"`      // 设备ID
	Protocol  int32                  `json:"protocol"` // 协议号
	Timestamp int64                  `json:"timestamp"`
	Data      map[string]interface{} `json:"data"` // 序列化后的数据
}

func (CommandResponse) DataJSON

func (cmd CommandResponse) DataJSON() string

type CommonResponse

type CommonResponse struct {
	Success   bool        `json:"success"`
	ErrorMsg  string      `json:"errorMsg"`
	ErrorCode int         `json:"errorCode"`
	Result    interface{} `json:"result"`
}

type Condition

type Condition struct {
	ConditionType string            `json:"condition_type"`
	Option        map[string]string `json:"option"`
}

type ConfigDnsResponse

type ConfigDnsResponse struct {
	Dns        []string `json:"dns"`
	OpenSwitch bool     `json:"openSwitch"`
}

func (ConfigDnsResponse) MarshalBinary

func (d ConfigDnsResponse) MarshalBinary() ([]byte, error)

type ConfigDnsUpdateRequest

type ConfigDnsUpdateRequest struct {
	Dns        []string `json:"dns,omitempty" binding:"required"`
	OpenSwitch bool     `json:"openSwitch,omitempty"`
}

type ConfigNetWork

type ConfigNetWork struct {
	NcId    string `json:"ncId"`
	LocalIp string `json:"localIp,omitempty"`
	GwIp    string `json:"gwIp,omitempty"`
	SmIp    string `json:"smIp,omitempty"`
	Netlink bool   `json:"netlink,omitempty"`
}

type ConfigNetWorkResponse

type ConfigNetWorkResponse struct {
	List []ConfigNetWork `json:"list"`
}

func NewConfigNetWorkResponse

func NewConfigNetWorkResponse() ConfigNetWorkResponse

func (ConfigNetWorkResponse) MarshalBinary

func (d ConfigNetWorkResponse) MarshalBinary() ([]byte, error)

func (*ConfigNetWorkResponse) UnmarshalBinary

func (d *ConfigNetWorkResponse) UnmarshalBinary(data []byte) error

type ConfigNetworkUpdateRequest

type ConfigNetworkUpdateRequest struct {
	NcId    string `json:"ncId" binding:"required"`
	LocalIp string `json:"localIp" binding:"required,ipv4"`
	GwIp    string `json:"gwIp" binding:"required,ipv4"`
	SmIp    string `json:"smIp" binding:"required,ipv4"`
}

type Configuration

type Configuration struct {
	DbType       string
	Host         string
	Port         string
	Timeout      int
	DatabaseName string
	Username     string
	Password     string
	BatchSize    int
	Dsn          string
	// 添加sqlite数据库存储地址
	DataSource string
	// 添加tqlite集群地址
	Cluster []string
}

type ConnectHandler

type ConnectHandler func(ctx context.Context)

type CosCategoryTemplateResponse

type CosCategoryTemplateResponse struct {
	CategoryName string `json:"category_name"`
	CategoryKey  string `json:"category_key"`
	Scene        string `json:"scene"`
}

type CosDocTemplateResponse

type CosDocTemplateResponse struct {
	Name     string `json:"Name"`
	Sort     int    `json:"Sort"`
	JumpLink string `json:"JumpLink"`
}

type CosQuickNavigationTemplateResponse

type CosQuickNavigationTemplateResponse struct {
	Name     string `json:"Name"`
	Sort     int    `json:"Sort"`
	Icon     string `json:"Icon"`
	JumpLink string `json:"JumpLink"`
}

type CosThingModelTemplateResponse

type CosThingModelTemplateResponse struct {
	CategoryName   string `json:"category_name"`
	CategoryKey    string `json:"category_key"`
	ThingModelJSON string `json:"thing_model_json"`
}

type CosUnitTemplateResponse

type CosUnitTemplateResponse struct {
	UnitName string `json:"Name"`
	Symbol   string `json:"Symbol"`
}

type CpuStats

type CpuStats struct {
	CpuUsage       CpuUsage `json:"cpu_usage"`
	SystemCpuUsage int64    `json:"system_cpu_usage"`
	OnlineCpus     int64    `json:"online_cpus"`
}

type CpuUsage

type CpuUsage struct {
	PercpuUsage []int64 `json:"percpu_usage"`
	TotalUsage  int64   `json:"total_usage"`
}

type CreateRule

type CreateRule struct {
	Triggered bool      `json:"triggered"`
	Id        string    `json:"id"`
	Name      string    `json:"name"`
	Sql       string    `json:"sql"`
	Actions   []Actions `json:"actions"`
}

func (CreateRule) BuildCreateRuleParam

func (b CreateRule) BuildCreateRuleParam(actions []Actions, ruleId, sql string) CreateRule

type DataResourceInfo

type DataResourceInfo struct {
	Name   string                 `json:"name"`
	Type   string                 `json:"type"`
	Option map[string]interface{} `json:"option"`
}

type DataResourceSearchQueryRequest

type DataResourceSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Type                     string `schema:"type,omitempty"`
	Health                   string `schema:"health,omitempty"`
}

type DebugAssistantReq

type DebugAssistantReq struct {
	DeviceId string                 `json:"deviceId,omitempty"`
	OpType   int32                  `json:"opType,omitempty"`
	Data     map[string]interface{} `json:"data" binding:"required"`
	Protocol int32                  `json:"protocol" binding:"required"`
	S        int64                  `json:"s"`
	T        int64                  `json:"t" binding:"required"`
}

DebugAssistantReq 调试助手请求参数 TODO 可以直接使用 DpMessage

func (DebugAssistantReq) DataString

func (r DebugAssistantReq) DataString() string

type DeviceAddRequest

type DeviceAddRequest struct {
	DeviceId         string                `json:"device_id"`
	Name             string                `json:"name"`
	ProductId        string                `json:"product_id"`
	Description      string                `json:"description"`
	Platform         constants.IotPlatform `json:"platform"`
	DriverInstanceId string                `json:"driver_instance_id"`
}

type DeviceAddResponse

type DeviceAddResponse struct {
	List       []DeviceAddResult `json:"list"`
	ProcessNum int               `json:"processNum"`
	SuccessNum int               `json:"successNum"`
	FailNum    int               `json:"failNum"`
}

type DeviceAddResult

type DeviceAddResult struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	Status  bool   `json:"status"`
	Message string `json:"message"`
}

type DeviceAuthInfoResponse

type DeviceAuthInfoResponse struct {
	ClientId string `json:"clientId"`
	UserName string `json:"username"`
	Password string `json:"password"`
	Host     string `json:"mqttHostUrl"`
	Port     int    `json:"port"`
}

func DeviceAuthInfoResponseFromModel

func DeviceAuthInfoResponseFromModel(p models.MqttAuth) DeviceAuthInfoResponse

type DeviceBatchDelete

type DeviceBatchDelete struct {
	DeviceIds []string `json:"device_ids"`
}

type DeviceBatchReport

type DeviceBatchReport struct {
	MsgId   string `json:"msgId"`
	Version string `json:"version"`
	Time    int64  `json:"time"`
	Sys     struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Data BatchData `json:"data"`
}

type DeviceDeleteCallBack

type DeviceDeleteCallBack struct {
	Id              string `json:"id"`
	DriveInstanceId string `json:"drive_instance_id"`
}

type DeviceEffectivePropertyDataReq

type DeviceEffectivePropertyDataReq struct {
	DeviceId string   `json:"deviceId"`
	Codes    []string `json:"codes"`
}

type DeviceEffectivePropertyDataResponse

type DeviceEffectivePropertyDataResponse struct {
	Data []EffectivePropertyData `json:"propertyInfo"`
}

type DeviceExecRes

type DeviceExecRes struct {
	Result  bool   `json:"result"`
	Message string `json:"message"`
}

func (*DeviceExecRes) ToString

func (d *DeviceExecRes) ToString() string

type DeviceGetPropertyData

type DeviceGetPropertyData struct {
	MsgId   string   `json:"msgId"`
	Version string   `json:"version"`
	Time    int64    `json:"time"`
	Data    []string `json:"data"`
}

func (*DeviceGetPropertyData) ToString

func (r *DeviceGetPropertyData) ToString() string

type DeviceGetPropertyResponse

type DeviceGetPropertyResponse struct {
	MsgId string                  `json:"msgId"`
	Data  []EffectivePropertyData `json:"data"`
}

type DeviceImportTemplateRequest

type DeviceImportTemplateRequest struct {
}

type DeviceInfoResponse

type DeviceInfoResponse struct {
	Id                string                 `json:"id"`
	CloudDeviceId     string                 `json:"cloud_device_id"`
	CloudProductId    string                 `json:"cloud_product_id"`
	CloudInstanceId   string                 `json:"cloud_instance_id"`
	Name              string                 `json:"name"`
	Status            constants.DeviceStatus `json:"status"`
	Description       string                 `json:"description"`
	ProductId         string                 `json:"product_id"`
	ProductName       string                 `json:"product_name"`
	Secret            string                 `json:"secret"`
	Platform          constants.IotPlatform  `json:"platform"`
	DeviceServiceName string                 `json:"device_service_name"`
	LastSyncTime      int64                  `json:"last_sync_time"`
	LastOnlineTime    int64                  `json:"last_online_time"`
	Created           int64                  `json:"create_at"`
}

func DeviceInfoResponseFromModel

func DeviceInfoResponseFromModel(p models.Device, deviceServiceName string) DeviceInfoResponse

type DeviceLibrary

type DeviceLibrary struct {
	Id             string
	Name           string // 容器名/软件名
	Alias          string
	Description    string
	Protocol       string
	Version        string
	LibFile        string
	ConfigFile     string
	Config         string
	DockerConfigId string
	DockerRepoName string
	DockerImageId  string
	//SupportVersions []DeviceLibrarySupportVersion
	IsInternal    bool
	OperateStatus string // 下载状态
}

func DeviceLibraryFromModel

func DeviceLibraryFromModel(d models.DeviceLibrary) DeviceLibrary

type DeviceLibraryAddRequest

type DeviceLibraryAddRequest struct {
	Id             string `json:"id,omitempty"`
	Name           string `json:"name" binding:"required"`
	Description    string `json:"description,omitempty"`
	Protocol       string `json:"protocol"`
	Version        string `json:"version" binding:"required"`
	ContainerName  string `json:"container_name" binding:"required"`
	DockerConfigId string `json:"docker_config_id" binding:"required"`
	DockerRepoName string `json:"docker_repo_name" binding:"required"`
	Language       string `json:"language"` //代码语言
	SupportVersion struct {
		IsDefault          bool   `json:"is_default"`
		DockerParamsSwitch bool   `json:"docker_params_switch"`
		DockerParams       string `json:"docker_params"`
		ExpertMode         bool   `json:"expert_mode"`
		ExpertModeContent  string `json:"expert_mode_content"`
		ConfigJson         string `json:"config_json"`
	} `json:"support_version"`
}

type DeviceLibraryResponse

type DeviceLibraryResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	//Alias           string                              `json:"alias"`
	Description string `json:"description"`
	//Manufacturer    string                              `json:"manufacturer"`
	Protocol      string `json:"protocol"`
	Version       string `json:"version"`
	ContainerName string `json:"container_name"`
	//ConfigFile      string                              `json:"config_file"`
	DockerConfigId  string                              `json:"docker_config_id"`
	DockerRepoName  string                              `json:"docker_repo_name"`
	OperateStatus   string                              `json:"operate_status"`
	IsInternal      bool                                `json:"is_internal"`
	Manual          string                              `json:"manual"`
	Icon            string                              `json:"icon"`
	ClassifyId      int                                 `json:"classify_id"`
	Created         int64                               `json:"created"`
	Language        string                              `json:"language"`
	SupportVersions []DeviceLibrarySupportVersionSimple `json:"support_versions"` // 用于前端展示可供下载/更新的版本号 key:value == 版本号:配置文件
}

func DeviceLibraryResponseFromModel

func DeviceLibraryResponseFromModel(dl models.DeviceLibrary) DeviceLibraryResponse

type DeviceLibrarySearchQueryRequest

type DeviceLibrarySearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	DockerConfigId           string `form:"docker_config_id" json:"docker_config_id"`
	IsInternal               string `form:"is_internal" json:"is_internal"`
	ClassifyId               int    `form:"classify_id" json:"classify_id"`
	DockerRepoName           string `form:"docker_repo_name" json:"docker_repo_name"`
	NameAliasLike            string `form:"name_alias_like" json:"name_alias_like"`
	DownloadStatus           string `form:"download_status" json:"download_status"`
	DriverType               int    `form:"driver_type" json:"driver_type" binding:"omitempty,oneof=1 2"` // 驱动库类型,1:驱动,2:三方应用
	NoInIds                  string // 约定,没有from的为 内置查询条件
	ImageIds                 string // 内置条件
	NoInImageIds             string // 内置条件
}

type DeviceLibrarySupportVersion

type DeviceLibrarySupportVersion struct {
	Version            string `json:"version"`
	IsDefault          bool   `json:"is_default"`
	DockerParamsSwitch bool   `json:"docker_params_switch"`
	DockerParams       string `json:"docker_params"`
	ExpertMode         bool   `json:"expert_mode"`
	ExpertModeContent  string `json:"expert_mode_content"`
	ConfigFile         string `json:"config_file"`
	ConfigJson         string `json:"config_json"`
}

func SupperVersionsFromModel

func SupperVersionsFromModel(versions []models.SupportVersion) []DeviceLibrarySupportVersion

type DeviceLibrarySupportVersionSimple

type DeviceLibrarySupportVersionSimple struct {
	Version    string `json:"version"`
	IsDefault  bool   `json:"is_default"`
	ConfigFile string `json:"config_file"`
}

func DeviceLibrarySupportVersionSimpleFromModel

func DeviceLibrarySupportVersionSimpleFromModel(versions models.SupportVersions) []DeviceLibrarySupportVersionSimple

type DeviceLibraryUpgradeRequest

type DeviceLibraryUpgradeRequest struct {
	Id      string `json:"id" binding:"required"`
	Version string `json:"version" binding:"required"`
}

type DeviceLibraryUpgradeResponse

type DeviceLibraryUpgradeResponse struct {
	Id            string `json:"id"`
	Version       string `json:"version"`
	OperateStatus string `json:"operate_status"`
}

type DevicePropertyReport

type DevicePropertyReport struct {
	MsgId   string `json:"msgId"`
	Version string `json:"version"`
	//Time    int64  `json:"time"`
	Sys struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Data map[string]ReportData `json:"data"`
}

type DevicePropertySetData

type DevicePropertySetData struct {
	ErrorMessage string `json:"errorMessage"`
	Code         uint32 `json:"code"`
	Success      bool   `json:"success"`
}

type DevicePropertySetResponse

type DevicePropertySetResponse struct {
	MsgId string                `json:"msgId"`
	Data  DevicePropertySetData `json:"data"`
}

type DeviceReportPropertiesValueSearchRequest

type DeviceReportPropertiesValueSearchRequest struct {
	DeviceId string `json:"device_id"`
}

type DeviceReportPropertiesValueSearchResponse

type DeviceReportPropertiesValueSearchResponse struct {
	PropertyInfoList []PropertyInfo `json:"property_info_list"`
}

type DeviceSearchQueryRequest

type DeviceSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Platform                 string `schema:"platform,omitempty"`
	Name                     string `schema:"name,omitempty"`
	ProductId                string `schema:"product_id,omitempty"`
	CloudProductId           string `schema:"cloud_product_id,omitempty"`
	CloudInstanceId          string `schema:"cloud_instance_id,omitempty"`
	DriveInstanceId          string `schema:"drive_instance_id,omitempty"`
	Status                   string `schema:"status,omitempty"`
}

type DeviceSearchQueryResponse

type DeviceSearchQueryResponse struct {
	Id                string                 `json:"id"`
	Name              string                 `json:"name"`
	ProductId         string                 `json:"product_id"`
	Status            constants.DeviceStatus `json:"status"`
	Platform          constants.IotPlatform  `json:"platform"`
	CloudInstanceId   string                 `json:"cloud_instance_id"`
	CloudProductId    string                 `json:"cloud_product_id"`
	DriverServiceName string                 `json:"driver_service_name"`
	ProductName       string                 `json:"product_name"`
	LastSyncTime      int64                  `json:"last_sync_time"`
	LastOnlineTime    int64                  `json:"last_online_time"`
	DriveInstanceId   string                 `json:"drive_instance_id"`
	Created           int64                  `json:"created"`
	Description       string                 `json:"description"`
}

func DeviceResponseFromModel

func DeviceResponseFromModel(p models.Device, deviceServiceName string) DeviceSearchQueryResponse

type DeviceService

type DeviceService struct {
	Id                 string                 `json:"id,omitempty"`
	Name               string                 `json:"name"`
	Created            int64                  `json:"created,omitempty"`
	Modified           int64                  `json:"modified,omitempty"`
	BaseAddress        string                 `json:"baseAddress"`
	DeviceLibraryId    string                 `json:"deviceLibraryId"`
	Config             map[string]interface{} `json:"config"`
	DockerContainerId  string                 `json:"dockerContainerId"`
	ExpertMode         bool                   `json:"isExpertMode"`
	ExpertModeContent  string                 `json:"expertModeContent"`
	DockerParamsSwitch bool                   `json:"dockerParamsSwitch"`
	DockerParams       string                 `json:"dockerParams"`
	ContainerName      string                 `json:"container_name"`
}

func DeviceServiceFromModel

func DeviceServiceFromModel(ds models.DeviceService) DeviceService

type DeviceServiceAddRequest

type DeviceServiceAddRequest struct {
	Id                 string                 `json:"id,omitempty" binding:"omitempty,t-special-char"`
	Name               string                 `json:"name"`
	DeviceLibraryId    string                 `json:"deviceLibraryId" binding:"required"`
	Config             map[string]interface{} `json:"config" binding:"required"`
	ExpertMode         bool                   `json:"expertMode"`
	ExpertModeContent  string                 `json:"expertModeContent"`
	DockerParamsSwitch bool                   `json:"dockerParamsSwitch"`
	DockerParams       string                 `json:"dockerParams"`
	DriverType         int                    `json:"driverType" binding:"omitempty,oneof=1 2"` //驱动库类型,1:驱动,2:三方应用
}

type DeviceServiceDeleteRequest

type DeviceServiceDeleteRequest struct {
	Id string `json:"id" binding:"required"`
}

type DeviceServiceResponse

type DeviceServiceResponse struct {
	Id            string                `json:"id"`
	Name          string                `json:"name"`
	DeviceLibrary DeviceLibraryResponse `json:"deviceLibrary"`
	//Version       string                `json:"version"`
	RunStatus          int         `json:"runStatus"`
	Config             interface{} `json:"config"`
	ExpertMode         bool        `json:"expertMode"`
	ExpertModeContent  string      `json:"expertModeContent"`
	DockerParamsSwitch bool        `json:"dockerParamsSwitch"`
	DockerParams       string      `json:"dockerParams"`
	CreateAt           int64       `json:"create_at"`
	ImageExist         bool        `json:"imageExist"`
	Platform           string      `json:"platform"`
}

type DeviceServiceRunLogRequest

type DeviceServiceRunLogRequest struct {
	Id      string `json:"id"`
	Operate int    `json:"operate" binding:"required,oneof=1 2"`
}

type DeviceServiceSearchQueryRequest

type DeviceServiceSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ProductId                string `form:"productId"`
	CloudProductId           string `form:"cloudProductId"`
	DeviceLibraryId          string `form:"deviceLibraryId"`  // 驱动库ID
	DeviceLibraryIds         string `form:"deviceLibraryIds"` // 驱动库IDs
	Platform                 string `form:"platform"`
	DriverType               int    `form:"driver_type" binding:"omitempty,oneof=1 2"` //驱动库类型,1:驱动,2:三方应用
}

type DeviceServiceUpdateRequest

type DeviceServiceUpdateRequest struct {
	Id                 string                  `json:"id" binding:"required"`
	DeviceLibraryId    *string                 `json:"deviceLibraryId"`
	Name               *string                 `json:"name"`
	Config             *map[string]interface{} `json:"config"`
	ExpertMode         *bool                   `json:"expertMode"`
	ExpertModeContent  *string                 `json:"expertModeContent"`
	DockerParamsSwitch *bool                   `json:"docker_params_switch"`
	DockerParams       *string                 `json:"docker_params"`
	Platform           constants.IotPlatform   `json:"platform"`
}

type DeviceStatusRequest

type DeviceStatusRequest struct {
	DeviceId string `json:"device_id"`
}

type DeviceSyncByIdRequest

type DeviceSyncByIdRequest struct {
	DeviceId string `json:"device_id"`
}

type DeviceSyncRequest

type DeviceSyncRequest struct {
	CloudInstanceId string `json:"cloud_instance_id"`
	DriveInstanceId string `json:"driver_instance_id"`
}

type DeviceUpdateOrCreateCallBack

type DeviceUpdateOrCreateCallBack struct {
	Id              string                 `json:"id"`
	Name            string                 `json:"name"`
	Description     string                 `json:"description"`
	ProductId       string                 `json:"product_id"`
	Status          constants.DeviceStatus `json:"status"`
	Platform        constants.IotPlatform  `json:"platform"`
	DriveInstanceId string                 `json:"drive_instance_id"`
}

type DeviceUpdateRequest

type DeviceUpdateRequest struct {
	Id          string  `json:"id"`
	Description *string `json:"description"`
	//Ip              *string `json:"ip"`
	//Lat             *string `json:"lat"`
	//Lon             *string `json:"lon"`
	Name            *string `json:"name"`
	InstallLocation *string `json:"install_location"`
	DriveInstanceId *string `json:"drive_instance_id"`
}

type DevicesBindDriver

type DevicesBindDriver struct {
	DeviceIds        []string `json:"device_ids"`
	DriverInstanceId string   `json:"driver_instance_id,omitempty"`
}

type DevicesBindProductId

type DevicesBindProductId struct {
	ProductId        string `json:"product_id"`
	DriverInstanceId string `json:"driver_instance_id,omitempty"`
}

type DevicesImport

type DevicesImport struct {
	ProductId        string `schema:"product_id,omitempty"`
	DriverInstanceId string `schema:"driver_instance_id,omitempty"`
}

type DevicesUnBindDriver

type DevicesUnBindDriver struct {
	DeviceIds []string `json:"device_ids"`
}

type Doc

type Doc struct {
	Name     string `json:"name"`
	JumpLink string `json:"jumpLink,omitempty"`
}

type DockerConfig

type DockerConfig struct {
	Id       string
	Address  string
	Account  string
	Password string
	SaltKey  string
}

func DockerConfigFromModel

func DockerConfigFromModel(dc models.DockerConfig) DockerConfig

func WincLinkDockerConfig

func WincLinkDockerConfig() DockerConfig

type DockerConfigAddRequest

type DockerConfigAddRequest struct {
	Id       string `json:"id"`
	Address  string `json:"address" binding:"required"` // 仓库地址 true
	Account  string `json:"account,omitempty"`          // 账户
	Password string `json:"password,omitempty"`         // 密码
}

type DockerConfigResponse

type DockerConfigResponse struct {
	Id      string `json:"id"`
	Address string `json:"address"`
	Account string `json:"account"`
}

func DockerConfigResponseFromModel

func DockerConfigResponseFromModel(dc models.DockerConfig) DockerConfigResponse

type DockerConfigSearchQueryRequest

type DockerConfigSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Address                  string `schema:"address"`
	Account                  string `schema:"account"`
}

type DockerConfigUpdateRequest

type DockerConfigUpdateRequest struct {
	Id       string  `json:"id" binding:"required"`
	Address  *string `json:"address"`
	Account  *string `json:"account"`
	Password *string `json:"password"`
}

type DockerManageConfig

type DockerManageConfig struct {
	ContainerConfigPath string // 容器内部驱动运行启动的配置文件路径
	DockerApiVersion    string // docker 版本号
	DockerRunMode       string // 默认运行模式 默认是host
	DockerSelfName      string // edge启动的容器名
	Privileged          bool   // 容器特权
}

type Docs

type Docs struct {
	More string `json:"more"`
	Doc  []Doc  `json:"info"`
}

type DocsSearchQueryRequest

type DocsSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
}

type DriverClassifyQueryRequest

type DriverClassifyQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name"`
}

type DriverClassifyResponse

type DriverClassifyResponse struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}

type DriverConfig

type DriverConfig struct {
	Logger      LogConfig
	Clients     map[string]ClientInfo
	Service     ServiceInfo
	CustomParam string
}

type DriverConfigManage

type DriverConfigManage struct {
	HostRootDir string // 宿主主机dir
	NetWorkName string
	DockerManageConfig
}

func (*DriverConfigManage) GetBinPath

func (m *DriverConfigManage) GetBinPath(serverName string) string

驱动二进制文件路径 /var/tedge/edgex-driver-data/bin/modbus-1234

func (*DriverConfigManage) GetHostLogFilePath

func (m *DriverConfigManage) GetHostLogFilePath(serviceName string) string

/var/edge/edge-driver-data/mnt/aliyun-iot

func (*DriverConfigManage) GetHostMntDir

func (m *DriverConfigManage) GetHostMntDir(serviceName string) string

docker挂载 的日志:只针对docker版本,二进制版本需要改动日志存储地址 /var/edge/mnt/modbus-1234.toml

func (*DriverConfigManage) GetHostRunConfigPath

func (m *DriverConfigManage) GetHostRunConfigPath(serviceName string) string

docker挂载

func (*DriverConfigManage) GetLibraryDir

func (m *DriverConfigManage) GetLibraryDir() string

存储驱动上传配置定义文件目录 /var/tedge/edgex-driver-data/driver-library/

func (*DriverConfigManage) GetLogFilePath

func (m *DriverConfigManage) GetLogFilePath(serviceName string) string

二进制版本 驱动运行日志文件 /var/tedge/mnt/modbus-1234/logs/driver.log

func (*DriverConfigManage) GetMntDir

func (m *DriverConfigManage) GetMntDir(serviceName string) string

二进制版本路径 驱动启动的配置文件路径 /var/edge/mnt/modbus-1234.toml

func (*DriverConfigManage) GetRunConfigPath

func (m *DriverConfigManage) GetRunConfigPath(serviceName string) string

驱动启动的配置文件路径 /var/edge/run-config/modbus-1234.toml

func (*DriverConfigManage) SetHostRootDir

func (m *DriverConfigManage) SetHostRootDir(dir string)

func (*DriverConfigManage) SetNetworkName

func (m *DriverConfigManage) SetNetworkName(networkName string)

type EdgeBaseConfig

type EdgeBaseConfig struct {
}

type EdgeConfig

type EdgeConfig struct {
	GwId           string `yaml:"gwid"`
	SecKey         string `yaml:"seckey"`
	Status         bool   `yaml:"status"`
	ActiveTime     string `yaml:"activetime"`
	VersionNumber  string `yaml:"versionnumber"`
	SubDeviceLimit int64  `yaml:"subdevicelimit"`
}

func (EdgeConfig) CheckThingModelActiveGw

func (c EdgeConfig) CheckThingModelActiveGw() bool

func (EdgeConfig) GetGatewayNumber

func (c EdgeConfig) GetGatewayNumber() string

func (EdgeConfig) IsActivated

func (c EdgeConfig) IsActivated() bool

type EdgeGwConfig

type EdgeGwConfig struct {
	GwId     string `json:"gwId"`
	SecKey   string `json:"secKey"`
	LocalKey string `json:"localKey"`
	Status   bool   `json:"status"`
}

type EdgeXDeviceEventReport

type EdgeXDeviceEventReport struct {
	MsgId   string `json:"msgId"`
	Version string `json:"version"`
	Sys     struct {
		Ack int `json:"ack"`
	} `json:"sys"`
	Data EventData `json:"data"`
}

type EffectivePropertyData

type EffectivePropertyData struct {
	Code  string      `json:"code"`
	Value interface{} `json:"value"`
	Time  int64       `json:"time"`
}

type EventData

type EventData struct {
	EventCode    string                 `json:"eventCode"`
	EventTime    int64                  `json:"eventTime"`
	OutputParams map[string]interface{} `json:"outputParams"`
}

func (*EventData) Marshal

func (r *EventData) Marshal() ([]byte, error)

type ExportFile

type ExportFile struct {
	Excel    *excelize.File
	FileName string
}

func NewExportFile

func NewExportFile(filename string) (*ExportFile, error)

func (*ExportFile) GetCenterStyle

func (f *ExportFile) GetCenterStyle() int

func (*ExportFile) GetRequiredStyle

func (f *ExportFile) GetRequiredStyle() int

type Filter

type Filter struct {
	MessageSource string `json:"message_source"`
	SelectName    string `json:"select_name"`
	Condition     string `json:"condition"`
	Sql           string `json:"sql"`
}

type GetRuleInfoResponse

type GetRuleInfoResponse struct {
	Triggered bool                     `json:"triggered"`
	Id        string                   `json:"id"`
	Name      string                   `json:"name"`
	Sql       string                   `json:"sql"`
	Actions   []map[string]interface{} `json:"actions"`
	Options   map[string]interface{}   `json:"options"`
}

type GetRuleStatusResponse

type GetRuleStatusResponse struct {
	Status string `json:"status"`
}

type Gps

type Gps struct {
	Longitude float64 `json:"longitude"`
	Latitude  float64 `json:"latitude"`
}

func (Gps) ToLocation

func (gps Gps) ToLocation() string

type HandleLog

type HandleLog struct {
	Req      interface{} `json:"req"`
	Reply    interface{} `json:"reply"`
	Success  bool        `json:"success"`
	Method   string      `json:"method"`
	Duration string      `json:"duration"`
	Error    string      `json:"error"`
}

func (HandleLog) ToString

func (hl HandleLog) ToString() string

type HomePageRequest

type HomePageRequest struct {
}

type HomePageResponse

type HomePageResponse struct {
	PageInfo struct {
		Product struct {
			Total uint32 `json:"total"`
			Self  uint32 `json:"self"`
			Other uint32 `json:"other"`
		} `json:"product"`
		Device struct {
			Total uint32 `json:"total"`
			Self  uint32 `json:"self"`
			Other uint32 `json:"other"`
		} `json:"device"`
		CloudInstance struct {
			Count     uint32 `json:"count"`
			RunCount  uint32 `json:"run_count"`
			StopCount uint32 `json:"stop_count"`
		} `json:"cloudInstance"`
		Alert struct {
			Total uint32 `json:"total"`
		} `json:"alert"`
	} `json:"pageInfo"`
	QuickNavigation []QuickNavigation         `json:"quickNavigation"`
	Docs            Docs                      `json:"docs"`
	AlertPlate      []AlertPlateQueryResponse `json:"alertPlate"`
	MsgGather       []MsgGather               `json:"msg_gather"`
}

type ImportFile

type ImportFile struct {
	Excel *excelize.File
}

func NewImportFile

func NewImportFile(f io.Reader) (*ImportFile, error)

type InitInfoResponse

type InitInfoResponse struct {
	IsInit bool `json:"isInit"`
}

type InitPasswordRequest

type InitPasswordRequest struct {
	NewPassword string `json:"newPassword" binding:"required"`
}

type InvokeDeviceService

type InvokeDeviceService struct {
	MsgId   string      `json:"msgId"`
	Version string      `json:"version"`
	Time    int64       `json:"time"`
	Data    ServiceData `json:"data"`
}

operationType:SERVICE_EXECUTE data:"topic:\"/sys/hq85KDcqGI6/test_008/thing/service/DeleteAlgorithmModel\" message:\"{\\\"id\\\":\\\"2130175210\\\",\\\"version\\\":\\\"1.0.0\\\",\\\"code\\\":\\\"DeleteAlgorithmModel\\\",\\\"params\\\":{\\\"ForceDelete\\\":3}}\""

func (*InvokeDeviceService) ToString

func (r *InvokeDeviceService) ToString() string

type InvokeDeviceServiceReq

type InvokeDeviceServiceReq struct {
	DeviceId string                 `json:"deviceId"`
	Code     string                 `json:"code"`
	Items    map[string]interface{} `json:"inputParams"`
}

type InvokeLog

type InvokeLog struct {
	Req      interface{} `json:"req"`
	Reply    interface{} `json:"reply"`
	Success  bool        `json:"success"`
	Method   string      `json:"method"`
	Duration string      `json:"duration"`
	Error    string      `json:"error"`
}

func (InvokeLog) ToString

func (il InvokeLog) ToString() string

type JobAction

type JobAction struct {
	ActionType  string      `json:"actionType"`
	ProductId   string      `json:"productId"`
	ProductName string      `json:"product_name"`
	DeviceId    string      `json:"deviceId"`
	DeviceName  string      `json:"deviceName"`
	Code        string      `json:"code"`
	DateType    string      `json:"dateType"`
	Value       interface{} `json:"value"`
}

type LanguageSDK

type LanguageSDK struct {
	Name        string `json:"name"`
	Icon        string `json:"icon"`
	Sort        int    `json:"sort"`
	Addr        string `json:"addr"`
	Description string `json:"description"`
}

type LanguageSDKSearchQueryRequest

type LanguageSDKSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
}

type LanguageSDKSearchResponse

type LanguageSDKSearchResponse struct {
	Name        string `json:"name"`
	Icon        string `json:"icon"`
	Addr        string `json:"addr"`
	Description string `json:"description"`
}

type LanguageSDKSyncRequest

type LanguageSDKSyncRequest struct {
	VersionName string `json:"version_name"`
}

type ListCommandResponse

type ListCommandResponse struct {
	List []CommandResponse `json:"list"`
}

func NewListCommandResponse

func NewListCommandResponse() ListCommandResponse

type LogConfig

type LogConfig struct {
	FileName string
	LogLevel string
}

LogConfig logger common

type LogParam

type LogParam struct {
	Line int `form:"line"`
}

type Logging

type Logging struct {
	Log string `json:"log"`
}

type LoginRequest

type LoginRequest struct {
	Username string `json:"username" binding:"required"`
	Password string `json:"password" binding:"required"`
}

type LoginResponse

type LoginResponse struct {
	User      UserResponse `json:"user"`
	Token     string       `json:"token"`
	ExpiresAt int64        `json:"expiresAt"`
}

type MQTT

type MQTT struct {
	Server             string `json:"server,omitempty"`
	Topic              string `json:"topic,omitempty"`
	ClientId           string `json:"clientId,omitempty"`
	ProtocolVersion    string `json:"protocolVersion,omitempty"`
	Qos                int    `json:"qos,omitempty"`
	Username           string `json:"username,omitempty"`
	Password           string `json:"password,omitempty"`
	CertificationPath  string `json:"certificationPath,omitempty"`
	PrivateKeyPath     string `json:"privateKeyPath,omitempty"`
	RootCaPath         string `json:"rootCaPath,omitempty"`
	InsecureSkipVerify string `json:"insecureSkipVerify,omitempty"`
	Retained           bool   `json:"retained,omitempty"`
}

type MemoryStats

type MemoryStats struct {
	Usage    int64             `json:"usage"`
	Limit    int64             `json:"limit"`
	MaxUsage int64             `json:"max_usage"`
	Stats    MemoryStatsDetail `json:"stats"`
}

type MemoryStatsDetail

type MemoryStatsDetail struct {
	Cache int64 `json:"cache"`
	Rss   int64 `json:"rss"`
}

type MessageBus

type MessageBus struct {
	DeviceId    string      `json:"deviceId"`
	MessageType string      `json:"messageType"`
	Data        interface{} `json:"data"`
}

type Metrics

type Metrics struct {
	Timestamp      int64   `json:"timestamp"`      // 时间戳
	CpuUsedPercent float64 `json:"cpuUsedPercent"` // cpu 使用率百分比
	MemoryUsed     int64   `json:"memoryUsed"`     // 内存使用大小,单位:字节
}

func FromModelsMetricsToDTO

func FromModelsMetricsToDTO(m models.Metrics) Metrics

func (Metrics) ToJSON

func (m Metrics) ToJSON() string

type MetricsQuery

type MetricsQuery struct {
	Service     string `form:"service" binding:"required"`                           // 服务ID
	MetricsType string `form:"metrics_type" binding:"oneof=minute hour halfday day"` // 监控类型,范围: minute hour halfday day
	MetricsRangeQuery
}

type MetricsRangeQuery

type MetricsRangeQuery struct {
	Start int64 `form:"start" binding:"gt=0"` // 开始时间戳
	End   int64 `form:"end" binding:"gt=0"`   // 结束时间戳
}

type MetricsResult

type MetricsResult struct {
	Total   int       `json:"total"`
	Metrics []Metrics `json:"metrics"` // 性能点列表
}

swagger:response MetricsResult

type MsgGather

type MsgGather struct {
	Count int    `json:"count"`
	Date  string `json:"date"`
}

type MsgGatherSearchQueryRequest

type MsgGatherSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Date                     []string `schema:"date"`
}

type NetIface

type NetIface struct {
	Ifaces []string `json:"ifaces"`
}

type NetWorkInfo

type NetWorkInfo struct {
	NewWork []NewWork `json:"newWork"`
	Dns     string    `json:"dns"`
}

type NewMQTTClient

type NewMQTTClient struct {
	Broker    string   `json:"broker"`
	ClientId  string   `json:"client_id"`
	Username  string   `json:"username"`
	Password  string   `json:"password"`
	PubTopic  string   `json:"pub_topic"`
	SubTopics []string `json:"sub_topics"`
}

type NewWork

type NewWork struct {
	NcId    string `json:"ncId"`
	LocalIp string `json:"localIp,omitempty"`
	GwIp    string `json:"gwIp,omitempty"`
	SmIp    string `json:"smIp,omitempty"`
	Netlink bool   `json:"netlink"`
}

type Notify

type Notify struct {
	Name            constants.AlertWay `json:"name"` //告警方式
	Option          map[string]string  `json:"option"`
	StartEffectTime string             `json:"start_effect_time"` //生效开始时间
	EndEffectTime   string             `json:"end_effect_time"`   //生效结束时间
}

type OpenApiActions

type OpenApiActions struct {
	Id           string                `json:"id"`
	ProductId    string                `json:"product_id"`
	Name         string                `json:"name"` // 功能名称
	Code         string                `json:"code"` // 标识符
	Required     bool                  `json:"required"`
	CallType     constants.CallType    `json:"call_type"`
	InputParams  []OpenApiInPutParams  `json:"input_params"`  // 输入参数
	OutputParams []OpenApiOutPutParams `json:"output_params"` // 输出参数
	CreatedAt    int64                 `json:"created_at"`
	Description  string                `json:"description"`
}

type OpenApiAddProductRequest

type OpenApiAddProductRequest struct {
	Name        string `json:"name"`        //产品名字
	Protocol    string `json:"protocol"`    //协议
	NodeType    string `json:"node_type"`   //节点类型
	NetType     string `json:"net_type"`    //联网模式
	DataFormat  string `json:"data_format"` //数据类型
	Factory     string `json:"factory"`     //厂家
	Description string `json:"description"` //描述

}

type OpenApiDeviceInfoResponse

type OpenApiDeviceInfoResponse struct {
	Id          string                 `json:"id"`
	Name        string                 `json:"name"`
	Platform    constants.IotPlatform  `json:"platform"`
	Status      constants.DeviceStatus `json:"status"`
	Description string                 `json:"description"`
	ProductId   string                 `json:"product_id"`
	ProductName string                 `json:"product_name"`
	//Secret         string                 `json:"secret"`
	LastOnlineTime int64 `json:"last_online_time"`
	Created        int64 `json:"created_at"`
}

func OpenApiDeviceInfoResponseFromModel

func OpenApiDeviceInfoResponseFromModel(p models.Device) OpenApiDeviceInfoResponse

type OpenApiDeviceStatus

type OpenApiDeviceStatus struct {
	Status constants.DeviceStatus `json:"status"`
}

type OpenApiEvents

type OpenApiEvents struct {
	Id           string                `json:"id"`
	ProductId    string                `json:"product_id"`
	Name         string                `json:"name"` // 功能名称
	Code         string                `json:"code"` // 标识符
	EventType    string                `json:"event_type"`
	Required     bool                  `json:"required"`
	OutputParams []OpenApiOutPutParams `json:"output_params"`
	Description  string                `json:"description"`
	CreatedAt    int64                 `json:"created_at"`
}

type OpenApiInPutParams

type OpenApiInPutParams struct {
	Code     string          `json:"code"`
	Name     string          `json:"name"`
	TypeSpec OpenApiTypeSpec `json:"type_spec"`
}

type OpenApiOutPutParams

type OpenApiOutPutParams struct {
	Code     string          `json:"code"`
	Name     string          `json:"name"`
	TypeSpec OpenApiTypeSpec `json:"type_spec"`
}

type OpenApiProperties

type OpenApiProperties struct {
	Id          string          `json:"id"`
	ProductId   string          `json:"product_id"`  // 产品ID
	Name        string          `json:"name"`        // 属性名称
	Code        string          `json:"code"`        // 标识符
	AccessMode  string          `json:"access_mode"` // 数据传输类型
	Required    bool            `json:"required"`
	TypeSpec    OpenApiTypeSpec `json:"type_spec"` // 数据属性
	Description string          `json:"description"`
	CreatedAt   int64           `json:"created_at"`
}

type OpenApiQueryDevicePropertyData

type OpenApiQueryDevicePropertyData struct {
}

type OpenApiQueryThingModel

type OpenApiQueryThingModel struct {
	Properties []OpenApiThingModelProperties `json:"properties"`
	Events     []OpenApiThingModelEvents     `json:"events"`
	Services   []OpenApiThingModelServices   `json:"services"`
}

type OpenApiQueryThingModelReq

type OpenApiQueryThingModelReq struct {
	ProductId string `schema:"product_id,omitempty"`
}

type OpenApiSetDeviceThingModel

type OpenApiSetDeviceThingModel struct {
	DeviceId string                 `json:"deviceId"`
	Item     map[string]interface{} `json:"item"`
}

type OpenApiThingModelAddOrUpdateReq

type OpenApiThingModelAddOrUpdateReq struct {
	ProductId  string                        `json:"product_id"`
	Properties []OpenApiThingModelProperties `json:"properties"`
	Events     []OpenApiThingModelEvents     `json:"events"`
	Services   []OpenApiThingModelServices   `json:"services"`
}

type OpenApiThingModelDeleteReq

type OpenApiThingModelDeleteReq struct {
	ProductId   string   `json:"product_id"`
	PropertyIds []string `json:"property_ids"`
	EventIds    []string `json:"event_ids"`
	ServiceIds  []string `json:"service_ids"`
}

type OpenApiThingModelEvents

type OpenApiThingModelEvents struct {
	Id string `json:"id"`
	//ProductId    string              `json:"product_id"`
	EventType    string              `json:"event_type"`
	Name         string              `json:"name"` // 功能名称
	Code         string              `json:"code"` // 标识符
	Description  string              `json:"description"`
	Require      bool                `json:"require"`
	OutputParams models.OutPutParams `json:"output_params"`
}

type OpenApiThingModelProperties

type OpenApiThingModelProperties struct {
	Id string `json:"id"`
	//ProductId   string          `json:"product_id"`  // 产品ID
	Name        string          `json:"name"`        // 属性名称
	Code        string          `json:"code"`        // 标识符
	AccessMode  string          `json:"access_mode"` // 数据传输类型
	Require     bool            `json:"require"`
	TypeSpec    models.TypeSpec `json:"type_spec"` // 数据属性
	Description string          `json:"description"`
}

type OpenApiThingModelServices

type OpenApiThingModelServices struct {
	Id string `json:"id"`
	//ProductId    string              `json:"product_id"`
	Name         string              `json:"name"` // 功能名称
	Code         string              `json:"code"` // 标识符
	Description  string              `json:"description"`
	Require      bool                `json:"require"`
	CallType     constants.CallType  `json:"call_type"`
	InputParams  models.InPutParams  `json:"input_params"`  // 输入参数
	OutputParams models.OutPutParams `json:"output_params"` // 输出参数
}

type OpenApiTypeSpec

type OpenApiTypeSpec struct {
	Type  constants.SpecsType `json:"type,omitempty"`
	Specs string              `json:"specs,omitempty"`
}

type OpenApiUpdateProductRequest

type OpenApiUpdateProductRequest struct {
	Id          string  `json:"id"`
	Name        *string `json:"name"`        //产品名字
	Protocol    *string `json:"protocol"`    //协议
	NodeType    *string `json:"node_type"`   //节点类型
	NetType     *string `json:"net_type"`    //联网模式
	DataFormat  *string `json:"data_format"` //数据类型
	Factory     *string `json:"factory"`     //厂家
	Description *string `json:"description"` //描述

}

type Operation

type Operation struct {
	Action  string `json:"action,omitempty" binding:"oneof=start stop restart"` // 动作,重启 restart
	Service string `json:"service,omitempty" binding:"required"`                // 服务名称
}

* An Operation for SMA processing. * * * Operation struct

func (Operation) String

func (o Operation) String() string

String returns a JSON encoded string representation of the model

type PageRequest

type PageRequest struct {
	NameLike string `json:"nameLike" form:"nameLike"`
	Page     int    `json:"page" form:"page"`
	PageSize int    `json:"pageSize" form:"pageSize"`
}

type PlatformInfo

type PlatformInfo struct {
	VersionName string `json:"version_name"`
	DbName      string `json:"db_name"`
}

type ProductAddRequest

type ProductAddRequest struct {
	Name string `json:"name"` //产品名字
	//Platform           string `json:"platform"`
	Key                string `json:"key"`
	CategoryTemplateId string `json:"category_template_id"` //如果是自定义 id固定传递"1"
	Protocol           string `json:"protocol"`             //协议
	NodeType           string `json:"node_type"`            //节点类型
	NetType            string `json:"net_type"`             //联网模式
	DataFormat         string `json:"data_format"`          //数据类型
	Factory            string `json:"factory"`              //厂家
	Description        string `json:"description"`          //描述
}

type ProductSearchByIdOpenApiResponse

type ProductSearchByIdOpenApiResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Key         string `json:"key"`
	Platform    string `json:"platform"`
	Protocol    string `json:"protocol"`
	NodeType    string `json:"node_type"`
	NetType     string `json:"net_type"`
	DataFormat  string `json:"data_format"`
	Factory     string `json:"factory"`
	Status      string `json:"status"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
}

type ProductSearchByIdResponse

type ProductSearchByIdResponse struct {
	Id              string      `json:"id"`
	Name            string      `json:"name"`
	Key             string      `json:"key"`
	CloudProductId  string      `json:"cloud_product_id"`
	CloudInstanceId string      `json:"cloud_instance_id"`
	Platform        string      `json:"platform"`
	Protocol        string      `json:"protocol"`
	NodeType        string      `json:"node_type"`
	NetType         string      `json:"net_type"`
	DataFormat      string      `json:"data_format"`
	Factory         string      `json:"factory"`
	Description     string      `json:"description"`
	Status          string      `json:"status"`
	CreatedAt       int64       `json:"created_at"`
	LastSyncTime    int64       `json:"last_sync_time"`
	Properties      interface{} `json:"properties"`
	Events          interface{} `json:"events"`
	Actions         interface{} `json:"actions"`
}

func ProductSearchByIdFromModel

func ProductSearchByIdFromModel(p models.Product) ProductSearchByIdResponse

type ProductSearchOpenApiResponse

type ProductSearchOpenApiResponse struct {
	Id          string `json:"id"`
	Name        string `json:"name"`
	Key         string `json:"key"`
	Platform    string `json:"platform"`
	Protocol    string `json:"protocol"`
	NodeType    string `json:"node_type"`
	NetType     string `json:"net_type"`
	DataFormat  string `json:"data_format"`
	Factory     string `json:"factory"`
	Status      string `json:"status"`
	Description string `json:"description"`
	CreatedAt   int64  `json:"created_at"`
}

func ProductSearchOpenApiFromModel

func ProductSearchOpenApiFromModel(p models.Product) ProductSearchOpenApiResponse

type ProductSearchQueryRequest

type ProductSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Platform                 string `schema:"platform,omitempty"`
	Name                     string `schema:"name,omitempty"`
	ProductId                string `schema:"product_id,omitempty"`
	CloudInstanceId          string `schema:"cloud_instance_id,omitempty"`
}

type ProductSearchQueryResponse

type ProductSearchQueryResponse struct {
	Id           string `json:"id"`
	ProductId    string `json:"product_id"`
	Name         string `json:"name"`
	Key          string `json:"key"`
	NodeType     string `json:"node_type"`
	Platform     string `json:"platform"`
	Status       string `json:"status"`
	CreatedAt    int64  `json:"created_at"`
	CategoryName string `json:"category_name"`
}

func ProductResponseFromModel

func ProductResponseFromModel(p models.Product) ProductSearchQueryResponse

type ProductSyncByIdRequest

type ProductSyncByIdRequest struct {
	ProductId string `json:"product_id"`
}

type ProductSyncRequest

type ProductSyncRequest struct {
	CloudInstanceId string `json:"cloud_instance_id"`
}

type PropertyInfo

type PropertyInfo struct {
	Code     string `json:"code,omitempty"`
	Value    string `json:"value,omitempty"`
	DataType string `json:"dataType,omitempty"`
	Time     string `json:"time,omitempty"`
	Unit     string `json:"unit,omitempty"`
	Name     string `json:"name,omitempty"`
}

type PropertySet

type PropertySet struct {
	Version string                 `json:"version"`
	MsgId   string                 `json:"msgId"`
	Time    int64                  `json:"time"`
	Params  map[string]interface{} `json:"data"`
}

func (*PropertySet) ToString

func (r *PropertySet) ToString() string

type QuickNavigation

type QuickNavigation struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	Icon string `json:"icon"`
}

type QuickNavigationSearchQueryRequest

type QuickNavigationSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
}

type RPCConfig

type RPCConfig struct {
	Address  string
	UseTLS   bool
	CertFile string
	KeyFile  string
}

RPCConfig internal grpc server common

type ReportAlertRequest

type ReportAlertRequest struct {
	ServiceName string `json:"serviceName"`
	AlertType   int    `json:"alertType"`  // constants.AlertType_SERVICE
	AlertLevel  int    `json:"alertLevel"` // constants.AlertLevel_ERROR
	AlertTime   int64  `json:"alertTime"`
	Content     string `json:"content"`
}

type ReportAlertsReq

type ReportAlertsReq struct {
	BaseRequest `json:",inline"`
	ServiceName string            `json:"name"`                        // 服务名
	Type        models.AlertType  `json:"type" binding:"oneof=1 2"`    // 告警类型
	Level       models.AlertLevel `json:"level" binding:"oneof=1 2 3"` // 告警级别
	T           int64             `json:"time"`                        // 告警时间
	Content     string            `json:"content"`
}

AlertContent 服务和驱动上报告警消息

func GenServerAlert

func GenServerAlert(lvl models.AlertLevel, err error) ReportAlertsReq

GenServerAlert 生成服务警告内容

func NewReportAlertsReq

func NewReportAlertsReq(serviceName string, tp models.AlertType, l models.AlertLevel, t int64, content string) ReportAlertsReq

type ReportData

type ReportData struct {
	Value interface{} `json:"value"`
	Time  int64       `json:"time"`
}

func (*ReportData) Marshal

func (r *ReportData) Marshal() ([]byte, error)

type ReqPageInfo

type ReqPageInfo struct {
	Page     int `json:"page" form:"page"`
	PageSize int `json:"page_size" form:"page_size"`
}

type ResPageResult

type ResPageResult struct {
	List     interface{} `json:"list"`
	Total    uint32      `json:"total"`
	Page     int         `json:"page"`
	PageSize int         `json:"pageSize"`
}

func NewPageResult

func NewPageResult(responses interface{}, total uint32, page int, pageSize int) ResPageResult

type Rest

type Rest struct {
	Method       string `json:"method,omitempty"`
	Url          string `json:"url,omitempty"`
	BodyType     string `json:"bodyType,omitempty"`
	Timeout      int    `json:"timeout,omitempty"`
	RunAsync     bool   `json:"runAsync,omitempty"`
	OmitIfEmpty  bool   `json:"omitIfEmpty,omitempty"`
	SendSingle   bool   `json:"sendSingle,omitempty"`
	BufferLength int    `json:"bufferLength,omitempty"`
	EnableCache  bool   `json:"enableCache,omitempty"`
	Format       string `json:"format,omitempty"`
}

type RpcData

type RpcData struct {
	Code    WsCode
	ReqId   string
	ErrCode uint32
	Data    interface{}
}

func (*RpcData) String

func (rd *RpcData) String() string

type RuleAddRequest

type RuleAddRequest struct {
	Name        string               `json:"name"`        //名字
	AlertType   constants.AlertType  `json:"alert_type"`  //告警类型
	AlertLevel  constants.AlertLevel `json:"alert_level"` //告警级别
	Description string               `json:"description"` //描述
}

type RuleEngineFieldUpdateRequest

type RuleEngineFieldUpdateRequest struct {
	Id   string `json:"id"`
	Name string `json:"name"`
	//AlertLevel  constants.AlertLevel `json:"alert_level"`
	Description string `json:"description"`
}

type RuleEngineRequest

type RuleEngineRequest struct {
	Name           string `json:"name"`        //名字
	Description    string `json:"description"` //描述
	Filter         Filter `json:"filter"`
	DataResourceId string `json:"data_resource_id"`
}

func (RuleEngineRequest) BuildEkuiperSql

func (r RuleEngineRequest) BuildEkuiperSql() string

type RuleEngineResponse

type RuleEngineResponse struct {
	Id             string           `json:"id"`
	Name           string           `json:"name"`
	Description    string           `json:"description"`
	Filter         Filter           `json:"filter"`
	Created        int64            `json:"created"`
	DataResourceId string           `json:"data_resource_id"`
	DataResource   DataResourceInfo `json:"dataResource"`
	Modified       int64            `json:"modified"`
}

type RuleEngineSearchQueryRequest

type RuleEngineSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `schema:"name,omitempty"`
	Status                   string `schema:"status,omitempty"`
}

type RuleEngineSearchQueryResponse

type RuleEngineSearchQueryResponse struct {
	Id           string           `json:"id"`
	Name         string           `json:"name"`
	Description  string           `json:"description"`
	Created      int64            `json:"created"`
	Status       string           `json:"status"`
	ResourceType string           `json:"resource_type"`
	DataResource DataResourceInfo `json:"dataResource"`
}

func RuleEngineSearchQueryResponseFromModel

func RuleEngineSearchQueryResponseFromModel(p models.RuleEngine) RuleEngineSearchQueryResponse

type RuleEngineUpdateRequest

type RuleEngineUpdateRequest struct {
	Id             string  `json:"id"`
	Name           *string `json:"name"`        //名字
	Description    *string `json:"description"` //描述
	Filter         *Filter `json:"filter"`
	DataResourceId *string `json:"data_resource_id"`
}

func (RuleEngineUpdateRequest) BuildEkuiperSql

func (r RuleEngineUpdateRequest) BuildEkuiperSql() string

type RuleFieldUpdate

type RuleFieldUpdate struct {
	Id          string               `json:"id"`
	Name        string               `json:"name"`
	AlertLevel  constants.AlertLevel `json:"alert_level"`
	Description string               `json:"description"`
}

type RuleResponse

type RuleResponse struct {
	Id          string                    `json:"id"`
	Name        string                    `json:"name"`
	AlertType   constants.AlertType       `json:"alert_type"`
	AlertLevel  constants.AlertLevel      `json:"alert_level"`
	Status      constants.RuleStatus      `json:"status"`
	Condition   constants.WorkerCondition `json:"condition"`
	SubRule     RuleSubRules              `json:"sub_rule"`
	Notify      models.Notify             `json:"notify"`
	SilenceTime int64                     `json:"silence_time"`
	Description string                    `json:"description"`
	Created     int64                     `json:"created"`
	Modified    int64                     `json:"modified"`
}

type RuleSubRule

type RuleSubRule struct {
	Trigger     constants.Trigger `json:"trigger"` //触发方式
	ProductId   string            `json:"product_id"`
	ProductName string            `json:"product_name"`
	DeviceId    string            `json:"device_id"`
	DeviceName  string            `json:"device_name"`
	Code        string            `json:"code"`
	Condition   string            `json:"condition"`
	Option      map[string]string `json:"option"`
}

type RuleSubRules

type RuleSubRules []RuleSubRule

type RuleUpdateRequest

type RuleUpdateRequest struct {
	Id          string                    `json:"id"`
	Condition   constants.WorkerCondition `json:"condition"` //执行条件
	SubRule     []SubRule                 `json:"sub_rule"`
	Notify      []Notify                  `json:"notify"`
	SilenceTime int64                     `json:"silence_time"` //静默时间
}

func (*RuleUpdateRequest) BuildEkuiperSql

func (b *RuleUpdateRequest) BuildEkuiperSql(deviceId string, specsType constants.SpecsType) string

type RunServiceCfg

type RunServiceCfg struct {
	ImageRepo          string
	RunConfig          string
	DockerMountDevices []string
	DockerParams       string
	DriverName         string // 驱动名
}

启动实例时对应的配置

type SaveServiceIssueData

type SaveServiceIssueData struct {
	MsgId        string                 `json:"msgId"`
	Code         string                 `json:"code"`
	Time         int64                  `json:"time"`
	InputParams  map[string]interface{} `json:"inputParams"`
	OutputParams map[string]interface{} `json:"outputParams"`
}

func (*SaveServiceIssueData) Marshal

func (r *SaveServiceIssueData) Marshal() ([]byte, error)

type SceneAddRequest

type SceneAddRequest struct {
	Name        string `json:"name"`        //名字
	Description string `json:"description"` //描述
}

type SceneLogSearchQueryRequest

type SceneLogSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	//Name                     string `schema:"name,omitempty"`
	StartAt int64  `schema:"start_time"`
	EndAt   int64  `schema:"end_time"`
	SceneId string `json:"scene_id"`
}

type SceneSearchQueryRequest

type SceneSearchQueryRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	Name                     string `json:"name"`
	Status                   string `json:"status"`
}

type SceneUpdateRequest

type SceneUpdateRequest struct {
	Id string `json:"id"`
	//Condition  constants.WorkerCondition `json:"condition"` //执行条件
	Conditions []Condition `json:"conditions"`
	Actions    []Action    `json:"actions"`
}

type ServiceData

type ServiceData struct {
	Code        string                 `json:"code"`
	InputParams map[string]interface{} `json:"inputParams"`
}

func (*ServiceData) Marshal

func (r *ServiceData) Marshal() ([]byte, error)

type ServiceExecResponse

type ServiceExecResponse struct {
	MsgId        string                 `json:"msgId"`
	Code         string                 `json:"code"`
	Time         int64                  `json:"time"`
	OutputParams map[string]interface{} `json:"data"`
}

func (*ServiceExecResponse) Marshal

func (r *ServiceExecResponse) Marshal() ([]byte, error)

type ServiceInfo

type ServiceInfo struct {
	// ID 驱动实例化后生成的唯一ID,驱动管理服务自动生成。
	// 驱动实例启动后会通过该ID去元数据服务同步设备和更新驱动配置。
	ID     string
	Name   string
	Server RPCConfig
	// ProductList 驱动对应的产品ID列表
	//ProductList []string
	//GwId        string
	//LocalKey    string
	// 跳过激活检查
	Activated bool
}

type ServiceStats

type ServiceStats struct {
	Id          string `json:"id" binding:"required"` //
	Name        string `json:"name" binding:"required"`
	Healthy     bool   `json:"healthy"` // 健康状态
	Created     string `json:"created"`
	LogPath     string `json:"log_path"` // 日志地址, 宿主主机日志路径
	Started     string `json:"started"`  // 服务最近启动时间
	ServiceType string `json:"service_type" binding:"required"`
}

func FromModelsServiceStatsToDTO

func FromModelsServiceStatsToDTO(s models.ServiceStats) ServiceStats

type ServicesStats

type ServicesStats []ServiceStats

swagger:response ServicesStats

func (ServicesStats) Len

func (s ServicesStats) Len() int

func (ServicesStats) Less

func (s ServicesStats) Less(i, j int) bool

func (ServicesStats) Swap

func (s ServicesStats) Swap(i, j int)

type StatsResp

type StatsResp struct {
	MemoryStats MemoryStats `json:"memory_stats"`
	CpuStats    CpuStats    `json:"cpu_stats"`
	PrecpuStats CpuStats    `json:"precpu_stats"`
}

func (StatsResp) CpuDelta

func (s StatsResp) CpuDelta() float64

func (StatsResp) CpuUsage

func (s StatsResp) CpuUsage() float64

CpuUsage %

func (StatsResp) MemoryUsage

func (s StatsResp) MemoryUsage() float64

MemoryUsage %

func (StatsResp) SystemCpuDelta

func (s StatsResp) SystemCpuDelta() float64

func (StatsResp) UsedMemory

func (s StatsResp) UsedMemory() int64

type SubRule

type SubRule struct {
	Trigger   constants.Trigger `json:"trigger"`
	ProductId string            `json:"product_id"`
	DeviceId  string            `json:"device_id"`
	Option    map[string]string `json:"option"`
}

type SystemDisk

type SystemDisk struct {
	Path        string  `json:"path"`         // 获取 / 目录信息
	Total       uint64  `json:"total"`        // 大小  bytes
	Used        uint64  `json:"used"`         // 使用值
	UsedPercent float64 `json:"used_percent"` // 使用百分比
}

type SystemMemory

type SystemMemory struct {
	Total       uint64  `json:"total"`        // 大小
	Used        uint64  `json:"used"`         // 使用大小 bytes
	UsedPercent float64 `json:"used_percent"` // 百分比
}

type SystemMetrics

type SystemMetrics struct {
	Timestamp      int64                    `json:"timestamp"`        // 时间戳
	CpuUsedPercent float64                  `json:"cpu_used_percent"` // cpu 使用率百分比
	CpuAvg         float64                  `json:"cpu_avg"`          // cpu 负载,1分钟
	Memory         SystemMemory             `json:"memory"`           // 内存
	Disk           SystemDisk               `json:"disk"`             // 磁盘使用率
	Network        map[string]SystemNetwork `json:"network"`          // 网卡en/eth的IO
	Openfiles      int                      `json:"openfiles"`        // 文件数,linux 才有
}

func FromModelsSystemMetricsToDTO

func FromModelsSystemMetricsToDTO(m models.SystemMetrics) (SystemMetrics, error)

func (SystemMetrics) String

func (s SystemMetrics) String() string

type SystemMetricsQuery

type SystemMetricsQuery struct {
	Iface       string `form:"iface"`
	MetricsType string `form:"metrics_type" binding:"oneof=hour halfday day"`
}

type SystemMetricsResponse

type SystemMetricsResponse struct {
	Total   int                  `json:"total"`
	Metrics []SystemStatResponse `json:"metrics"`
}

type SystemNetwork

type SystemNetwork struct {
	Name         string `json:"name"`
	BytesSent    uint64 `json:"bytes_sent"`     // 总发送字节
	BytesRecv    uint64 `json:"bytes_recv"`     // 总接收字节
	BytesSentPre uint64 `json:"bytes_sent_pre"` // 单位时间内发送的字节,1分钟
	BytesRecvPre uint64 `json:"bytes_recv_pre"` // 单位时间内接收的字节,1分钟
	Last         int64  `json:"-"`              // 采集时记录,不做输出
}

func (SystemNetwork) String

func (s SystemNetwork) String() string

type SystemStatResponse

type SystemStatResponse struct {
	Timestamp         int64   `json:"timestamp"`           // 时间戳
	CpuUsedPercent    float64 `json:"cpu_used_percent"`    // cpu 使用率百分比
	MemoryTotal       uint64  `json:"memory_total"`        // 内存使用
	MemoryUsed        uint64  `json:"memory_used"`         // 内存使用
	MemoryUsedPercent float64 `json:"memory_used_percent"` // 内存使用率
	DiskTotal         uint64  `json:"disk_total"`
	DiskUsed          uint64  `json:"disk_used"`
	DiskUsedPercent   float64 `json:"disk_used_percent"` // 磁盘使用率
	NetSentBytes      uint64  `json:"net_sent_bytes"`    // 网卡发送字节
	NetRecvBytes      uint64  `json:"net_recv_bytes"`    // 网卡接收字节
	Openfiles         int     `json:"openfiles"`         // 文件句柄数,linux 才有
}

type SystemThingModelSearchReq

type SystemThingModelSearchReq struct {
	ModelName      string `schema:"modelName"`
	ThingModelType string `schema:"thingModelType"`
}

type TerminalParams

type TerminalParams struct {
	Cmd            string   `json:"cmd" binding:"required"`
	Args           []string `json:"args" binding:"required"`
	TimeoutSeconds int      `json:"timeout_seconds" binding:"min=1,max=60"`
}

type ThingModelActions

type ThingModelActions struct {
	CallType    constants.CallType      `json:"call_type"`
	InPutParam  []ThingModelEventAction `json:"input_param"`
	OutPutParam []ThingModelEventAction `json:"output_param"`
}

type ThingModelAddOrUpdateReq

type ThingModelAddOrUpdateReq struct {
	Id             string `json:"id"`
	ProductId      string `json:"product_id"`
	ThingModelType string `json:"thing_model_type"`
	//ModelName      string                `json:"model_name"`
	Name        string                `json:"name"`
	Code        string                `json:"code"`
	Description string                `json:"description"`
	Tag         string                `json:"tag"`
	Property    *ThingModelProperties `json:"property"`
	Event       *ThingModelEvents     `json:"event"`
	Action      *ThingModelActions    `json:"action"`
}

type ThingModelDataBaseRequest

type ThingModelDataBaseRequest struct {
	First bool `json:"first"`
	Last  bool `json:"last"`
	//Page     int     `json:"page"`
	//PageSize int     `json:"pageSize"`
	Range []int64 `json:"range"`
}

type ThingModelDataResponse

type ThingModelDataResponse struct {
	ReportData
	Code       string `json:"code"`
	DataType   string `json:"data_type"`
	Unit       string `json:"unit"`
	Name       string `json:"name"`
	AccessMode string `json:"access_mode"`
}

type ThingModelDeleteReq

type ThingModelDeleteReq struct {
	ThingModelId   string `json:"thing_model_id"`
	ThingModelType string `json:"thing_model_type"`
}

type ThingModelEventAction

type ThingModelEventAction struct {
	Code     string              `json:"code"`
	Name     string              `json:"name"`
	DataType constants.SpecsType `json:"type"`
	TypeSpec interface{}         `json:"specs"`
}

type ThingModelEventDataRequest

type ThingModelEventDataRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ThingModelDataBaseRequest
	DeviceId  string ` json:"deviceId"`
	EventCode string `json:"eventCode"`
	EventType string `json:"eventType"`
}

type ThingModelEventDataResponse

type ThingModelEventDataResponse struct {
	EventCode  string                 `json:"event_code"`
	EventType  string                 `json:"event_type"`
	OutputData map[string]interface{} `json:"output_data"`
	ReportTime int64                  `json:"report_time"`
	Name       string                 `json:"name"`
}

type ThingModelEventDataResponseArray

type ThingModelEventDataResponseArray []ThingModelEventDataResponse

func (ThingModelEventDataResponseArray) Len

func (ThingModelEventDataResponseArray) Less

func (array ThingModelEventDataResponseArray) Less(i, j int) bool

func (ThingModelEventDataResponseArray) Swap

func (array ThingModelEventDataResponseArray) Swap(i, j int)

type ThingModelEvents

type ThingModelEvents struct {
	EventType   string                  `json:"event_type"`
	OutPutParam []ThingModelEventAction `json:"output_param"`
}

type ThingModelMessage

type ThingModelMessage struct {
	BaseRequest *drivercommon.BaseRequestMessage
	Cid         string `json:"cid"`     // 下发的目标设备id
	OpType      int32  `json:"op_type"` // 消息类型
	Data        string `json:"data"`    // 云端下发消息内容
}

func ThingModelMessageFromThingModelMsg

func ThingModelMessageFromThingModelMsg(msg *thingmodel.ThingModelMsg) ThingModelMessage

func (*ThingModelMessage) GetOpType

func (*ThingModelMessage) IsPersistent

func (m *ThingModelMessage) IsPersistent() bool

func (*ThingModelMessage) String

func (m *ThingModelMessage) String() string

func (*ThingModelMessage) TransformMessageBus

func (m *ThingModelMessage) TransformMessageBus() []byte

func (*ThingModelMessage) TransformMessageDataByBatchReport

func (m *ThingModelMessage) TransformMessageDataByBatchReport() (DeviceBatchReport, error)

func (*ThingModelMessage) TransformMessageDataByEvent

func (m *ThingModelMessage) TransformMessageDataByEvent() (EdgeXDeviceEventReport, error)

func (*ThingModelMessage) TransformMessageDataByGetProperty

func (m *ThingModelMessage) TransformMessageDataByGetProperty() (DeviceGetPropertyResponse, error)

func (*ThingModelMessage) TransformMessageDataByProperty

func (m *ThingModelMessage) TransformMessageDataByProperty() (DevicePropertyReport, error)

func (*ThingModelMessage) TransformMessageDataByService

func (m *ThingModelMessage) TransformMessageDataByService() (SaveServiceIssueData, error)

func (*ThingModelMessage) TransformMessageDataByServiceExec

func (m *ThingModelMessage) TransformMessageDataByServiceExec() (ServiceExecResponse, error)

func (*ThingModelMessage) TransformMessageDataBySetProperty

func (m *ThingModelMessage) TransformMessageDataBySetProperty() (DevicePropertySetResponse, error)

type ThingModelProperties

type ThingModelProperties struct {
	AccessModel string              `json:"access_model"`
	Require     bool                `json:"require"`
	DataType    constants.SpecsType `json:"type"`
	TypeSpec    interface{}         `json:"specs"`
}

type ThingModelPropertyDataRequest

type ThingModelPropertyDataRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ThingModelDataBaseRequest
	DeviceId string ` json:"deviceId"`
	Code     string `json:"code"`
}

type ThingModelPropertyDataResponse

type ThingModelPropertyDataResponse struct {
	ReportData interface{} `json:"report_data"`
	Code       string      `json:"code"`
	DataType   string      `json:"data_type"`
	Unit       string      `json:"unit"`
	Name       string      `json:"name"`
	AccessMode string      `json:"access_mode"`
}

type ThingModelServiceDataRequest

type ThingModelServiceDataRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	ThingModelDataBaseRequest
	DeviceId string ` json:"deviceId"`
	Code     string `json:"code"`
}

type ThingModelServiceDataResponse

type ThingModelServiceDataResponse struct {
	ReportTime  int64                  `json:"report_time"`
	Code        string                 `json:"code"`
	ServiceName string                 `json:"service_name"`
	InputData   map[string]interface{} `json:"input_data"`
	OutputData  map[string]interface{} `json:"output_data"`
}

type ThingModelServiceDataResponseArray

type ThingModelServiceDataResponseArray []ThingModelServiceDataResponse

func (ThingModelServiceDataResponseArray) Len

func (ThingModelServiceDataResponseArray) Less

func (array ThingModelServiceDataResponseArray) Less(i, j int) bool

func (ThingModelServiceDataResponseArray) Swap

func (array ThingModelServiceDataResponseArray) Swap(i, j int)

type ThingModelTemplate

type ThingModelTemplate struct {
	Properties []ThingModelTemplateProperties `json:"properties"`
	Events     []ThingModelTemplateEvents     `json:"events"`
	Services   []ThingModelTemplateServices   `json:"services"`
}

type ThingModelTemplateArray

type ThingModelTemplateArray struct {
	ChildDataType string `json:"childDataType"`
	Size          int    `json:"size"`
}

------------------------------------------------------------ array { "childDataType":"TEXT", "customFlag":true, "dataType":"ARRAY", "size":128 }

type ThingModelTemplateBool

type ThingModelTemplateBool struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

------------------------------------------------------------ [ { "dataType":"BOOL", "name":"未查询", "value":0 }, { "dataType":"BOOL", "name":"查询", "value":1 } ]

type ThingModelTemplateDate

type ThingModelTemplateDate struct {
	Length string `json:"length"`
}

------------------------------------------------------------ { "dataType":"Date", "length":255 }

type ThingModelTemplateEnum

type ThingModelTemplateEnum struct {
	Name  string `json:"name"`
	Value int    `json:"value"`
}

------------------------------------------------------------ [ { "dataType":"ENUM", "name":"电源", "value":0 }, { "dataType":"ENUM", "name":"电池", "value":1 } ]

type ThingModelTemplateEvents

type ThingModelTemplateEvents struct {
	EventName   string                               `json:"eventName"`
	EventType   string                               `json:"eventType"`
	Identifier  string                               `json:"identifier"`
	Description string                               `json:"description"`
	Required    bool                                 `json:"required"`
	OutputData  []ThingModelTemplateEventsOutputData `json:"outputData"`
}

func (*ThingModelTemplateEvents) TransformModelOutputParams

func (t *ThingModelTemplateEvents) TransformModelOutputParams() (outPutParams models.OutPutParams)

type ThingModelTemplateEventsOutputData

type ThingModelTemplateEventsOutputData struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	Required      bool        `json:"required"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

type ThingModelTemplateIntOrFloat

type ThingModelTemplateIntOrFloat struct {
	Max      string `json:"max"`
	Min      string `json:"min"`
	Step     string `json:"step"`
	Unit     string `json:"unit"`
	UnitName string `json:"unitName"`
}

------------------------------------------------------------

{
   "dataType":"DOUBLE",
   "max":"23",
   "min":"16",
   "precise":7,
   "step":"0.01",
   "unit":"°C",
   "unitName":"摄氏度"
}

type ThingModelTemplateProperties

type ThingModelTemplateProperties struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	Description   string      `json:"description"`
	Required      bool        `json:"required"`
	RwFlag        string      `json:"rwFlag"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

func (*ThingModelTemplateProperties) TransformModelTypeSpec

func (t *ThingModelTemplateProperties) TransformModelTypeSpec() (typeSpec models.TypeSpec)

type ThingModelTemplateRequest

type ThingModelTemplateRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	CategoryKey              string `schema:"category_key"`
	CategoryName             string `schema:"category_name"`
}

type ThingModelTemplateResponse

type ThingModelTemplateResponse struct {
	Id             string `json:"id"`
	CategoryName   string `json:"category_name"` //品类名称
	CategoryKey    string `json:"category_key"`
	ThingModelJSON string `json:"thing_model_json"`
	//models.Properties
	Properties interface{} `json:"properties"`
	Events     interface{} `json:"events"`
	Actions    interface{} `json:"actions"`
}

type ThingModelTemplateServices

type ThingModelTemplateServices struct {
	ServiceName string                                 `json:"serviceName"`
	Identifier  string                                 `json:"identifier"`
	Description string                                 `json:"description"`
	Required    bool                                   `json:"required"`
	CallType    constants.CallType                     `json:"callType"`
	InputParams []ThingModelTemplateServicesInputParam `json:"inputParams"`
	OutParams   []ThingModelTemplateServicesOutParam   `json:"outParams"`
}

ASYNC SYNC

func (*ThingModelTemplateServices) TransformModelInPutParams

func (t *ThingModelTemplateServices) TransformModelInPutParams() (inPutParams models.InPutParams)

func (*ThingModelTemplateServices) TransformModelOutPutParams

func (t *ThingModelTemplateServices) TransformModelOutPutParams() (outPutParams models.OutPutParams)

type ThingModelTemplateServicesInputParam

type ThingModelTemplateServicesInputParam struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

type ThingModelTemplateServicesOutParam

type ThingModelTemplateServicesOutParam struct {
	Name          string      `json:"name"`
	Identifier    string      `json:"identifier"`
	DataType      string      `json:"dataType"`
	DataSpecs     interface{} `json:"dataSpecs"`
	DataSpecsList interface{} `json:"dataSpecsList"`
}

type ThingModelTemplateStruct

type ThingModelTemplateStruct struct {
	ChildDataType string      `json:"childDataType"`
	ChildName     string      `json:"childName"`
	Identifier    string      `json:"identifier"`
	ChildSpecsDTO interface{} `json:"childSpecsDTO"`
}

type ThingModelTemplateSyncRequest

type ThingModelTemplateSyncRequest struct {
	VersionName string `json:"version_name"`
}

type ThingModelTemplateText

type ThingModelTemplateText struct {
	Length int `json:"length"`
}

------------------------------------------------------------ { "dataType":"TEXT", "length":255 }

type TokenDetail

type TokenDetail struct {
	AccessId     string `json:"access_id"`
	RefreshId    string `json:"refresh_id"`
	AccessToken  string `json:"access_token"`
	RefreshToken string `json:"refresh_token"`
	AtExpires    int64  `json:"at_expires"`
	RtExpires    int64  `json:"rt_expires"`
}

type UnitRequest

type UnitRequest struct {
	BaseSearchConditionQuery `schema:",inline"`
	UnitName                 string `schema:"unitName" json:"unitName"`
}

type UnitResponse

type UnitResponse struct {
	Id       string `json:"id"`
	Symbol   string `json:"symbol"`
	UnitName string `json:"unit_name"`
}

func UnitTemplateResponseFromModel

func UnitTemplateResponseFromModel(unitModel models.Unit) UnitResponse

type UnitTemplateSyncRequest

type UnitTemplateSyncRequest struct {
	VersionName string `json:"version_name"`
}

type UpdateDataResource

type UpdateDataResource struct {
	Id     string                  `json:"id"`
	Name   *string                 `json:"name"`
	Type   *string                 `json:"type"`
	Option *map[string]interface{} `json:"option"`
}

type UpdateDeviceLibrary

type UpdateDeviceLibrary struct {
	Id             string  `json:"id" binding:"required"`
	Name           *string `json:"name"`
	Description    *string `json:"description"`
	DockerConfigId *string `json:"docker_config_id"`
	Protocol       *string `json:"protocol"`
	Language       *string `json:"language"`
	Manual         *string `json:"manual"`
	Icon           *string `json:"icon"`
}

type UpdateDeviceServiceRunStatusRequest

type UpdateDeviceServiceRunStatusRequest struct {
	Id        string `json:"id"`
	RunStatus int    `json:"run_status"  binding:"required,oneof=1 2"`
}

type UpdateDeviceServiceRunStatusResponse

type UpdateDeviceServiceRunStatusResponse struct {
	Id        string `json:"id"`
	RunStatus int    `json:"run_status"`
}

type UpdateLangRequest

type UpdateLangRequest struct {
	Lang string `json:"lang" binding:"required"`
}

type UpdatePasswordRequest

type UpdatePasswordRequest struct {
	CurrentPassword string `json:"currentPassword" binding:"required"`
	NewPassword     string `json:"newPassword" binding:"required"`
}

type UpdateServiceLogLevelConfigRequest

type UpdateServiceLogLevelConfigRequest struct {
	Id       string `json:"id"` // 驱动或应用ID
	LogLevel int64  `json:"logLevel"`
}

type UserResponse

type UserResponse struct {
	Username string `json:"username"`
	Lang     string `json:"lang"`
}

type Versionable

type Versionable struct {
	ApiVersion string `json:"apiVersion"`
}

Versionable shows the API version in DTOs

func NewVersionable

func NewVersionable() Versionable

type WsCode

type WsCode uint32
const (
	WsCodeDeviceLibraryUpgrade   WsCode = 10001 // 驱动下载/升级
	WsCodeDeviceServiceRunStatus WsCode = 10002 // 驱动重启
	WsCodeDeviceLibraryDelete    WsCode = 10003 // 驱动删除
	WsCodeDeviceServiceLog       WsCode = 10004 // 驱动日志

	WsCodeCloudServiceDownload  WsCode = 20001 // 云服务下载
	WsCodeCloudServiceRunStatus WsCode = 20002 // 云服务重启/停止
	WsCodeCloudServiceRunDelete WsCode = 20003 // 云服务删除
	WsCodeCloudServiceRunLog    WsCode = 20004 // 云服务日志

	WsCodeCheckLang WsCode = 30001 // 切换语言

	// 云端网络情况
	WsCodeCloudState WsCode = 10007 // 云端网络情况
	//OTA
	WsCodeOTAUpgradeProgress WsCode = 10100 // OTA升级进度
	WsCodeOTAFirmwareUpgrade WsCode = 10101 // OTA升级
	// 严重警告
	WsCodeSeriousAlert WsCode = 10200
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL