Documentation ¶
Index ¶
- Variables
- func CreateLog(args *ArgsCreateLog) (err error)
- func DeleteMission(args *ArgsDeleteMission) (err error)
- func Run()
- func UpdateMissionFinish(args *ArgsUpdateMissionFinish) (err error)
- func UpdateMissionStatus(args *ArgsUpdateMissionStatus) (err error)
- type ArgsCreateLog
- type ArgsCreateMission
- type ArgsDeleteMission
- type ArgsGetLogList
- type ArgsGetMissionList
- type ArgsGetWaitMissionByDevice
- type ArgsPickMission
- type ArgsUpdateMissionFinish
- type ArgsUpdateMissionStatus
- type FieldsLog
- type FieldsMission
- func CreateMission(args *ArgsCreateMission) (data FieldsMission, errCode string, err error)
- func GetMissionList(args *ArgsGetMissionList) (dataList []FieldsMission, dataCount int64, err error)
- func GetWaitMissionByDevice(args *ArgsGetWaitMissionByDevice) (data FieldsMission, err error)
- func PickMission(args *ArgsPickMission) (data FieldsMission, err error)
- func PickMissionList() (dataList []FieldsMission, err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( //RunMissionBlocker 任务推送阻拦器 RunMissionBlocker CoreRunCache.Blocker )
Functions ¶
func UpdateMissionFinish ¶
func UpdateMissionFinish(args *ArgsUpdateMissionFinish) (err error)
UpdateMissionFinish 更新任务状态完成
func UpdateMissionStatus ¶
func UpdateMissionStatus(args *ArgsUpdateMissionStatus) (err error)
UpdateMissionStatus 更新任务状态完成
Types ¶
type ArgsCreateLog ¶
type ArgsCreateLog struct { //任务ID MissionID int64 `db:"mission_id" json:"missionID" check:"id"` //状态 // 0 wait 等待发起 / 1 send 已经发送 / 2 success 已经完成 / 3 failed 已经失败 / 4 cancel 取消 Status int `db:"status" json:"status" check:"intThan0"` //行为标识码 Mark string `db:"mark" json:"mark" check:"mark"` //日志内容 Content string `db:"content" json:"content" check:"des" min:"1" max:"1000" empty:"true"` }
ArgsCreateLog 创建新的日志数据参数
type ArgsCreateMission ¶
type ArgsCreateMission struct { //组织ID // -1则忽略 OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //设备ID DeviceID int64 `db:"device_id" json:"deviceID" check:"id"` //发送请求数据集合 ParamsData []byte `db:"params_data" json:"paramsData"` //任务动作 Action string `db:"action" json:"action" check:"mark"` }
ArgsCreateMission 创建新的任务参数
type ArgsDeleteMission ¶
type ArgsDeleteMission struct { //ID ID int64 `db:"id" json:"id" check:"id"` }
ArgsDeleteMission 删除任务参数
type ArgsGetLogList ¶
type ArgsGetLogList struct { //分页 Pages CoreSQLPages.ArgsDataList `json:"pages"` //组织ID OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //任务ID MissionID int64 `db:"mission_id" json:"missionID" check:"id" empty:"true"` //状态 Status int `db:"status" json:"status" check:"intThan0" empty:"true"` //行为标识码 Mark string `db:"mark" json:"mark" check:"mark" empty:"true"` //是否为历史 IsHistory bool `db:"is_history" json:"isHistory" check:"bool"` //搜索 Search string `db:"search" json:"search" check:"search" empty:"true"` }
ArgsGetLogList 获取指定任务的日志数据参数
type ArgsGetMissionList ¶
type ArgsGetMissionList struct { //分页 Pages CoreSQLPages.ArgsDataList `json:"pages"` //组织ID // 设备所属的组织,也可能为0 OrgID int64 `db:"org_id" json:"orgID" check:"id" empty:"true"` //设备分组 GroupID int64 `db:"group_id" json:"groupID" check:"id" empty:"true"` //设备ID DeviceID int64 `db:"device_id" json:"deviceID" check:"id" empty:"true"` //状态 Status int `db:"status" json:"status" check:"intThan0" empty:"true"` //任务动作 Action string `db:"action" json:"action" check:"mark" empty:"true"` //任务动作连接方案 ConnectType string `db:"connect_type" json:"connectType" check:"mark" empty:"true"` //是否为历史 IsHistory bool `db:"is_history" json:"isHistory" check:"bool"` }
ArgsGetMissionList 获取任务列表参数
type ArgsGetWaitMissionByDevice ¶
type ArgsGetWaitMissionByDevice struct { //设备ID DeviceID int64 `db:"device_id" json:"deviceID" check:"id"` }
ArgsGetWaitMissionByDevice 获取设备待处理任务参数
type ArgsPickMission ¶
type ArgsPickMission struct { //任务ID ID int64 `json:"id"` }
ArgsPickMission 提取一个任务参数
type ArgsUpdateMissionFinish ¶
type ArgsUpdateMissionFinish struct { //ID ID int64 `db:"id" json:"id" check:"id"` //回收数据 // 回收数据如果过大,将不会被存储到本地 ReportData []byte `db:"report_data" json:"reportData"` }
ArgsUpdateMissionFinish 更新任务状态完成参数
type ArgsUpdateMissionStatus ¶
type ArgsUpdateMissionStatus struct { //ID ID int64 `db:"id" json:"id" check:"id"` //任务状态 // 0 wait 等待发起 / 1 send 已经发送 / 3 failed 已经失败 / 4 cancel 取消 Status int `db:"status" json:"status" check:"intThan0" empty:"true"` }
ArgsUpdateMissionStatus 更新任务状态完成参数
type FieldsLog ¶
type FieldsLog struct { //ID ID int64 `db:"id" json:"id"` //创建时间 CreateAt time.Time `db:"create_at" json:"createAt"` //任务ID MissionID int64 `db:"mission_id" json:"missionID"` //状态 // 0 wait 等待发起 / 1 send 已经发送 / 2 success 已经完成 / 3 failed 已经失败 / 4 cancel 取消 Status int `db:"status" json:"status"` //行为标识码 Mark string `db:"mark" json:"mark"` //日志内容 Content string `db:"content" json:"content"` }
func GetLogList ¶
func GetLogList(args *ArgsGetLogList) (dataList []FieldsLog, dataCount int64, err error)
GetLogList 获取指定任务的日志数据
type FieldsMission ¶
type FieldsMission struct { //ID ID int64 `db:"id" json:"id"` //创建时间 CreateAt time.Time `db:"create_at" json:"createAt"` //更新时间 UpdateAt time.Time `db:"update_at" json:"updateAt"` //过期时间 ExpireAt time.Time `db:"expire_at" json:"expireAt"` //组织ID // 设备所属的组织,也可能为0 OrgID int64 `db:"org_id" json:"orgID"` //设备分组 GroupID int64 `db:"group_id" json:"groupID"` //设备ID DeviceID int64 `db:"device_id" json:"deviceID"` //任务状态 // 0 wait 等待发起 / 1 send 已经发送 / 2 success 已经完成 / 3 failed 已经失败 / 4 cancel 取消 Status int `db:"status" json:"status"` //发送请求数据集合 ParamsData []byte `db:"params_data" json:"paramsData"` //回收数据 // 回收数据如果过大,将不会被存储到本地 ReportData []byte `db:"report_data" json:"reportData"` //任务动作 Action string `db:"action" json:"action"` //任务动作连接方案 // mqtt_client MQTT单一推送 ; mqtt_group MQTT分组推送 ; none 驱动主动处理 ConnectType string `db:"connect_type" json:"connectType"` }
func CreateMission ¶
func CreateMission(args *ArgsCreateMission) (data FieldsMission, errCode string, err error)
CreateMission 创建新的任务
func GetMissionList ¶
func GetMissionList(args *ArgsGetMissionList) (dataList []FieldsMission, dataCount int64, err error)
GetMissionList 获取任务列表
func GetWaitMissionByDevice ¶
func GetWaitMissionByDevice(args *ArgsGetWaitMissionByDevice) (data FieldsMission, err error)
GetWaitMissionByDevice 获取设备待处理任务
func PickMission ¶
func PickMission(args *ArgsPickMission) (data FieldsMission, err error)
PickMission 提取一个任务
func PickMissionList ¶
func PickMissionList() (dataList []FieldsMission, err error)
PickMissionList 提取一组等待发送的任务ID
Click to show internal directories.
Click to hide internal directories.