Documentation ¶
Overview ¶
Package device 设备,包括SA状态
Index ¶
- Constants
- func AddDevice(c *gin.Context)
- func BuildInfoDevice(device entity.Device, user *session.User, req *http.Request) (iDevice infoDevice, err error)
- func CheckSaDevice(c *gin.Context)
- func DelDevice(c *gin.Context)
- func InfoDevice(c *gin.Context)
- func IsAccessAllow(c *gin.Context)
- func ListAllDevice(c *gin.Context)
- func ListLocationDevices(c *gin.Context)
- func MajorTypeList(c *gin.Context)
- func MinorTypeList(c *gin.Context)
- func RegisterDeviceRouter(r gin.IRouter)
- func UpdateDevice(c *gin.Context)
- type CheckSaDeviceResp
- type Device
- type IsAccessAllowResp
- type MajorResp
- type MinorReq
- type MinorResp
- type MinorType
- type MinorTypes
- type ModelDevice
- type Permissions
- type Type
- type Types
- type UpdateDeviceReq
Constants ¶
View Source
const ( AllDevice listType = iota // 所有设备 ControlDevice // 有可以控制权限的设备(场景的执行任务页面使用) ControlAndReadDevice // 有可以控制和读的设备(场景的触发条件页面使用) )
0:所有设备;1:有控制权限的设备
Variables ¶
This section is empty.
Functions ¶
func BuildInfoDevice ¶
func ListLocationDevices ¶
ListLocationDevices 用于处理房间设备列表接口的请求
func MinorTypeList ¶ added in v1.9.1
MinorTypeList 根据主分类获取次级分类和设备类型
func RegisterDeviceRouter ¶
RegisterDeviceRouter 注册与设备相关的路由及其处理函数
Types ¶
type CheckSaDeviceResp ¶
type CheckSaDeviceResp struct { IsBind bool `json:"is_bind"` Revision string `json:"revision"` Version string `json:"version"` }
CheckSaDeviceResp 检查SA设备绑定情况接口请求参数
type Device ¶
type Device struct { ID int `json:"id"` Identity string `json:"identity"` Name string `json:"name"` Logo string `json:"logo"` // logo相对路径 LogoURL string `json:"logo_url"` PluginID string `json:"plugin_id"` LocationID int `json:"location_id,omitempty"` LocationName string `json:"location_name,omitempty"` IsSA bool `json:"is_sa"` Control string `json:"control"` // 控制页相对路径 PluginURL string `json:"plugin_url"` Type string `json:"type"` DepartmentID int `json:"department_id,omitempty"` DepartmentName string `json:"department_name,omitempty"` DeviceInstances plugin.DeviceInstances `json:"device_instances"` }
Device 设备信息
type IsAccessAllowResp ¶
type IsAccessAllowResp struct {
AccessAllow bool `json:"access_allow"` // 是否允许访问(判断用户token是否在该SA中有效)
}
type MinorReq ¶ added in v1.9.1
type MinorReq struct {
Type plugin.DeviceType `form:"type"`
}
type MinorResp ¶ added in v1.9.1
type MinorResp struct {
Types MinorTypes `json:"types"`
}
type MinorType ¶ added in v1.9.1
type MinorType struct { Type Devices []ModelDevice `json:"devices"` }
type MinorTypes ¶ added in v1.9.1
type MinorTypes []MinorType
func (MinorTypes) Len ¶ added in v1.9.1
func (t MinorTypes) Len() int
func (MinorTypes) Less ¶ added in v1.9.1
func (t MinorTypes) Less(i, j int) bool
func (MinorTypes) Swap ¶ added in v1.9.1
func (t MinorTypes) Swap(i, j int)
type ModelDevice ¶
type Permissions ¶
type Permissions struct { UpdateDevice bool `json:"update_device"` DeleteDevice bool `json:"delete_device"` }
Permissions 设备权限
type Type ¶
type Type struct { Name string `json:"name"` Type plugin.DeviceType `json:"type"` }
Click to show internal directories.
Click to hide internal directories.