forked from JointCloud/pcm-octopus
updated protobuf
This commit is contained in:
parent
a5c9998ef2
commit
08fb7b3639
|
@ -0,0 +1,30 @@
|
|||
package logic
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"gitlink.org.cn/JointCloud/pcm-octopus/internal/svc"
|
||||
"gitlink.org.cn/JointCloud/pcm-octopus/octopus"
|
||||
|
||||
"github.com/zeromicro/go-zero/core/logx"
|
||||
)
|
||||
|
||||
type DownloadAlgorithmUrlLogic struct {
|
||||
ctx context.Context
|
||||
svcCtx *svc.ServiceContext
|
||||
logx.Logger
|
||||
}
|
||||
|
||||
func NewDownloadAlgorithmUrlLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DownloadAlgorithmUrlLogic {
|
||||
return &DownloadAlgorithmUrlLogic{
|
||||
ctx: ctx,
|
||||
svcCtx: svcCtx,
|
||||
Logger: logx.WithContext(ctx),
|
||||
}
|
||||
}
|
||||
|
||||
func (l *DownloadAlgorithmUrlLogic) DownloadAlgorithmUrl(in *octopus.AlgorithmUrlReq) (*octopus.AlgorithmUrlResp, error) {
|
||||
// todo: add your logic here and delete this line
|
||||
|
||||
return &octopus.AlgorithmUrlResp{}, nil
|
||||
}
|
|
@ -78,6 +78,11 @@ func (s *OctopusServer) DownloadCompress(ctx context.Context, in *octopus.Downlo
|
|||
return l.DownloadCompress(in)
|
||||
}
|
||||
|
||||
func (s *OctopusServer) DownloadAlgorithmUrl(ctx context.Context, in *octopus.AlgorithmUrlReq) (*octopus.AlgorithmUrlResp, error) {
|
||||
l := logic.NewDownloadAlgorithmUrlLogic(ctx, s.svcCtx)
|
||||
return l.DownloadAlgorithmUrl(in)
|
||||
}
|
||||
|
||||
func (s *OctopusServer) UploadAlgorithm(ctx context.Context, in *octopus.UploadAlgorithmReq) (*octopus.UploadAlgorithmResp, error) {
|
||||
l := logic.NewUploadAlgorithmLogic(ctx, s.svcCtx)
|
||||
return l.UploadAlgorithm(in)
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -30,6 +30,7 @@ const (
|
|||
Octopus_CreateMyAlgorithm_FullMethodName = "/octopus.Octopus/CreateMyAlgorithm"
|
||||
Octopus_DownloadAlgorithm_FullMethodName = "/octopus.Octopus/DownloadAlgorithm"
|
||||
Octopus_DownloadCompress_FullMethodName = "/octopus.Octopus/DownloadCompress"
|
||||
Octopus_DownloadAlgorithmUrl_FullMethodName = "/octopus.Octopus/DownloadAlgorithmUrl"
|
||||
Octopus_UploadAlgorithm_FullMethodName = "/octopus.Octopus/UploadAlgorithm"
|
||||
Octopus_UploadAlgorithmConfirm_FullMethodName = "/octopus.Octopus/UploadAlgorithmConfirm"
|
||||
Octopus_GetMyDatasetList_FullMethodName = "/octopus.Octopus/GetMyDatasetList"
|
||||
|
@ -94,6 +95,7 @@ type OctopusClient interface {
|
|||
CreateMyAlgorithm(ctx context.Context, in *CreateMyAlgorithmReq, opts ...grpc.CallOption) (*CreateMyAlgorithmResp, error)
|
||||
DownloadAlgorithm(ctx context.Context, in *DownloadAlgorithmReq, opts ...grpc.CallOption) (*DownloadAlgorithmResp, error)
|
||||
DownloadCompress(ctx context.Context, in *DownloadCompressReq, opts ...grpc.CallOption) (*DownloadCompressResp, error)
|
||||
DownloadAlgorithmUrl(ctx context.Context, in *AlgorithmUrlReq, opts ...grpc.CallOption) (*AlgorithmUrlResp, error)
|
||||
UploadAlgorithm(ctx context.Context, in *UploadAlgorithmReq, opts ...grpc.CallOption) (*UploadAlgorithmResp, error)
|
||||
UploadAlgorithmConfirm(ctx context.Context, in *UploadAlgorithmConfirmReq, opts ...grpc.CallOption) (*UploadAlgorithmConfirmResp, error)
|
||||
//DatasetService
|
||||
|
@ -257,6 +259,15 @@ func (c *octopusClient) DownloadCompress(ctx context.Context, in *DownloadCompre
|
|||
return out, nil
|
||||
}
|
||||
|
||||
func (c *octopusClient) DownloadAlgorithmUrl(ctx context.Context, in *AlgorithmUrlReq, opts ...grpc.CallOption) (*AlgorithmUrlResp, error) {
|
||||
out := new(AlgorithmUrlResp)
|
||||
err := c.cc.Invoke(ctx, Octopus_DownloadAlgorithmUrl_FullMethodName, in, out, opts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *octopusClient) UploadAlgorithm(ctx context.Context, in *UploadAlgorithmReq, opts ...grpc.CallOption) (*UploadAlgorithmResp, error) {
|
||||
out := new(UploadAlgorithmResp)
|
||||
err := c.cc.Invoke(ctx, Octopus_UploadAlgorithm_FullMethodName, in, out, opts...)
|
||||
|
@ -687,6 +698,7 @@ type OctopusServer interface {
|
|||
CreateMyAlgorithm(context.Context, *CreateMyAlgorithmReq) (*CreateMyAlgorithmResp, error)
|
||||
DownloadAlgorithm(context.Context, *DownloadAlgorithmReq) (*DownloadAlgorithmResp, error)
|
||||
DownloadCompress(context.Context, *DownloadCompressReq) (*DownloadCompressResp, error)
|
||||
DownloadAlgorithmUrl(context.Context, *AlgorithmUrlReq) (*AlgorithmUrlResp, error)
|
||||
UploadAlgorithm(context.Context, *UploadAlgorithmReq) (*UploadAlgorithmResp, error)
|
||||
UploadAlgorithmConfirm(context.Context, *UploadAlgorithmConfirmReq) (*UploadAlgorithmConfirmResp, error)
|
||||
//DatasetService
|
||||
|
@ -781,6 +793,9 @@ func (UnimplementedOctopusServer) DownloadAlgorithm(context.Context, *DownloadAl
|
|||
func (UnimplementedOctopusServer) DownloadCompress(context.Context, *DownloadCompressReq) (*DownloadCompressResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DownloadCompress not implemented")
|
||||
}
|
||||
func (UnimplementedOctopusServer) DownloadAlgorithmUrl(context.Context, *AlgorithmUrlReq) (*AlgorithmUrlResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method DownloadAlgorithmUrl not implemented")
|
||||
}
|
||||
func (UnimplementedOctopusServer) UploadAlgorithm(context.Context, *UploadAlgorithmReq) (*UploadAlgorithmResp, error) {
|
||||
return nil, status.Errorf(codes.Unimplemented, "method UploadAlgorithm not implemented")
|
||||
}
|
||||
|
@ -1130,6 +1145,24 @@ func _Octopus_DownloadCompress_Handler(srv interface{}, ctx context.Context, dec
|
|||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Octopus_DownloadAlgorithmUrl_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(AlgorithmUrlReq)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if interceptor == nil {
|
||||
return srv.(OctopusServer).DownloadAlgorithmUrl(ctx, in)
|
||||
}
|
||||
info := &grpc.UnaryServerInfo{
|
||||
Server: srv,
|
||||
FullMethod: Octopus_DownloadAlgorithmUrl_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(OctopusServer).DownloadAlgorithmUrl(ctx, req.(*AlgorithmUrlReq))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Octopus_UploadAlgorithm_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(UploadAlgorithmReq)
|
||||
if err := dec(in); err != nil {
|
||||
|
@ -2009,6 +2042,10 @@ var Octopus_ServiceDesc = grpc.ServiceDesc{
|
|||
MethodName: "DownloadCompress",
|
||||
Handler: _Octopus_DownloadCompress_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "DownloadAlgorithmUrl",
|
||||
Handler: _Octopus_DownloadAlgorithmUrl_Handler,
|
||||
},
|
||||
{
|
||||
MethodName: "UploadAlgorithm",
|
||||
Handler: _Octopus_UploadAlgorithm_Handler,
|
||||
|
|
|
@ -14,6 +14,8 @@ import (
|
|||
|
||||
type (
|
||||
AlgorithmDetail = octopus.AlgorithmDetail
|
||||
AlgorithmUrlReq = octopus.AlgorithmUrlReq
|
||||
AlgorithmUrlResp = octopus.AlgorithmUrlResp
|
||||
Algorithms = octopus.Algorithms
|
||||
Applies = octopus.Applies
|
||||
BillingUser = octopus.BillingUser
|
||||
|
@ -233,6 +235,7 @@ type (
|
|||
CreateMyAlgorithm(ctx context.Context, in *CreateMyAlgorithmReq, opts ...grpc.CallOption) (*CreateMyAlgorithmResp, error)
|
||||
DownloadAlgorithm(ctx context.Context, in *DownloadAlgorithmReq, opts ...grpc.CallOption) (*DownloadAlgorithmResp, error)
|
||||
DownloadCompress(ctx context.Context, in *DownloadCompressReq, opts ...grpc.CallOption) (*DownloadCompressResp, error)
|
||||
DownloadAlgorithmUrl(ctx context.Context, in *AlgorithmUrlReq, opts ...grpc.CallOption) (*AlgorithmUrlResp, error)
|
||||
UploadAlgorithm(ctx context.Context, in *UploadAlgorithmReq, opts ...grpc.CallOption) (*UploadAlgorithmResp, error)
|
||||
UploadAlgorithmConfirm(ctx context.Context, in *UploadAlgorithmConfirmReq, opts ...grpc.CallOption) (*UploadAlgorithmConfirmResp, error)
|
||||
// DatasetService
|
||||
|
@ -356,6 +359,11 @@ func (m *defaultOctopus) DownloadCompress(ctx context.Context, in *DownloadCompr
|
|||
return client.DownloadCompress(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOctopus) DownloadAlgorithmUrl(ctx context.Context, in *AlgorithmUrlReq, opts ...grpc.CallOption) (*AlgorithmUrlResp, error) {
|
||||
client := octopus.NewOctopusClient(m.cli.Conn())
|
||||
return client.DownloadAlgorithmUrl(ctx, in, opts...)
|
||||
}
|
||||
|
||||
func (m *defaultOctopus) UploadAlgorithm(ctx context.Context, in *UploadAlgorithmReq, opts ...grpc.CallOption) (*UploadAlgorithmResp, error) {
|
||||
client := octopus.NewOctopusClient(m.cli.Conn())
|
||||
return client.UploadAlgorithm(ctx, in, opts...)
|
||||
|
|
|
@ -75,6 +75,14 @@ message PayloadDownloadAlgorithm{
|
|||
string downloadUrl = 1;
|
||||
}
|
||||
|
||||
message AlgorithmUrlReq {
|
||||
string url = 1;
|
||||
}
|
||||
|
||||
message AlgorithmUrlResp {
|
||||
string algorithm = 1;
|
||||
}
|
||||
|
||||
message UploadAlgorithmReq{
|
||||
string platform =1;
|
||||
string algorithmId = 2;
|
||||
|
@ -1320,6 +1328,7 @@ service Octopus {
|
|||
rpc CreateMyAlgorithm(CreateMyAlgorithmReq) returns (CreateMyAlgorithmResp);
|
||||
rpc DownloadAlgorithm(DownloadAlgorithmReq) returns (DownloadAlgorithmResp); //下载算法版本
|
||||
rpc DownloadCompress(DownloadCompressReq) returns (DownloadCompressResp);
|
||||
rpc DownloadAlgorithmUrl(AlgorithmUrlReq) returns (AlgorithmUrlResp);
|
||||
rpc UploadAlgorithm(UploadAlgorithmReq) returns (UploadAlgorithmResp);
|
||||
rpc UploadAlgorithmConfirm(UploadAlgorithmConfirmReq) returns (UploadAlgorithmConfirmResp);
|
||||
|
||||
|
|
Loading…
Reference in New Issue