IOTSensor

package
v5.1.39 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2024 License: Apache-2.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	//OpenSub 是否启动订阅
	OpenSub = false
)

Functions

func Create

func Create(args *ArgsCreate) (err error)

Create 添加数据

func DeleteClear

func DeleteClear(args *ArgsDeleteClear) (err error)

DeleteClear 清理指定数据

func Init

func Init()

func Run

func Run()

Types

type ArgsCreate

type ArgsCreate struct {
	//创建时间
	// 如果给空,则以当前时间为主
	// IOS时间
	CreateAt string `db:"create_at" json:"createAt"`
	//设备ID
	DeviceID int64 `db:"device_id" json:"deviceID" check:"id"`
	//数据标识码
	Mark string `db:"mark" json:"mark" check:"mark"`
	//数据
	Data  int64   `db:"data" json:"data"`
	DataF float64 `db:"data_f" json:"dataF"`
	DataS string  `db:"data_s" json:"dataS"`
}

ArgsCreate 添加数据参数

type ArgsDeleteClear

type ArgsDeleteClear struct {
	//设备ID
	DeviceID int64 `db:"device_id" json:"deviceID" check:"id" empty:"true"`
	//数据标识码
	Mark string `db:"mark" json:"mark" check:"mark" empty:"true"`
	//是否为历史数据
	IsHistory bool `json:"isHistory" check:"bool"`
}

ArgsDeleteClear 清理指定数据参数 注意,如果全部留空将失败

type ArgsGetAnalysis

type ArgsGetAnalysis struct {
	//查询时间范围
	TimeBetween CoreSQLTime.FieldsCoreTime `json:"timeBetween"`
	//结构方式
	// year / month / day / hour
	TimeType string `json:"timeType" check:"mark"`
	//设备ID
	DeviceID int64 `db:"device_id" json:"deviceID" check:"id"`
	//数据标识码
	Mark string `db:"mark" json:"mark" check:"mark"`
	//是否为历史数据
	IsHistory bool `json:"isHistory" check:"bool"`
}

ArgsGetAnalysis 获取统计数据结构参数

type ArgsGetList

type ArgsGetList struct {
	//分页
	Pages CoreSQLPages.ArgsDataList `json:"pages"`
	//设备ID
	DeviceID int64 `db:"device_id" json:"deviceID" check:"id" empty:"true"`
	//数据标识码
	Mark string `db:"mark" json:"mark" check:"mark" empty:"true"`
	//是否为历史数据
	IsHistory bool `json:"isHistory" check:"bool"`
}

ArgsGetList 获取列表参数

type ArgsGetListTime

type ArgsGetListTime struct {
	//时间范围
	TimeBetween CoreSQLTime.FieldsCoreTime `json:"timeBetween"`
	//设备ID
	DeviceID int64 `db:"device_id" json:"deviceID" check:"id" empty:"true"`
	//数据标识码
	Mark string `db:"mark" json:"mark" check:"mark" empty:"true"`
}

ArgsGetListTime 获取时间之间的数据集合参数

type DataGetAnalysis

type DataGetAnalysis struct {
	//时间
	DayTime string `db:"d" json:"dayTime"`
	//数据
	Data  int64   `db:"data" json:"data"`
	DataF float64 `db:"data_f" json:"dataF"`
}

func GetAnalysis

func GetAnalysis(args *ArgsGetAnalysis) (dataList []DataGetAnalysis, err error)

GetAnalysis 获取统计数据结构

func GetAnalysisAvg

func GetAnalysisAvg(args *ArgsGetAnalysis) (dataList []DataGetAnalysis, err error)

GetAnalysisAvg 获取统计数据结构平均值 只支持float计算

func GetAnalysisMax

func GetAnalysisMax(args *ArgsGetAnalysis) (dataList []DataGetAnalysis, err error)

func GetAnalysisMin

func GetAnalysisMin(args *ArgsGetAnalysis) (dataList []DataGetAnalysis, err error)

type FieldsSensor

type FieldsSensor struct {
	//ID
	ID int64 `db:"id" json:"id"`
	//创建时间
	CreateAt time.Time `db:"create_at" json:"createAt"`
	//设备ID
	DeviceID int64 `db:"device_id" json:"deviceID"`
	//数据标识码
	Mark string `db:"mark" json:"mark"`
	//数据
	Data  int64   `db:"data" json:"data"`
	DataF float64 `db:"data_f" json:"dataF"`
	DataS string  `db:"data_s" json:"dataS"`
}

func GetList

func GetList(args *ArgsGetList) (dataList []FieldsSensor, dataCount int64, err error)

GetList 获取列表

func GetListTime

func GetListTime(args *ArgsGetListTime) (dataList []FieldsSensor, err error)

GetListTime 获取时间之间的数据集合

Jump to

Keyboard shortcuts

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