add catalog

This commit is contained in:
2026-07-26 02:13:24 +07:00
parent d5a99508d3
commit fc9753e069
10 changed files with 498 additions and 163 deletions
+38
View File
@@ -36,6 +36,7 @@ const (
EveningDetectiveServer_DownloadFile_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/DownloadFile"
EveningDetectiveServer_AddScenario_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/AddScenario"
EveningDetectiveServer_GetMyScenarios_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetMyScenarios"
EveningDetectiveServer_GetScenariosCatalog_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetScenariosCatalog"
EveningDetectiveServer_GetScenario_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/GetScenario"
EveningDetectiveServer_UpdateScenario_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/UpdateScenario"
EveningDetectiveServer_PublicScenario_FullMethodName = "/crabs.evening_detective_server.EveningDetectiveServer/PublicScenario"
@@ -66,6 +67,7 @@ type EveningDetectiveServerClient interface {
DownloadFile(ctx context.Context, in *DownloadFileReq, opts ...grpc.CallOption) (*httpbody.HttpBody, error)
AddScenario(ctx context.Context, in *AddScenarioReq, opts ...grpc.CallOption) (*AddScenarioRsp, error)
GetMyScenarios(ctx context.Context, in *GetMyScenariosReq, opts ...grpc.CallOption) (*GetMyScenariosRsp, error)
GetScenariosCatalog(ctx context.Context, in *GetScenariosCatalogReq, opts ...grpc.CallOption) (*GetScenariosCatalogRsp, error)
GetScenario(ctx context.Context, in *GetScenarioReq, opts ...grpc.CallOption) (*GetScenarioRsp, error)
UpdateScenario(ctx context.Context, in *UpdateScenarioReq, opts ...grpc.CallOption) (*UpdateScenarioRsp, error)
PublicScenario(ctx context.Context, in *PublicScenarioReq, opts ...grpc.CallOption) (*PublicScenarioRsp, error)
@@ -244,6 +246,16 @@ func (c *eveningDetectiveServerClient) GetMyScenarios(ctx context.Context, in *G
return out, nil
}
func (c *eveningDetectiveServerClient) GetScenariosCatalog(ctx context.Context, in *GetScenariosCatalogReq, opts ...grpc.CallOption) (*GetScenariosCatalogRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetScenariosCatalogRsp)
err := c.cc.Invoke(ctx, EveningDetectiveServer_GetScenariosCatalog_FullMethodName, in, out, cOpts...)
if err != nil {
return nil, err
}
return out, nil
}
func (c *eveningDetectiveServerClient) GetScenario(ctx context.Context, in *GetScenarioReq, opts ...grpc.CallOption) (*GetScenarioRsp, error) {
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
out := new(GetScenarioRsp)
@@ -344,6 +356,7 @@ type EveningDetectiveServerServer interface {
DownloadFile(context.Context, *DownloadFileReq) (*httpbody.HttpBody, error)
AddScenario(context.Context, *AddScenarioReq) (*AddScenarioRsp, error)
GetMyScenarios(context.Context, *GetMyScenariosReq) (*GetMyScenariosRsp, error)
GetScenariosCatalog(context.Context, *GetScenariosCatalogReq) (*GetScenariosCatalogRsp, error)
GetScenario(context.Context, *GetScenarioReq) (*GetScenarioRsp, error)
UpdateScenario(context.Context, *UpdateScenarioReq) (*UpdateScenarioRsp, error)
PublicScenario(context.Context, *PublicScenarioReq) (*PublicScenarioRsp, error)
@@ -410,6 +423,9 @@ func (UnimplementedEveningDetectiveServerServer) AddScenario(context.Context, *A
func (UnimplementedEveningDetectiveServerServer) GetMyScenarios(context.Context, *GetMyScenariosReq) (*GetMyScenariosRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GetMyScenarios not implemented")
}
func (UnimplementedEveningDetectiveServerServer) GetScenariosCatalog(context.Context, *GetScenariosCatalogReq) (*GetScenariosCatalogRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GetScenariosCatalog not implemented")
}
func (UnimplementedEveningDetectiveServerServer) GetScenario(context.Context, *GetScenarioReq) (*GetScenarioRsp, error) {
return nil, status.Error(codes.Unimplemented, "method GetScenario not implemented")
}
@@ -744,6 +760,24 @@ func _EveningDetectiveServer_GetMyScenarios_Handler(srv interface{}, ctx context
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_GetScenariosCatalog_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetScenariosCatalogReq)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(EveningDetectiveServerServer).GetScenariosCatalog(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: EveningDetectiveServer_GetScenariosCatalog_FullMethodName,
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(EveningDetectiveServerServer).GetScenariosCatalog(ctx, req.(*GetScenariosCatalogReq))
}
return interceptor(ctx, in, info, handler)
}
func _EveningDetectiveServer_GetScenario_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(GetScenarioReq)
if err := dec(in); err != nil {
@@ -959,6 +993,10 @@ var EveningDetectiveServer_ServiceDesc = grpc.ServiceDesc{
MethodName: "GetMyScenarios",
Handler: _EveningDetectiveServer_GetMyScenarios_Handler,
},
{
MethodName: "GetScenariosCatalog",
Handler: _EveningDetectiveServer_GetScenariosCatalog_Handler,
},
{
MethodName: "GetScenario",
Handler: _EveningDetectiveServer_GetScenario_Handler,