[hw-8] add: comment service

This commit is contained in:
3ybacTuK
2025-07-26 23:47:18 +03:00
parent 6420eaf3d7
commit 6e0d90a6d5
29 changed files with 1249 additions and 725 deletions

View File

@@ -31,7 +31,7 @@ var _ = runtime.String
var _ = utilities.NewDoubleArray
var _ = metadata.Join
func request_Comments_Add_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func request_Comments_CommentAdd_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateCommentRequest
var metadata runtime.ServerMetadata
@@ -39,12 +39,12 @@ func request_Comments_Add_0(ctx context.Context, marshaler runtime.Marshaler, cl
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Add(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CommentAdd(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Comments_Add_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func local_request_Comments_CommentAdd_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq CreateCommentRequest
var metadata runtime.ServerMetadata
@@ -52,12 +52,12 @@ func local_request_Comments_Add_0(ctx context.Context, marshaler runtime.Marshal
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Add(ctx, &protoReq)
msg, err := server.CommentAdd(ctx, &protoReq)
return msg, metadata, err
}
func request_Comments_GetById_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func request_Comments_CommentGetByID_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetCommentRequest
var metadata runtime.ServerMetadata
@@ -65,12 +65,12 @@ func request_Comments_GetById_0(ctx context.Context, marshaler runtime.Marshaler
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.GetById(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CommentGetByID(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Comments_GetById_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func local_request_Comments_CommentGetByID_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq GetCommentRequest
var metadata runtime.ServerMetadata
@@ -78,38 +78,38 @@ func local_request_Comments_GetById_0(ctx context.Context, marshaler runtime.Mar
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.GetById(ctx, &protoReq)
msg, err := server.CommentGetByID(ctx, &protoReq)
return msg, metadata, err
}
func request_Comments_Edit_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateCommentRequest
func request_Comments_CommentEdit_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq EditCommentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.Edit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CommentEdit(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Comments_Edit_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq UpdateCommentRequest
func local_request_Comments_CommentEdit_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq EditCommentRequest
var metadata runtime.ServerMetadata
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && err != io.EOF {
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.Edit(ctx, &protoReq)
msg, err := server.CommentEdit(ctx, &protoReq)
return msg, metadata, err
}
func request_Comments_ListBySku_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func request_Comments_CommentListBySKU_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListBySkuRequest
var metadata runtime.ServerMetadata
@@ -117,12 +117,12 @@ func request_Comments_ListBySku_0(ctx context.Context, marshaler runtime.Marshal
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListBySku(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CommentListBySKU(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Comments_ListBySku_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func local_request_Comments_CommentListBySKU_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListBySkuRequest
var metadata runtime.ServerMetadata
@@ -130,12 +130,12 @@ func local_request_Comments_ListBySku_0(ctx context.Context, marshaler runtime.M
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListBySku(ctx, &protoReq)
msg, err := server.CommentListBySKU(ctx, &protoReq)
return msg, metadata, err
}
func request_Comments_ListByUser_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func request_Comments_CommentListByUser_0(ctx context.Context, marshaler runtime.Marshaler, client CommentsClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListByUserRequest
var metadata runtime.ServerMetadata
@@ -143,12 +143,12 @@ func request_Comments_ListByUser_0(ctx context.Context, marshaler runtime.Marsha
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := client.ListByUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
msg, err := client.CommentListByUser(ctx, &protoReq, grpc.Header(&metadata.HeaderMD), grpc.Trailer(&metadata.TrailerMD))
return msg, metadata, err
}
func local_request_Comments_ListByUser_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
func local_request_Comments_CommentListByUser_0(ctx context.Context, marshaler runtime.Marshaler, server CommentsServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
var protoReq ListByUserRequest
var metadata runtime.ServerMetadata
@@ -156,7 +156,7 @@ func local_request_Comments_ListByUser_0(ctx context.Context, marshaler runtime.
return nil, metadata, status.Errorf(codes.InvalidArgument, "%v", err)
}
msg, err := server.ListByUser(ctx, &protoReq)
msg, err := server.CommentListByUser(ctx, &protoReq)
return msg, metadata, err
}
@@ -167,7 +167,7 @@ func local_request_Comments_ListByUser_0(ctx context.Context, marshaler runtime.
// Note that using this registration option will cause many gRPC library features to stop working. Consider using RegisterCommentsHandlerFromEndpoint instead.
func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, server CommentsServer) error {
mux.Handle("POST", pattern_Comments_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentAdd_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@@ -175,12 +175,12 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/Add", runtime.WithHTTPPathPattern("/comment/add"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/CommentAdd", runtime.WithHTTPPathPattern("/comment/add"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Comments_Add_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Comments_CommentAdd_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 {
@@ -188,11 +188,11 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
return
}
forward_Comments_Add_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentAdd_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_GetById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentGetByID_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@@ -200,12 +200,12 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/GetById", runtime.WithHTTPPathPattern("/comment/get-by-id"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/CommentGetByID", runtime.WithHTTPPathPattern("/comment/get-by-id"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Comments_GetById_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Comments_CommentGetByID_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 {
@@ -213,11 +213,11 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
return
}
forward_Comments_GetById_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentGetByID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_Edit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentEdit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@@ -225,12 +225,12 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/Edit", runtime.WithHTTPPathPattern("/comment/edit"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/CommentEdit", runtime.WithHTTPPathPattern("/comment/edit"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Comments_Edit_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Comments_CommentEdit_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 {
@@ -238,11 +238,11 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
return
}
forward_Comments_Edit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentEdit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_ListBySku_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentListBySKU_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@@ -250,12 +250,12 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/ListBySku", runtime.WithHTTPPathPattern("/comment/list-by-sku"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/CommentListBySKU", runtime.WithHTTPPathPattern("/comment/list-by-sku"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Comments_ListBySku_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Comments_CommentListBySKU_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 {
@@ -263,11 +263,11 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
return
}
forward_Comments_ListBySku_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentListBySKU_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_ListByUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentListByUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
ctx, cancel := context.WithCancel(req.Context())
defer cancel()
var stream runtime.ServerTransportStream
@@ -275,12 +275,12 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
inboundMarshaler, outboundMarshaler := runtime.MarshalerForRequest(mux, req)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/ListByUser", runtime.WithHTTPPathPattern("/comment/list-by-user"))
annotatedContext, err = runtime.AnnotateIncomingContext(ctx, mux, req, "/.Comments/CommentListByUser", runtime.WithHTTPPathPattern("/comment/list-by-user"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := local_request_Comments_ListByUser_0(annotatedContext, inboundMarshaler, server, req, pathParams)
resp, md, err := local_request_Comments_CommentListByUser_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 {
@@ -288,7 +288,7 @@ func RegisterCommentsHandlerServer(ctx context.Context, mux *runtime.ServeMux, s
return
}
forward_Comments_ListByUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentListByUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -333,113 +333,113 @@ func RegisterCommentsHandler(ctx context.Context, mux *runtime.ServeMux, conn *g
// "CommentsClient" to call the correct interceptors.
func RegisterCommentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, client CommentsClient) error {
mux.Handle("POST", pattern_Comments_Add_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentAdd_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)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/Add", runtime.WithHTTPPathPattern("/comment/add"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/CommentAdd", runtime.WithHTTPPathPattern("/comment/add"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Comments_Add_0(annotatedContext, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Comments_CommentAdd_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Comments_Add_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentAdd_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_GetById_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentGetByID_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)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/GetById", runtime.WithHTTPPathPattern("/comment/get-by-id"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/CommentGetByID", runtime.WithHTTPPathPattern("/comment/get-by-id"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Comments_GetById_0(annotatedContext, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Comments_CommentGetByID_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Comments_GetById_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentGetByID_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_Edit_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentEdit_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)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/Edit", runtime.WithHTTPPathPattern("/comment/edit"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/CommentEdit", runtime.WithHTTPPathPattern("/comment/edit"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Comments_Edit_0(annotatedContext, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Comments_CommentEdit_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Comments_Edit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentEdit_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_ListBySku_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentListBySKU_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)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/ListBySku", runtime.WithHTTPPathPattern("/comment/list-by-sku"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/CommentListBySKU", runtime.WithHTTPPathPattern("/comment/list-by-sku"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Comments_ListBySku_0(annotatedContext, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Comments_CommentListBySKU_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Comments_ListBySku_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentListBySKU_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
mux.Handle("POST", pattern_Comments_ListByUser_0, func(w http.ResponseWriter, req *http.Request, pathParams map[string]string) {
mux.Handle("POST", pattern_Comments_CommentListByUser_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)
var err error
var annotatedContext context.Context
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/ListByUser", runtime.WithHTTPPathPattern("/comment/list-by-user"))
annotatedContext, err = runtime.AnnotateContext(ctx, mux, req, "/.Comments/CommentListByUser", runtime.WithHTTPPathPattern("/comment/list-by-user"))
if err != nil {
runtime.HTTPError(ctx, mux, outboundMarshaler, w, req, err)
return
}
resp, md, err := request_Comments_ListByUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
resp, md, err := request_Comments_CommentListByUser_0(annotatedContext, inboundMarshaler, client, req, pathParams)
annotatedContext = runtime.NewServerMetadataContext(annotatedContext, md)
if err != nil {
runtime.HTTPError(annotatedContext, mux, outboundMarshaler, w, req, err)
return
}
forward_Comments_ListByUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
forward_Comments_CommentListByUser_0(annotatedContext, mux, outboundMarshaler, w, req, resp, mux.GetForwardResponseOptions()...)
})
@@ -447,25 +447,25 @@ func RegisterCommentsHandlerClient(ctx context.Context, mux *runtime.ServeMux, c
}
var (
pattern_Comments_Add_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "add"}, ""))
pattern_Comments_CommentAdd_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "add"}, ""))
pattern_Comments_GetById_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "get-by-id"}, ""))
pattern_Comments_CommentGetByID_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "get-by-id"}, ""))
pattern_Comments_Edit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "edit"}, ""))
pattern_Comments_CommentEdit_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "edit"}, ""))
pattern_Comments_ListBySku_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "list-by-sku"}, ""))
pattern_Comments_CommentListBySKU_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "list-by-sku"}, ""))
pattern_Comments_ListByUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "list-by-user"}, ""))
pattern_Comments_CommentListByUser_0 = runtime.MustPattern(runtime.NewPattern(1, []int{2, 0, 2, 1}, []string{"comment", "list-by-user"}, ""))
)
var (
forward_Comments_Add_0 = runtime.ForwardResponseMessage
forward_Comments_CommentAdd_0 = runtime.ForwardResponseMessage
forward_Comments_GetById_0 = runtime.ForwardResponseMessage
forward_Comments_CommentGetByID_0 = runtime.ForwardResponseMessage
forward_Comments_Edit_0 = runtime.ForwardResponseMessage
forward_Comments_CommentEdit_0 = runtime.ForwardResponseMessage
forward_Comments_ListBySku_0 = runtime.ForwardResponseMessage
forward_Comments_CommentListBySKU_0 = runtime.ForwardResponseMessage
forward_Comments_ListByUser_0 = runtime.ForwardResponseMessage
forward_Comments_CommentListByUser_0 = runtime.ForwardResponseMessage
)