add update node

This commit is contained in:
2025-12-07 03:41:45 +07:00
parent 2192bf4e77
commit 49c415d4b9
13 changed files with 538 additions and 236 deletions
+210 -121
View File
@@ -1288,7 +1288,7 @@ func (*GetGraphReq) Descriptor() ([]byte, []int) {
type GetGraphRsp struct {
state protoimpl.MessageState `protogen:"open.v1"`
Nodes []*GetGraphRsp_Node `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
Nodes []*GraphNode `protobuf:"bytes,1,rep,name=nodes,proto3" json:"nodes,omitempty"`
Edges []*GetGraphRsp_Edge `protobuf:"bytes,2,rep,name=edges,proto3" json:"edges,omitempty"`
CountNodes int32 `protobuf:"varint,3,opt,name=countNodes,proto3" json:"countNodes,omitempty"`
CountEdges int32 `protobuf:"varint,4,opt,name=countEdges,proto3" json:"countEdges,omitempty"`
@@ -1326,7 +1326,7 @@ func (*GetGraphRsp) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{28}
}
func (x *GetGraphRsp) GetNodes() []*GetGraphRsp_Node {
func (x *GetGraphRsp) GetNodes() []*GraphNode {
if x != nil {
return x.Nodes
}
@@ -1354,31 +1354,27 @@ func (x *GetGraphRsp) GetCountEdges() int32 {
return 0
}
type GetGraphRsp_Node struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
Applications []*GetGraphRsp_Application `protobuf:"bytes,5,rep,name=applications,proto3" json:"applications,omitempty"`
type UpdateNodeReq struct {
state protoimpl.MessageState `protogen:"open.v1"`
Node *GraphNode `protobuf:"bytes,1,opt,name=node,proto3" json:"node,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetGraphRsp_Node) Reset() {
*x = GetGraphRsp_Node{}
func (x *UpdateNodeReq) Reset() {
*x = UpdateNodeReq{}
mi := &file_main_proto_msgTypes[29]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetGraphRsp_Node) String() string {
func (x *UpdateNodeReq) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetGraphRsp_Node) ProtoMessage() {}
func (*UpdateNodeReq) ProtoMessage() {}
func (x *GetGraphRsp_Node) ProtoReflect() protoreflect.Message {
func (x *UpdateNodeReq) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[29]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@@ -1390,46 +1386,174 @@ func (x *GetGraphRsp_Node) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use GetGraphRsp_Node.ProtoReflect.Descriptor instead.
func (*GetGraphRsp_Node) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{28, 0}
// Deprecated: Use UpdateNodeReq.ProtoReflect.Descriptor instead.
func (*UpdateNodeReq) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{29}
}
func (x *GetGraphRsp_Node) GetId() int32 {
func (x *UpdateNodeReq) GetNode() *GraphNode {
if x != nil {
return x.Node
}
return nil
}
type UpdateNodeRsp struct {
state protoimpl.MessageState `protogen:"open.v1"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *UpdateNodeRsp) Reset() {
*x = UpdateNodeRsp{}
mi := &file_main_proto_msgTypes[30]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *UpdateNodeRsp) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*UpdateNodeRsp) ProtoMessage() {}
func (x *UpdateNodeRsp) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[30]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use UpdateNodeRsp.ProtoReflect.Descriptor instead.
func (*UpdateNodeRsp) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{30}
}
type GraphNode struct {
state protoimpl.MessageState `protogen:"open.v1"`
Id int32 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
Label string `protobuf:"bytes,2,opt,name=label,proto3" json:"label,omitempty"`
Name string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`
Text string `protobuf:"bytes,4,opt,name=text,proto3" json:"text,omitempty"`
Applications []*GraphApplication `protobuf:"bytes,5,rep,name=applications,proto3" json:"applications,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GraphNode) Reset() {
*x = GraphNode{}
mi := &file_main_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GraphNode) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GraphNode) ProtoMessage() {}
func (x *GraphNode) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[31]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GraphNode.ProtoReflect.Descriptor instead.
func (*GraphNode) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{31}
}
func (x *GraphNode) GetId() int32 {
if x != nil {
return x.Id
}
return 0
}
func (x *GetGraphRsp_Node) GetLabel() string {
func (x *GraphNode) GetLabel() string {
if x != nil {
return x.Label
}
return ""
}
func (x *GetGraphRsp_Node) GetName() string {
func (x *GraphNode) GetName() string {
if x != nil {
return x.Name
}
return ""
}
func (x *GetGraphRsp_Node) GetText() string {
func (x *GraphNode) GetText() string {
if x != nil {
return x.Text
}
return ""
}
func (x *GetGraphRsp_Node) GetApplications() []*GetGraphRsp_Application {
func (x *GraphNode) GetApplications() []*GraphApplication {
if x != nil {
return x.Applications
}
return nil
}
type GraphApplication struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GraphApplication) Reset() {
*x = GraphApplication{}
mi := &file_main_proto_msgTypes[32]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GraphApplication) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GraphApplication) ProtoMessage() {}
func (x *GraphApplication) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[32]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GraphApplication.ProtoReflect.Descriptor instead.
func (*GraphApplication) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{32}
}
func (x *GraphApplication) GetName() string {
if x != nil {
return x.Name
}
return ""
}
type GetGraphRsp_Edge struct {
state protoimpl.MessageState `protogen:"open.v1"`
From int32 `protobuf:"varint,1,opt,name=from,proto3" json:"from,omitempty"`
@@ -1441,7 +1565,7 @@ type GetGraphRsp_Edge struct {
func (x *GetGraphRsp_Edge) Reset() {
*x = GetGraphRsp_Edge{}
mi := &file_main_proto_msgTypes[30]
mi := &file_main_proto_msgTypes[33]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
@@ -1453,7 +1577,7 @@ func (x *GetGraphRsp_Edge) String() string {
func (*GetGraphRsp_Edge) ProtoMessage() {}
func (x *GetGraphRsp_Edge) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[30]
mi := &file_main_proto_msgTypes[33]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
@@ -1466,7 +1590,7 @@ func (x *GetGraphRsp_Edge) ProtoReflect() protoreflect.Message {
// Deprecated: Use GetGraphRsp_Edge.ProtoReflect.Descriptor instead.
func (*GetGraphRsp_Edge) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{28, 1}
return file_main_proto_rawDescGZIP(), []int{28, 0}
}
func (x *GetGraphRsp_Edge) GetFrom() int32 {
@@ -1490,50 +1614,6 @@ func (x *GetGraphRsp_Edge) GetArrows() string {
return ""
}
type GetGraphRsp_Application struct {
state protoimpl.MessageState `protogen:"open.v1"`
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
unknownFields protoimpl.UnknownFields
sizeCache protoimpl.SizeCache
}
func (x *GetGraphRsp_Application) Reset() {
*x = GetGraphRsp_Application{}
mi := &file_main_proto_msgTypes[31]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
ms.StoreMessageInfo(mi)
}
func (x *GetGraphRsp_Application) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*GetGraphRsp_Application) ProtoMessage() {}
func (x *GetGraphRsp_Application) ProtoReflect() protoreflect.Message {
mi := &file_main_proto_msgTypes[31]
if x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
if ms.LoadMessageInfo() == nil {
ms.StoreMessageInfo(mi)
}
return ms
}
return mi.MessageOf(x)
}
// Deprecated: Use GetGraphRsp_Application.ProtoReflect.Descriptor instead.
func (*GetGraphRsp_Application) Descriptor() ([]byte, []int) {
return file_main_proto_rawDescGZIP(), []int{28, 2}
}
func (x *GetGraphRsp_Application) GetName() string {
if x != nil {
return x.Name
}
return ""
}
var File_main_proto protoreflect.FileDescriptor
const file_main_proto_rawDesc = "" +
@@ -1603,29 +1683,31 @@ const file_main_proto_rawDesc = "" +
"\x1bDownloadTeamsQrCodesFileReq\"5\n" +
"\x1bDownloadTeamsQrCodesFileRsp\x12\x16\n" +
"\x06result\x18\x01 \x01(\fR\x06result\"\r\n" +
"\vGetGraphReq\"\xe3\x03\n" +
"\vGetGraphRsp\x12?\n" +
"\x05nodes\x18\x01 \x03(\v2).crabs.evening_detective.GetGraphRsp.NodeR\x05nodes\x12?\n" +
"\vGetGraphReq\"\x8c\x02\n" +
"\vGetGraphRsp\x128\n" +
"\x05nodes\x18\x01 \x03(\v2\".crabs.evening_detective.GraphNodeR\x05nodes\x12?\n" +
"\x05edges\x18\x02 \x03(\v2).crabs.evening_detective.GetGraphRsp.EdgeR\x05edges\x12\x1e\n" +
"\n" +
"countNodes\x18\x03 \x01(\x05R\n" +
"countNodes\x12\x1e\n" +
"\n" +
"countEdges\x18\x04 \x01(\x05R\n" +
"countEdges\x1a\xaa\x01\n" +
"\x04Node\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n" +
"\x05label\x18\x02 \x01(\tR\x05label\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" +
"\x04text\x18\x04 \x01(\tR\x04text\x12T\n" +
"\fapplications\x18\x05 \x03(\v20.crabs.evening_detective.GetGraphRsp.ApplicationR\fapplications\x1aB\n" +
"countEdges\x1aB\n" +
"\x04Edge\x12\x12\n" +
"\x04from\x18\x01 \x01(\x05R\x04from\x12\x0e\n" +
"\x02to\x18\x02 \x01(\x05R\x02to\x12\x16\n" +
"\x06arrows\x18\x03 \x01(\tR\x06arrows\x1a!\n" +
"\vApplication\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name2\xed\n" +
"\n" +
"\x06arrows\x18\x03 \x01(\tR\x06arrows\"G\n" +
"\rUpdateNodeReq\x126\n" +
"\x04node\x18\x01 \x01(\v2\".crabs.evening_detective.GraphNodeR\x04node\"\x0f\n" +
"\rUpdateNodeRsp\"\xa8\x01\n" +
"\tGraphNode\x12\x0e\n" +
"\x02id\x18\x01 \x01(\x05R\x02id\x12\x14\n" +
"\x05label\x18\x02 \x01(\tR\x05label\x12\x12\n" +
"\x04name\x18\x03 \x01(\tR\x04name\x12\x12\n" +
"\x04text\x18\x04 \x01(\tR\x04text\x12M\n" +
"\fapplications\x18\x05 \x03(\v2).crabs.evening_detective.GraphApplicationR\fapplications\"&\n" +
"\x10GraphApplication\x12\x12\n" +
"\x04name\x18\x01 \x01(\tR\x04name2\xe4\v\n" +
"\x10EveningDetective\x12Y\n" +
"\x04Ping\x12 .crabs.evening_detective.PingReq\x1a .crabs.evening_detective.PingRsp\"\r\x82\xd3\xe4\x93\x02\a\x12\x05/ping\x12i\n" +
"\bAddTeams\x12$.crabs.evening_detective.AddTeamsReq\x1a$.crabs.evening_detective.AddTeamsRsp\"\x11\x82\xd3\xe4\x93\x02\v:\x01*\"\x06/teams\x12f\n" +
@@ -1640,7 +1722,9 @@ const file_main_proto_rawDesc = "" +
"\x10GiveApplications\x12,.crabs.evening_detective.GiveApplicationsReq\x1a,.crabs.evening_detective.GiveApplicationsRsp\"'\x82\xd3\xe4\x93\x02!:\x01*\"\x1c/teams/{teamId}/applications\x12\x9a\x01\n" +
"\x18DownloadTeamsQrCodesFile\x124.crabs.evening_detective.DownloadTeamsQrCodesFileReq\x1a4.crabs.evening_detective.DownloadTeamsQrCodesFileRsp\"\x12\x82\xd3\xe4\x93\x02\f\x12\n" +
"/teams/pdf\x12f\n" +
"\bGetGraph\x12$.crabs.evening_detective.GetGraphReq\x1a$.crabs.evening_detective.GetGraphRsp\"\x0e\x82\xd3\xe4\x93\x02\b\x12\x06/graphB\vZ\tpkg/protob\x06proto3"
"\bGetGraph\x12$.crabs.evening_detective.GetGraphReq\x1a$.crabs.evening_detective.GetGraphRsp\"\x0e\x82\xd3\xe4\x93\x02\b\x12\x06/graph\x12u\n" +
"\n" +
"UpdateNode\x12&.crabs.evening_detective.UpdateNodeReq\x1a&.crabs.evening_detective.UpdateNodeRsp\"\x17\x82\xd3\xe4\x93\x02\x11:\x01*\x1a\f/graph/nodesB\vZ\tpkg/protob\x06proto3"
var (
file_main_proto_rawDescOnce sync.Once
@@ -1654,7 +1738,7 @@ func file_main_proto_rawDescGZIP() []byte {
return file_main_proto_rawDescData
}
var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 32)
var file_main_proto_msgTypes = make([]protoimpl.MessageInfo, 34)
var file_main_proto_goTypes = []any{
(*PingReq)(nil), // 0: crabs.evening_detective.PingReq
(*PingRsp)(nil), // 1: crabs.evening_detective.PingRsp
@@ -1685,9 +1769,11 @@ var file_main_proto_goTypes = []any{
(*DownloadTeamsQrCodesFileRsp)(nil), // 26: crabs.evening_detective.DownloadTeamsQrCodesFileRsp
(*GetGraphReq)(nil), // 27: crabs.evening_detective.GetGraphReq
(*GetGraphRsp)(nil), // 28: crabs.evening_detective.GetGraphRsp
(*GetGraphRsp_Node)(nil), // 29: crabs.evening_detective.GetGraphRsp.Node
(*GetGraphRsp_Edge)(nil), // 30: crabs.evening_detective.GetGraphRsp.Edge
(*GetGraphRsp_Application)(nil), // 31: crabs.evening_detective.GetGraphRsp.Application
(*UpdateNodeReq)(nil), // 29: crabs.evening_detective.UpdateNodeReq
(*UpdateNodeRsp)(nil), // 30: crabs.evening_detective.UpdateNodeRsp
(*GraphNode)(nil), // 31: crabs.evening_detective.GraphNode
(*GraphApplication)(nil), // 32: crabs.evening_detective.GraphApplication
(*GetGraphRsp_Edge)(nil), // 33: crabs.evening_detective.GetGraphRsp.Edge
}
var file_main_proto_depIdxs = []int32{
3, // 0: crabs.evening_detective.AddTeamsReq.teams:type_name -> crabs.evening_detective.Team
@@ -1697,38 +1783,41 @@ var file_main_proto_depIdxs = []int32{
16, // 4: crabs.evening_detective.GetTeamRsp.actions:type_name -> crabs.evening_detective.Action
11, // 5: crabs.evening_detective.Action.applications:type_name -> crabs.evening_detective.Application
11, // 6: crabs.evening_detective.GiveApplicationsReq.applications:type_name -> crabs.evening_detective.Application
29, // 7: crabs.evening_detective.GetGraphRsp.nodes:type_name -> crabs.evening_detective.GetGraphRsp.Node
30, // 8: crabs.evening_detective.GetGraphRsp.edges:type_name -> crabs.evening_detective.GetGraphRsp.Edge
31, // 9: crabs.evening_detective.GetGraphRsp.Node.applications:type_name -> crabs.evening_detective.GetGraphRsp.Application
0, // 10: crabs.evening_detective.EveningDetective.Ping:input_type -> crabs.evening_detective.PingReq
2, // 11: crabs.evening_detective.EveningDetective.AddTeams:input_type -> crabs.evening_detective.AddTeamsReq
6, // 12: crabs.evening_detective.EveningDetective.GetTeams:input_type -> crabs.evening_detective.GetTeamsReq
8, // 13: crabs.evening_detective.EveningDetective.GetTeamsCSV:input_type -> crabs.evening_detective.GetTeamsCSVReq
12, // 14: crabs.evening_detective.EveningDetective.GetTeam:input_type -> crabs.evening_detective.GetTeamReq
14, // 15: crabs.evening_detective.EveningDetective.AddAction:input_type -> crabs.evening_detective.AddActionReq
17, // 16: crabs.evening_detective.EveningDetective.GetGame:input_type -> crabs.evening_detective.GetGameReq
19, // 17: crabs.evening_detective.EveningDetective.GameStart:input_type -> crabs.evening_detective.GameStartReq
21, // 18: crabs.evening_detective.EveningDetective.GameStop:input_type -> crabs.evening_detective.GameStopReq
23, // 19: crabs.evening_detective.EveningDetective.GiveApplications:input_type -> crabs.evening_detective.GiveApplicationsReq
25, // 20: crabs.evening_detective.EveningDetective.DownloadTeamsQrCodesFile:input_type -> crabs.evening_detective.DownloadTeamsQrCodesFileReq
27, // 21: crabs.evening_detective.EveningDetective.GetGraph:input_type -> crabs.evening_detective.GetGraphReq
1, // 22: crabs.evening_detective.EveningDetective.Ping:output_type -> crabs.evening_detective.PingRsp
4, // 23: crabs.evening_detective.EveningDetective.AddTeams:output_type -> crabs.evening_detective.AddTeamsRsp
7, // 24: crabs.evening_detective.EveningDetective.GetTeams:output_type -> crabs.evening_detective.GetTeamsRsp
9, // 25: crabs.evening_detective.EveningDetective.GetTeamsCSV:output_type -> crabs.evening_detective.GetTeamsCSVRsp
13, // 26: crabs.evening_detective.EveningDetective.GetTeam:output_type -> crabs.evening_detective.GetTeamRsp
15, // 27: crabs.evening_detective.EveningDetective.AddAction:output_type -> crabs.evening_detective.AddActionRsp
18, // 28: crabs.evening_detective.EveningDetective.GetGame:output_type -> crabs.evening_detective.GetGameRsp
20, // 29: crabs.evening_detective.EveningDetective.GameStart:output_type -> crabs.evening_detective.GameStartRsp
22, // 30: crabs.evening_detective.EveningDetective.GameStop:output_type -> crabs.evening_detective.GameStopRsp
24, // 31: crabs.evening_detective.EveningDetective.GiveApplications:output_type -> crabs.evening_detective.GiveApplicationsRsp
26, // 32: crabs.evening_detective.EveningDetective.DownloadTeamsQrCodesFile:output_type -> crabs.evening_detective.DownloadTeamsQrCodesFileRsp
28, // 33: crabs.evening_detective.EveningDetective.GetGraph:output_type -> crabs.evening_detective.GetGraphRsp
22, // [22:34] is the sub-list for method output_type
10, // [10:22] is the sub-list for method input_type
10, // [10:10] is the sub-list for extension type_name
10, // [10:10] is the sub-list for extension extendee
0, // [0:10] is the sub-list for field type_name
31, // 7: crabs.evening_detective.GetGraphRsp.nodes:type_name -> crabs.evening_detective.GraphNode
33, // 8: crabs.evening_detective.GetGraphRsp.edges:type_name -> crabs.evening_detective.GetGraphRsp.Edge
31, // 9: crabs.evening_detective.UpdateNodeReq.node:type_name -> crabs.evening_detective.GraphNode
32, // 10: crabs.evening_detective.GraphNode.applications:type_name -> crabs.evening_detective.GraphApplication
0, // 11: crabs.evening_detective.EveningDetective.Ping:input_type -> crabs.evening_detective.PingReq
2, // 12: crabs.evening_detective.EveningDetective.AddTeams:input_type -> crabs.evening_detective.AddTeamsReq
6, // 13: crabs.evening_detective.EveningDetective.GetTeams:input_type -> crabs.evening_detective.GetTeamsReq
8, // 14: crabs.evening_detective.EveningDetective.GetTeamsCSV:input_type -> crabs.evening_detective.GetTeamsCSVReq
12, // 15: crabs.evening_detective.EveningDetective.GetTeam:input_type -> crabs.evening_detective.GetTeamReq
14, // 16: crabs.evening_detective.EveningDetective.AddAction:input_type -> crabs.evening_detective.AddActionReq
17, // 17: crabs.evening_detective.EveningDetective.GetGame:input_type -> crabs.evening_detective.GetGameReq
19, // 18: crabs.evening_detective.EveningDetective.GameStart:input_type -> crabs.evening_detective.GameStartReq
21, // 19: crabs.evening_detective.EveningDetective.GameStop:input_type -> crabs.evening_detective.GameStopReq
23, // 20: crabs.evening_detective.EveningDetective.GiveApplications:input_type -> crabs.evening_detective.GiveApplicationsReq
25, // 21: crabs.evening_detective.EveningDetective.DownloadTeamsQrCodesFile:input_type -> crabs.evening_detective.DownloadTeamsQrCodesFileReq
27, // 22: crabs.evening_detective.EveningDetective.GetGraph:input_type -> crabs.evening_detective.GetGraphReq
29, // 23: crabs.evening_detective.EveningDetective.UpdateNode:input_type -> crabs.evening_detective.UpdateNodeReq
1, // 24: crabs.evening_detective.EveningDetective.Ping:output_type -> crabs.evening_detective.PingRsp
4, // 25: crabs.evening_detective.EveningDetective.AddTeams:output_type -> crabs.evening_detective.AddTeamsRsp
7, // 26: crabs.evening_detective.EveningDetective.GetTeams:output_type -> crabs.evening_detective.GetTeamsRsp
9, // 27: crabs.evening_detective.EveningDetective.GetTeamsCSV:output_type -> crabs.evening_detective.GetTeamsCSVRsp
13, // 28: crabs.evening_detective.EveningDetective.GetTeam:output_type -> crabs.evening_detective.GetTeamRsp
15, // 29: crabs.evening_detective.EveningDetective.AddAction:output_type -> crabs.evening_detective.AddActionRsp
18, // 30: crabs.evening_detective.EveningDetective.GetGame:output_type -> crabs.evening_detective.GetGameRsp
20, // 31: crabs.evening_detective.EveningDetective.GameStart:output_type -> crabs.evening_detective.GameStartRsp
22, // 32: crabs.evening_detective.EveningDetective.GameStop:output_type -> crabs.evening_detective.GameStopRsp
24, // 33: crabs.evening_detective.EveningDetective.GiveApplications:output_type -> crabs.evening_detective.GiveApplicationsRsp
26, // 34: crabs.evening_detective.EveningDetective.DownloadTeamsQrCodesFile:output_type -> crabs.evening_detective.DownloadTeamsQrCodesFileRsp
28, // 35: crabs.evening_detective.EveningDetective.GetGraph:output_type -> crabs.evening_detective.GetGraphRsp
30, // 36: crabs.evening_detective.EveningDetective.UpdateNode:output_type -> crabs.evening_detective.UpdateNodeRsp
24, // [24:37] is the sub-list for method output_type
11, // [11:24] is the sub-list for method input_type
11, // [11:11] is the sub-list for extension type_name
11, // [11:11] is the sub-list for extension extendee
0, // [0:11] is the sub-list for field type_name
}
func init() { file_main_proto_init() }
@@ -1742,7 +1831,7 @@ func file_main_proto_init() {
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
RawDescriptor: unsafe.Slice(unsafe.StringData(file_main_proto_rawDesc), len(file_main_proto_rawDesc)),
NumEnums: 0,
NumMessages: 32,
NumMessages: 34,
NumExtensions: 0,
NumServices: 1,
},
+66
View File
@@ -335,6 +335,33 @@ func local_request_EveningDetective_GetGraph_0(ctx context.Context, marshaler ru
return msg, metadata, err
}
func request_EveningDetective_UpdateNode_0(ctx context.Context, marshaler runtime.Marshaler, client EveningDetectiveClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq UpdateNodeReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
if req.Body != nil {
_, _ = io.Copy(io.Discard, req.Body)
}
msg, err := client.UpdateNode(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_EveningDetective_UpdateNode_0(ctx context.Context, marshaler runtime.Marshaler, server EveningDetectiveServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var (
protoReq UpdateNodeReq
metadata runtime.ServerMetadata
)
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.UpdateNode(ctx, &protoReq)
return msg, metadata, err
}
// RegisterEveningDetectiveHandlerServer registers the http handlers for service EveningDetective to "mux".
// UnaryRPC :call EveningDetectiveServer directly.
// StreamingRPC :currently unsupported pending https://github.com/grpc/grpc-go/issues/906.
@@ -581,6 +608,26 @@ func RegisterEveningDetectiveHandlerServer(ctx context.Context, mux *runtime.Ser
}
forward_EveningDetective_GetGraph_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPut, pattern_EveningDetective_UpdateNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
ctx = grpc.NewContextWithServerTransportStream(ctx, &stream)
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateIncomingContext(ctx, mux, req, "/crabs.evening_detective.EveningDetective/UpdateNode", runtime.WithHTTPPathPattern("/graph/nodes"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_EveningDetective_UpdateNode_0(annotatedContext, inboundMarshaler, server, req, pathParams)
md.HeaderMD, md.TrailerMD = metadata.Join(md.HeaderMD, stream.Header()), metadata.Join(md.TrailerMD, stream.Trailer())
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_EveningDetective_UpdateNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@@ -825,6 +872,23 @@ func RegisterEveningDetectiveHandlerClient(ctx context.Context, mux *runtime.Ser
}
forward_EveningDetective_GetGraph_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle(http.MethodPut, pattern_EveningDetective_UpdateNode_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
annotatedContext, err := runtime.AnnotateContext(ctx, mux, req, "/crabs.evening_detective.EveningDetective/UpdateNode", runtime.WithHTTPPathPattern("/graph/nodes"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_EveningDetective_UpdateNode_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_EveningDetective_UpdateNode_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
return nil
}
@@ -841,6 +905,7 @@ var (
pattern_EveningDetective_GiveApplications_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 1, 0, 4, 1, 5, 1, 2, 2}, []string{"teams", "teamId", "applications"}, ""))
pattern_EveningDetective_DownloadTeamsQrCodesFile_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"teams", "pdf"}, ""))
pattern_EveningDetective_GetGraph_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0}, []string{"graph"}, ""))
pattern_EveningDetective_UpdateNode_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"graph", "nodes"}, ""))
)
var (
@@ -856,4 +921,5 @@ var (
forward_EveningDetective_GiveApplications_0 = runtime.ForwardResponseMessage
forward_EveningDetective_DownloadTeamsQrCodesFile_0 = runtime.ForwardResponseMessage
forward_EveningDetective_GetGraph_0 = runtime.ForwardResponseMessage
forward_EveningDetective_UpdateNode_0 = runtime.ForwardResponseMessage
)
+94 -51
View File
@@ -141,6 +141,38 @@
]
}
},
"/graph/nodes": {
"put": {
"operationId": "EveningDetective_UpdateNode",
"responses": {
"200": {
"description": "A successful response.",
"schema": {
"$ref": "#/definitions/evening_detectiveUpdateNodeRsp"
}
},
"default": {
"description": "An unexpected error response.",
"schema": {
"$ref": "#/definitions/runtimeError"
}
}
},
"parameters": [
{
"name": "body",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/evening_detectiveUpdateNodeReq"
}
}
],
"tags": [
"EveningDetective"
]
}
},
"/ping": {
"get": {
"operationId": "EveningDetective_Ping",
@@ -348,45 +380,6 @@
}
}
},
"GetGraphRspNode": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"label": {
"type": "string"
},
"name": {
"type": "string"
},
"text": {
"type": "string"
},
"applications": {
"type": "array",
"items": {
"$ref": "#/definitions/evening_detectiveGetGraphRspApplication"
}
}
}
},
"crabsevening_detectiveApplication": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "int64"
},
"name": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"evening_detectiveAction": {
"type": "object",
"properties": {
@@ -406,7 +399,7 @@
"applications": {
"type": "array",
"items": {
"$ref": "#/definitions/crabsevening_detectiveApplication"
"$ref": "#/definitions/evening_detectiveApplication"
}
}
}
@@ -444,6 +437,21 @@
}
}
},
"evening_detectiveApplication": {
"type": "object",
"properties": {
"id": {
"type": "string",
"format": "int64"
},
"name": {
"type": "string"
},
"state": {
"type": "string"
}
}
},
"evening_detectiveDownloadTeamsQrCodesFileRsp": {
"type": "object",
"properties": {
@@ -491,7 +499,7 @@
"nodes": {
"type": "array",
"items": {
"$ref": "#/definitions/GetGraphRspNode"
"$ref": "#/definitions/evening_detectiveGraphNode"
}
},
"edges": {
@@ -510,14 +518,6 @@
}
}
},
"evening_detectiveGetGraphRspApplication": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"evening_detectiveGetTeamRsp": {
"type": "object",
"properties": {
@@ -561,7 +561,7 @@
"applications": {
"type": "array",
"items": {
"$ref": "#/definitions/crabsevening_detectiveApplication"
"$ref": "#/definitions/evening_detectiveApplication"
}
}
}
@@ -569,6 +569,38 @@
"evening_detectiveGiveApplicationsRsp": {
"type": "object"
},
"evening_detectiveGraphApplication": {
"type": "object",
"properties": {
"name": {
"type": "string"
}
}
},
"evening_detectiveGraphNode": {
"type": "object",
"properties": {
"id": {
"type": "integer",
"format": "int32"
},
"label": {
"type": "string"
},
"name": {
"type": "string"
},
"text": {
"type": "string"
},
"applications": {
"type": "array",
"items": {
"$ref": "#/definitions/evening_detectiveGraphApplication"
}
}
}
},
"evening_detectivePingRsp": {
"type": "object"
},
@@ -603,7 +635,7 @@
"applications": {
"type": "array",
"items": {
"$ref": "#/definitions/crabsevening_detectiveApplication"
"$ref": "#/definitions/evening_detectiveApplication"
}
}
}
@@ -623,6 +655,17 @@
}
}
},
"evening_detectiveUpdateNodeReq": {
"type": "object",
"properties": {
"node": {
"$ref": "#/definitions/evening_detectiveGraphNode"
}
}
},
"evening_detectiveUpdateNodeRsp": {
"type": "object"
},
"protobufAny": {
"type": "object",
"properties": {
+38
View File
@@ -31,6 +31,7 @@ const (
EveningDetective_GiveApplications_FullMethodName = "/crabs.evening_detective.EveningDetective/GiveApplications"
EveningDetective_DownloadTeamsQrCodesFile_FullMethodName = "/crabs.evening_detective.EveningDetective/DownloadTeamsQrCodesFile"
EveningDetective_GetGraph_FullMethodName = "/crabs.evening_detective.EveningDetective/GetGraph"
EveningDetective_UpdateNode_FullMethodName = "/crabs.evening_detective.EveningDetective/UpdateNode"
)
// EveningDetectiveClient is the client API for EveningDetective service.
@@ -49,6 +50,7 @@ type EveningDetectiveClient interface {
GiveApplications(ctx context.Context, in *GiveApplicationsReq, opts ...grpc.CallOption) (*GiveApplicationsRsp, error)
DownloadTeamsQrCodesFile(ctx context.Context, in *DownloadTeamsQrCodesFileReq, opts ...grpc.CallOption) (*DownloadTeamsQrCodesFileRsp, error)
GetGraph(ctx context.Context, in *GetGraphReq, opts ...grpc.CallOption) (*GetGraphRsp, error)
UpdateNode(ctx context.Context, in *UpdateNodeReq, opts ...grpc.CallOption) (*UpdateNodeRsp, error)
}
type eveningDetectiveClient struct {
@@ -179,6 +181,16 @@ func (c *eveningDetectiveClient) GetGraph(ctx context.Context, in *GetGraphReq,
return out, nil
}
func (c *eveningDetectiveClient) UpdateNode(ctx context.Context, in *UpdateNodeReq, opts ...grpc.CallOption) (*UpdateNodeRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(UpdateNodeRsp)
err := c.cc.Invoke(ctx, EveningDetective_UpdateNode_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
// EveningDetectiveServer is the server API for EveningDetective service.
// All implementations must embed UnimplementedEveningDetectiveServer
// for forward compatibility.
@@ -195,6 +207,7 @@ type EveningDetectiveServer interface {
GiveApplications(context.Context, *GiveApplicationsReq) (*GiveApplicationsRsp, error)
DownloadTeamsQrCodesFile(context.Context, *DownloadTeamsQrCodesFileReq) (*DownloadTeamsQrCodesFileRsp, error)
GetGraph(context.Context, *GetGraphReq) (*GetGraphRsp, error)
UpdateNode(context.Context, *UpdateNodeReq) (*UpdateNodeRsp, error)
mustEmbedUnimplementedEveningDetectiveServer()
}
@@ -241,6 +254,9 @@ func (UnimplementedEveningDetectiveServer) DownloadTeamsQrCodesFile(context.Cont
func (UnimplementedEveningDetectiveServer) GetGraph(context.Context, *GetGraphReq) (*GetGraphRsp, error) {
return nil, status.Errorf(codes.Unimplemented, "method GetGraph not implemented")
}
func (UnimplementedEveningDetectiveServer) UpdateNode(context.Context, *UpdateNodeReq) (*UpdateNodeRsp, error) {
return nil, status.Errorf(codes.Unimplemented, "method UpdateNode not implemented")
}
func (UnimplementedEveningDetectiveServer) mustEmbedUnimplementedEveningDetectiveServer() {}
func (UnimplementedEveningDetectiveServer) testEmbeddedByValue() {}
@@ -478,6 +494,24 @@ func _EveningDetective_GetGraph_Handler(srv interface{}, ctx context.Context, de
return interceptor(ctx, in, info, handler)
}
func _EveningDetective_UpdateNode_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(UpdateNodeReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EveningDetectiveServer).UpdateNode(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EveningDetective_UpdateNode_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServer).UpdateNode(ctx, req.(*UpdateNodeReq))
}
return interceptor(ctx, in, info, handler)
}
// EveningDetective_ServiceDesc is the grpc.ServiceDesc for EveningDetective service.
// It's only intended for direct use with grpc.RegisterService,
// and not to be introspected or modified (even as a copy)
@@ -533,6 +567,10 @@ var EveningDetective_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetGraph",
Handler: _EveningDetective_GetGraph_Handler,
},
{
MethodName: "UpdateNode",
Handler: _EveningDetective_UpdateNode_Handler,
},
},
Streams: []grpc.StreamDesc{},
Metadata: "main.proto",