276 lines
9.7 KiB
Go
276 lines
9.7 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"`
|
||
DatasetSize int64 `json:"datasetSize"`
|
||
LabelCount int64 `json:"labelCount"`
|
||
LabelSize int64 `json:"labelSize"`
|
||
}
|
||
|
||
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"`
|
||
}
|
||
|
||
type TaskResultItem struct {
|
||
FileId int64 `json:"fileId"`
|
||
FileName string `json:"fileName"`
|
||
SrcFile string `json:"srcFile"`
|
||
DistFile string `json:"distFile"`
|
||
DiseaseType int `json:"diseaseType"`
|
||
DiseaseTypeName string `json:"diseaseTypeName"`
|
||
DiseaseLevel int `json:"diseaseLevel"`
|
||
DiseaseLevelName string `json:"diseaseLevelName"`
|
||
KPile string `json:"KPile"`
|
||
UpDown int `json:"upDown"`
|
||
LineNum int `json:"lineNum"`
|
||
Length float64 `json:"length"`
|
||
Width float64 `json:"width"`
|
||
Area float64 `json:"area"`
|
||
HorizontalPositions float64 `json:"horizontalPositions"`
|
||
Memo string `json:"memo"`
|
||
Stat bool `json:"stat"`
|
||
}
|
||
|
||
// MessageEvent 定义SSE事件
|
||
type MessageEvent struct {
|
||
TaskId int64
|
||
EventId int64
|
||
Data interface{}
|
||
}
|
||
|
||
type TaskLogProgress struct {
|
||
PayloadType int `json:"payloadType"`
|
||
TaskId int64 `json:"taskId"`
|
||
TotalCount int64 `json:"totalCount"`
|
||
CompletedCount int64 `json:"completedCount"`
|
||
FailingCount int64 `json:"failingCount"`
|
||
UnfinishedCount int64 `json:"unfinishedCount"`
|
||
}
|
||
|
||
type TaskLogPayload struct {
|
||
PayloadType int `json:"payloadType"`
|
||
TaskId int64 `json:"taskId"`
|
||
TaskCode string `json:"taskCode"`
|
||
NodeId int64 `json:"nodeId"`
|
||
NodeGuid string `json:"nodeGuid"`
|
||
TaskContent string `json:"taskContent"`
|
||
Status int `json:"status"` //1:执行成功;2:执行失败
|
||
EventTime int64 `json:"eventTime"`
|
||
}
|
||
|
||
type TrainingDataset struct {
|
||
DatasetId int64 `json:"datasetId"`
|
||
Name string `json:"name"`
|
||
CategoryId int `json:"categoryId"`
|
||
DatasetDesc string `json:"datasetDesc"`
|
||
TotalSize int64 `json:"totalSize"`
|
||
TrainSize int64 `json:"trainSize"`
|
||
ValSize int64 `json:"valSize"`
|
||
TestSize int64 `json:"testSize"`
|
||
StoreName string `json:"storeName"`
|
||
CreateAt int64 `json:"createAt"`
|
||
UpdateAt int64 `json:"updateAt"`
|
||
}
|
||
|
||
type TrainingDatasetFileItem struct {
|
||
DetailId int64 `json:"detailId"`
|
||
FileName string `json:"fileName"`
|
||
FileSize int64 `json:"fileSize"`
|
||
FilePath string `json:"filePath"`
|
||
FileContent string `json:"fileContent"`
|
||
IsDisease int `json:"isDisease"`
|
||
CategoryId int `json:"categoryId"`
|
||
}
|
||
|
||
type DiseaseStatisticsItem struct {
|
||
DiseaseType int `json:"diseaseType"`
|
||
DiseaseName string `json:"diseaseName"`
|
||
TotalNum int64 `json:"totalNum"`
|
||
TotalSize int64 `json:"totalSize"`
|
||
}
|
||
|
||
type DiseaseFileInfoItem struct {
|
||
FileId int64 `json:"fileId"`
|
||
FileName string `json:"fileName"` //文件名
|
||
FilePath string `json:"filePath"` //文件路径
|
||
CategoryId int `json:"categoryId"` //病害分类, 1:道路 2:桥梁 3:隧道 4:边坡
|
||
CategoryName string `json:"categoryName"` //分类名称
|
||
FileType int `json:"fileType"` //文件类型, 1:图片 2:视频 3:雷达图谱
|
||
FileTypeName string `json:"fileTypeName"` //文件类型名称
|
||
FileSize int64 `json:"fileSize"` //文件大小
|
||
LabelType int `json:"labelType"` //标注类型
|
||
LabelTypeName string `json:"labelTypeName"` //标注类型名称
|
||
FileContent string `json:"fileContent"` //base64文件
|
||
CreateAt int64 `json:"createAt"` //上传时间
|
||
UpdateAt int64 `json:"updateAt"` //更新时间
|
||
Pid int64 `json:"pid"`
|
||
}
|
||
|
||
type AnalysisInfo struct {
|
||
ModelTotal int64 `json:"modelTotal"`
|
||
RoadModel int64 `json:"roadModel"`
|
||
BridgeModel int64 `json:"bridgeModel"`
|
||
TunnelModel int64 `json:"tunnelModel"`
|
||
SideSlopeModel int64 `json:"sideSlopeModel"`
|
||
ProjectTotal int64 `json:"projectTotal"`
|
||
RoadProject int64 `json:"roadProject"`
|
||
BridgeProject int64 `json:"bridgeProject"`
|
||
TunnelProject int64 `json:"tunnelProject"`
|
||
SideSlopeProject int64 `json:"sideSlopeProject"`
|
||
DeviceTotal int64 `json:"deviceTotal"`
|
||
CloudDevice int64 `json:"cloudDevice"`
|
||
EdgeDevice int64 `json:"edgeDevice"`
|
||
TotalLabelData int64 `json:"totalLabelData"`
|
||
RoadLabelData int64 `json:"roadLabelData"`
|
||
BridgeLabelData int64 `json:"bridgeLabelData"`
|
||
TunnelLabelData int64 `json:"tunnelLabelData"`
|
||
SideSlopeLabelData int64 `json:"sideSlopeLabelData"`
|
||
}
|
||
|
||
type ModelIssueLogItem struct {
|
||
Id int64 `json:"id"`
|
||
ModelId int64 `json:"modelId"`
|
||
NodeId int64 `json:"nodeId"`
|
||
NodeName string `json:"nodeName"`
|
||
Status int `json:"status"`
|
||
IssueResult string `json:"issueResult"`
|
||
CreateAt int64 `json:"createAt"`
|
||
UpdateAt int64 `json:"updateAt"`
|
||
}
|
||
type TrainTaskInfoItem struct {
|
||
TaskId int64 `json:"taskId"`
|
||
TrainDatasetId int64 `json:"trainDatasetId"`
|
||
TrainDatasetName string `json:"trainDatasetName"`
|
||
CategoryId int `json:"categoryId"`
|
||
CategoryName string `json:"categoryName"`
|
||
TaskName string `json:"taskName"`
|
||
TaskDesc string `json:"taskDesc"`
|
||
Arithmetic string `json:"arithmetic"`
|
||
ImageSize int `json:"imageSize"`
|
||
BatchSize int `json:"batchSize"`
|
||
EpochsSize int `json:"epochsSize"`
|
||
OutputType string `json:"outputType"`
|
||
StartTime int64 `json:"startTime"`
|
||
FinishTime int64 `json:"finishTime"`
|
||
Loss float64 `json:"loss"`
|
||
Accuracy float64 `json:"accuracy"`
|
||
ModelFilePath string `json:"modelFilePath"`
|
||
ModelFileMetricsPath string `json:"modelFileMetricsPath"`
|
||
Status int `json:"status"`
|
||
CreateAt int64 `json:"createAt"`
|
||
UpdateAt int64 `json:"updateAt"`
|
||
}
|