add GetComments and update proto

This commit is contained in:
2023-08-14 14:27:29 +03:00
parent 85d1191dd9
commit 37e92e8473
16 changed files with 850 additions and 142 deletions

View File

@@ -52,6 +52,13 @@ var (
Body: "",
Stream: false,
},
{
Name: "PkgdashService.GetComments",
Path: "/v1/comment",
Method: "GET",
Body: "",
Stream: false,
},
}
)
@@ -157,6 +164,24 @@ func (c *pkgdashServiceClient) GetModule(ctx context.Context, req *GetModuleReq,
return rsp, nil
}
func (c *pkgdashServiceClient) GetComments(ctx context.Context, req *GetCommentsReq, opts ...options.Option) (*GetCommentsRsp, error) {
errmap := make(map[string]interface{}, 1)
errmap["default"] = &ErrorRsp{}
opts = append(opts,
v41.ErrorMap(errmap),
)
opts = append(opts,
v41.Method(http.MethodGet),
v41.Path("/v1/comment"),
)
rsp := &GetCommentsRsp{}
err := c.c.Call(ctx, c.c.NewRequest(c.name, "PkgdashService.GetComments", req), rsp, opts...)
if err != nil {
return nil, err
}
return rsp, nil
}
type pkgdashServiceServer struct {
PkgdashServiceServer
}
@@ -181,6 +206,10 @@ func (h *pkgdashServiceServer) GetModule(ctx context.Context, req *GetModuleReq,
return h.PkgdashServiceServer.GetModule(ctx, req, rsp)
}
func (h *pkgdashServiceServer) GetComments(ctx context.Context, req *GetCommentsReq, rsp *GetCommentsRsp) error {
return h.PkgdashServiceServer.GetComments(ctx, req, rsp)
}
func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts ...options.Option) error {
type pkgdashService interface {
ListPackage(ctx context.Context, req *emptypb.Empty, rsp *ListPackageRsp) error
@@ -188,6 +217,7 @@ func RegisterPkgdashServiceServer(s server.Server, sh PkgdashServiceServer, opts
AddComment(ctx context.Context, req *AddCommentReq, rsp *AddCommentRsp) error
AddPackage(ctx context.Context, req *AddPackageReq, rsp *AddPackageRsp) error
GetModule(ctx context.Context, req *GetModuleReq, rsp *GetModuleRsp) error
GetComments(ctx context.Context, req *GetCommentsReq, rsp *GetCommentsRsp) error
}
type PkgdashService struct {
pkgdashService