123 lines
3.9 KiB
Go
123 lines
3.9 KiB
Go
package proto
|
|
|
|
import "hpds-iot-web/model"
|
|
|
|
// BaseResponse 基础返回结构
|
|
type BaseResponse struct {
|
|
Code int `json:"code"`
|
|
Message string `json:"message"`
|
|
Data interface{} `json:"result,omitempty"`
|
|
Status string `json:"type,omitempty"`
|
|
Err error `json:"error,omitempty"` // 错误堆栈
|
|
//Page int64 `json:"page,omitempty"` //当前页码
|
|
//PageSize int64 `json:"pageSize,omitempty"` // 单页显示记录数--前端参数2
|
|
//PageCount int64 `json:"totalPage,omitempty"` // 总页数
|
|
//TotalSize int64 `json:"total,omitempty"` // 总记录数
|
|
}
|
|
|
|
type UserLoginResponse struct {
|
|
UserId int64 `json:"userId"`
|
|
Token string `json:"token"`
|
|
RealName string `json:"realName"`
|
|
UserName string `json:"userName"`
|
|
Roles []RoleItem `json:"roles"`
|
|
Avatar string `json:"avatar"`
|
|
Desc string `json:"desc"`
|
|
HomePath string `json:"homePath"`
|
|
}
|
|
|
|
type RoleItem struct {
|
|
RoleId int64 `json:"roleId"`
|
|
RoleName string `json:"roleName"`
|
|
Value string `json:"value"`
|
|
}
|
|
|
|
type OwnerItem struct {
|
|
OwnerId int `json:"ownerId"`
|
|
OwnerName string `json:"ownerName"`
|
|
ChargeUser string `json:"chargeUser"`
|
|
Phone string `json:"phone"`
|
|
}
|
|
|
|
type UploadResponse struct {
|
|
Url string `json:"url"`
|
|
}
|
|
|
|
type OwnerProjectItem struct {
|
|
OwnerId int `json:"key"`
|
|
OwnerName string `json:"title"`
|
|
ProjectList []ProjectItem `json:"children"`
|
|
}
|
|
|
|
type ProjectItem struct {
|
|
ProjectId string `json:"key"`
|
|
ProjectName string `json:"title"`
|
|
}
|
|
|
|
type DatasetItem struct {
|
|
DatasetId int64 `json:"datasetId"`
|
|
DatasetName string `json:"datasetName"`
|
|
DatasetDesc string `json:"datasetDesc"`
|
|
StoreName string `json:"storeName"`
|
|
CategoryId int `json:"categoryId"`
|
|
ProjectId int64 `json:"projectId"`
|
|
OwnerId int64 `json:"ownerId"`
|
|
Creator int64 `json:"creator"`
|
|
CreateAt int64 `json:"createAt"`
|
|
DatasetCount int64 `json:"datasetCount"`
|
|
}
|
|
|
|
type NodeState struct {
|
|
List []model.NodeState `json:"list"`
|
|
}
|
|
|
|
type NodeLastState struct {
|
|
List []NodeLastStateItem `json:"list"`
|
|
}
|
|
type NodeLastStateItem struct {
|
|
NodeId int64 `json:"nodeId"`
|
|
NodeGuid string `json:"nodeGuid"`
|
|
NodeName string `json:"nodeName"`
|
|
NodeType int `json:"nodeType"`
|
|
NodeStatus int `json:"nodeStatus"`
|
|
Platform string `json:"platform"`
|
|
PlatformVersion string `json:"platformVersion"`
|
|
CPU string `json:"CPU"`
|
|
MemTotal uint64 `json:"memTotal"`
|
|
DiskTotal uint64 `json:"diskTotal"`
|
|
SwapTotal uint64 `json:"swapTotal"`
|
|
CpuUsed float64 `json:"cpuUsed"`
|
|
MemUsed uint64 `json:"memUsed"`
|
|
SwapUsed uint64 `json:"swapUsed"`
|
|
DiskUsed uint64 `json:"diskUsed"`
|
|
NetInTransfer uint64 `json:"netInTransfer"`
|
|
NetOutTransfer uint64 `json:"netOutTransfer"`
|
|
NetInSpeed uint64 `json:"netInSpeed"`
|
|
NetOutSpeed uint64 `json:"netOutSpeed"`
|
|
Load1 float64 `json:"load1"`
|
|
Load5 float64 `json:"load5"`
|
|
Load15 float64 `json:"load15"`
|
|
TcpConnCount uint64 `json:"tcpConnCount"`
|
|
UdpConnCount uint64 `json:"udpConnCount"`
|
|
ProcessCount uint64 `json:"processCount"`
|
|
ExecTask string `json:"execTask"`
|
|
}
|
|
|
|
type TaskDetail struct {
|
|
TaskId int64 `json:"taskId"`
|
|
ModelId int64 `json:"modelId"`
|
|
ModelName string `json:"modelName"`
|
|
NodeId int64 `json:"nodeId"`
|
|
NodeName string `json:"nodeName"`
|
|
TaskName string `json:"taskName"`
|
|
TaskDesc string `json:"taskDesc"`
|
|
DatasetArr string `json:"datasetArr"`
|
|
ResultStorage string `json:"resultStorage"`
|
|
AppointmentTime string `json:"appointmentTime"`
|
|
StartTime int64 `json:"startTime"`
|
|
FinishTime int64 `json:"finishTime"`
|
|
Status int `json:"status"`
|
|
CreateAt int64 `xorm:"created" json:"createAt"`
|
|
UpdateAt int64 `xorm:"updated" json:"updateAt"`
|
|
}
|