2024-12-05 14:57:23 +08:00
|
|
|
// Package network define struct of network operation
|
|
|
|
|
package network
|
|
|
|
|
|
|
|
|
|
import "github.com/gofrs/uuid"
|
|
|
|
|
|
|
|
|
|
// TopologicCreateInfo defines circuit diagram topologic create info
|
|
|
|
|
type TopologicCreateInfo struct {
|
|
|
|
|
UUIDFrom string `json:"uuid_from"`
|
|
|
|
|
UUIDTo string `json:"uuid_to"`
|
|
|
|
|
Flag int `json:"flag"`
|
|
|
|
|
Comment int `json:"comment"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TopologicUUIDCreateInfo defines circuit diagram topologic uuid create info
|
|
|
|
|
type TopologicUUIDCreateInfo struct {
|
|
|
|
|
UUIDFrom uuid.UUID `json:"uuid_from"`
|
|
|
|
|
UUIDTo uuid.UUID `json:"uuid_to"`
|
|
|
|
|
Flag int `json:"flag"`
|
|
|
|
|
Comment string `json:"comment"`
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ComponentCreateInfo defines circuit diagram component create index info
|
|
|
|
|
type ComponentCreateInfo struct {
|
2025-01-21 16:35:44 +08:00
|
|
|
ID int64 `json:"id"`
|
2024-12-05 14:57:23 +08:00
|
|
|
UUID string `json:"uuid"`
|
|
|
|
|
Name string `json:"name"`
|
|
|
|
|
Context string `json:"context"`
|
|
|
|
|
GridID int64 `json:"grid_id"`
|
|
|
|
|
ZoneID int64 `json:"zone_id"`
|
|
|
|
|
StationID int64 `json:"station_id"`
|
2024-12-30 16:39:11 +08:00
|
|
|
PageID int64 `json:"page_id"`
|
|
|
|
|
Tag string `json:"tag"`
|
2024-12-05 14:57:23 +08:00
|
|
|
ComponentType int `json:"component_type"`
|
2024-12-30 16:39:11 +08:00
|
|
|
Params string `json:"params"`
|
|
|
|
|
Op int `json:"op"`
|
2024-12-05 14:57:23 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// CircuitDiagramCreateRequest defines request params of circuit diagram create api
|
|
|
|
|
type CircuitDiagramCreateRequest struct {
|
|
|
|
|
PageID int64 `json:"page_id"`
|
2024-12-05 16:32:23 +08:00
|
|
|
FreeVertexs []string `json:"free_vertexs"`
|
2024-12-05 14:57:23 +08:00
|
|
|
TopologicLinks []TopologicCreateInfo `json:"topologics"`
|
|
|
|
|
ComponentInfos []ComponentCreateInfo `json:"component_infos"`
|
|
|
|
|
}
|