generated from VLADIMIR/template
add all field to admin panel
This commit is contained in:
@@ -257,11 +257,25 @@ func (s *Services) GetGraph(ctx context.Context, req *proto.GetGraphReq) (*proto
|
||||
},
|
||||
)
|
||||
}
|
||||
doors := make([]*proto.GraphDoor, 0, len(node.Doors))
|
||||
for _, door := range node.Doors {
|
||||
doors = append(
|
||||
doors,
|
||||
&proto.GraphDoor{
|
||||
Code: door.Code,
|
||||
Name: door.Name,
|
||||
Show: door.Show,
|
||||
},
|
||||
)
|
||||
}
|
||||
nodes = append(nodes, &proto.GraphNode{
|
||||
Code: node.Code,
|
||||
Name: node.Name,
|
||||
Text: node.Text,
|
||||
Image: node.Image,
|
||||
Applications: applications,
|
||||
Hidden: node.Hidden,
|
||||
Doors: doors,
|
||||
})
|
||||
}
|
||||
edges := make([]*proto.GetGraphRsp_Edge, 0, len(graph.Edges))
|
||||
|
||||
@@ -9,7 +9,10 @@ type GraphNode struct {
|
||||
Code string
|
||||
Name string
|
||||
Text string
|
||||
Image string
|
||||
Applications []*GraphApplication
|
||||
Hidden bool
|
||||
Doors []*GraphDoor
|
||||
}
|
||||
|
||||
type GraphEdge struct {
|
||||
@@ -21,3 +24,9 @@ type GraphEdge struct {
|
||||
type GraphApplication struct {
|
||||
Name string
|
||||
}
|
||||
|
||||
type GraphDoor struct {
|
||||
Code string
|
||||
Name string
|
||||
Show bool
|
||||
}
|
||||
|
||||
@@ -223,12 +223,26 @@ func (s *StoryService) GetGraph(ctx context.Context) *Graph {
|
||||
},
|
||||
)
|
||||
}
|
||||
doors := make([]*GraphDoor, 0, len(place.Doors))
|
||||
for _, door := range place.Doors {
|
||||
doors = append(
|
||||
doors,
|
||||
&GraphDoor{
|
||||
Code: door.Code,
|
||||
Name: door.Name,
|
||||
Show: door.Show,
|
||||
},
|
||||
)
|
||||
}
|
||||
nodes = append(
|
||||
nodes, &GraphNode{
|
||||
Code: place.Code,
|
||||
Name: place.Name,
|
||||
Text: place.Text,
|
||||
Image: place.Image,
|
||||
Applications: applications,
|
||||
Hidden: place.Hidden,
|
||||
Doors: doors,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@ func (s *fileService) Load(ctx context.Context) (*models.Story, error) {
|
||||
if err := json.Unmarshal(data, story); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
log.Printf("Found %d places", len(story.Places))
|
||||
return story, nil
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user