Merge remote-tracking branch 'origin/2.0' into 2.0
Former-commit-id: c84d288e30b46c50df56cc4ffebaef84213e43df
This commit is contained in:
commit
452421cae6
|
@ -44,4 +44,6 @@ type OctopusApi struct {
|
||||||
CreateNotebook string
|
CreateNotebook string
|
||||||
GetNotebook string
|
GetNotebook string
|
||||||
CreateTrainJob string
|
CreateTrainJob string
|
||||||
|
GetDatasetApplyList string
|
||||||
|
GetDatasetTypeList string
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,7 +36,7 @@ func (l *CreateNotebookLogic) CreateNotebook(in *octopus.CreateNotebookReq) (*oc
|
||||||
req := tool.GetACHttpRequest()
|
req := tool.GetACHttpRequest()
|
||||||
_, err := req.
|
_, err := req.
|
||||||
SetHeader("Authorization", "Bearer "+token).
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
SetBody(in.Param).
|
SetBody(in.Params).
|
||||||
SetResult(resp).
|
SetResult(resp).
|
||||||
Post(reqUrl)
|
Post(reqUrl)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ func (l *CreateTrainJobLogic) CreateTrainJob(in *octopus.CreateTrainJobReq) (*oc
|
||||||
req := tool.GetACHttpRequest()
|
req := tool.GetACHttpRequest()
|
||||||
_, err := req.
|
_, err := req.
|
||||||
SetHeader("Authorization", "Bearer "+token).
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
SetBody(in.Param).
|
SetBody(in.Params).
|
||||||
SetResult(resp).
|
SetResult(resp).
|
||||||
Post(reqUrl)
|
Post(reqUrl)
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,50 @@
|
||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PCM/adaptor/PCM-AI/PCM-OCTOPUS/rpc/internal/common"
|
||||||
|
"PCM/common/tool"
|
||||||
|
"context"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"PCM/adaptor/PCM-AI/PCM-OCTOPUS/rpc/internal/svc"
|
||||||
|
"PCM/adaptor/PCM-AI/PCM-OCTOPUS/rpc/octopus"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetDatasetApplyListLogic struct {
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
logx.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGetDatasetApplyListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDatasetApplyListLogic {
|
||||||
|
return &GetDatasetApplyListLogic{
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *GetDatasetApplyListLogic) GetDatasetApplyList(in *octopus.GetDatasetApplyListReq) (*octopus.GetDatasetApplyListResp, error) {
|
||||||
|
resp := &octopus.GetDatasetApplyListResp{}
|
||||||
|
|
||||||
|
var url_prefix = common.OctopusUrls[in.Platform]
|
||||||
|
var reqUrl = url_prefix + l.svcCtx.Config.OctopusApi.GetDatasetApplyList
|
||||||
|
|
||||||
|
token := common.GetToken(in.Platform)
|
||||||
|
|
||||||
|
req := tool.GetACHttpRequest()
|
||||||
|
_, err := req.
|
||||||
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
|
SetQueryString("pageIndex=" + strconv.Itoa(int(in.PageIndex))).
|
||||||
|
SetQueryString("pageSize=" + strconv.Itoa(int(in.PageSize))).
|
||||||
|
SetResult(resp).
|
||||||
|
Get(reqUrl)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
|
@ -0,0 +1,50 @@
|
||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"PCM/adaptor/PCM-AI/PCM-OCTOPUS/rpc/internal/common"
|
||||||
|
"PCM/common/tool"
|
||||||
|
"context"
|
||||||
|
"strconv"
|
||||||
|
|
||||||
|
"PCM/adaptor/PCM-AI/PCM-OCTOPUS/rpc/internal/svc"
|
||||||
|
"PCM/adaptor/PCM-AI/PCM-OCTOPUS/rpc/octopus"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type GetDatasetTypeListLogic struct {
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
logx.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewGetDatasetTypeListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetDatasetTypeListLogic {
|
||||||
|
return &GetDatasetTypeListLogic{
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *GetDatasetTypeListLogic) GetDatasetTypeList(in *octopus.GetDatasetTypeListRep) (*octopus.GetDatasetTypeListResp, error) {
|
||||||
|
resp := &octopus.GetDatasetTypeListResp{}
|
||||||
|
|
||||||
|
var url_prefix = common.OctopusUrls[in.Platform]
|
||||||
|
var reqUrl = url_prefix + l.svcCtx.Config.OctopusApi.GetDatasetTypeList
|
||||||
|
|
||||||
|
token := common.GetToken(in.Platform)
|
||||||
|
|
||||||
|
req := tool.GetACHttpRequest()
|
||||||
|
_, err := req.
|
||||||
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
|
SetQueryString("pageIndex=" + strconv.Itoa(int(in.PageIndex))).
|
||||||
|
SetQueryString("pageSize=" + strconv.Itoa(int(in.PageSize))).
|
||||||
|
SetResult(resp).
|
||||||
|
Get(reqUrl)
|
||||||
|
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
|
||||||
|
return resp, nil
|
||||||
|
}
|
|
@ -38,7 +38,7 @@ func (l *UploadAlgorithmLogic) UploadAlgorithm(in *octopus.UploadAlgorithmReq) (
|
||||||
SetHeader("Authorization", "Bearer "+token).
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
SetPathParam("algorithmId", in.AlgorithmId).
|
SetPathParam("algorithmId", in.AlgorithmId).
|
||||||
SetPathParam("version", in.Version).
|
SetPathParam("version", in.Version).
|
||||||
SetBody(in.UploadAlgorithmParam).
|
SetBody(in.Params).
|
||||||
SetResult(resp).
|
SetResult(resp).
|
||||||
Post(reqUrl)
|
Post(reqUrl)
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ func (l *UploadDataSetLogic) UploadDataSet(in *octopus.UploadDataSetReq) (*octop
|
||||||
SetHeader("Authorization", "Bearer "+token).
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
SetPathParam("datasetId", in.DatasetId).
|
SetPathParam("datasetId", in.DatasetId).
|
||||||
SetPathParam("version", in.Version).
|
SetPathParam("version", in.Version).
|
||||||
SetBody(in.UploadDataSetParam).
|
SetBody(in.Params).
|
||||||
SetResult(resp).
|
SetResult(resp).
|
||||||
Post(reqUrl)
|
Post(reqUrl)
|
||||||
|
|
||||||
|
|
|
@ -37,7 +37,7 @@ func (l *UploadImageLogic) UploadImage(in *octopus.UploadImageReq) (*octopus.Upl
|
||||||
_, err := req.
|
_, err := req.
|
||||||
SetHeader("Authorization", "Bearer "+token).
|
SetHeader("Authorization", "Bearer "+token).
|
||||||
SetPathParam("imageId", in.ImageId).
|
SetPathParam("imageId", in.ImageId).
|
||||||
SetBody(in.UploadImageParam).
|
SetBody(in.Params).
|
||||||
SetResult(resp).
|
SetResult(resp).
|
||||||
Post(reqUrl)
|
Post(reqUrl)
|
||||||
|
|
||||||
|
|
|
@ -124,6 +124,16 @@ func (s *OctopusServer) DeleteDataSetVersion(ctx context.Context, in *octopus.De
|
||||||
return l.DeleteDataSetVersion(in)
|
return l.DeleteDataSetVersion(in)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (s *OctopusServer) GetDatasetApplyList(ctx context.Context, in *octopus.GetDatasetApplyListReq) (*octopus.GetDatasetApplyListResp, error) {
|
||||||
|
l := logic.NewGetDatasetApplyListLogic(ctx, s.svcCtx)
|
||||||
|
return l.GetDatasetApplyList(in)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (s *OctopusServer) GetDatasetTypeList(ctx context.Context, in *octopus.GetDatasetTypeListRep) (*octopus.GetDatasetTypeListResp, error) {
|
||||||
|
l := logic.NewGetDatasetTypeListLogic(ctx, s.svcCtx)
|
||||||
|
return l.GetDatasetTypeList(in)
|
||||||
|
}
|
||||||
|
|
||||||
// Develop
|
// Develop
|
||||||
func (s *OctopusServer) GetNotebookList(ctx context.Context, in *octopus.GetNotebookListReq) (*octopus.GetNotebookListResp, error) {
|
func (s *OctopusServer) GetNotebookList(ctx context.Context, in *octopus.GetNotebookListReq) (*octopus.GetNotebookListResp, error) {
|
||||||
l := logic.NewGetNotebookListLogic(ctx, s.svcCtx)
|
l := logic.NewGetNotebookListLogic(ctx, s.svcCtx)
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -44,6 +44,8 @@ type OctopusClient interface {
|
||||||
UploadDataSetConfirm(ctx context.Context, in *UploadDataSetConfirmReq, opts ...grpc.CallOption) (*UploadDataSetConfirmResp, error)
|
UploadDataSetConfirm(ctx context.Context, in *UploadDataSetConfirmReq, opts ...grpc.CallOption) (*UploadDataSetConfirmResp, error)
|
||||||
CreateDataSetVersion(ctx context.Context, in *CreateDataSetVersionReq, opts ...grpc.CallOption) (*CreateDataSetVersionResp, error)
|
CreateDataSetVersion(ctx context.Context, in *CreateDataSetVersionReq, opts ...grpc.CallOption) (*CreateDataSetVersionResp, error)
|
||||||
DeleteDataSetVersion(ctx context.Context, in *DeleteDataSetVersionReq, opts ...grpc.CallOption) (*DeleteDataSetVersionResp, error)
|
DeleteDataSetVersion(ctx context.Context, in *DeleteDataSetVersionReq, opts ...grpc.CallOption) (*DeleteDataSetVersionResp, error)
|
||||||
|
GetDatasetApplyList(ctx context.Context, in *GetDatasetApplyListReq, opts ...grpc.CallOption) (*GetDatasetApplyListResp, error)
|
||||||
|
GetDatasetTypeList(ctx context.Context, in *GetDatasetTypeListRep, opts ...grpc.CallOption) (*GetDatasetTypeListResp, error)
|
||||||
// Develop
|
// Develop
|
||||||
GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error)
|
GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error)
|
||||||
GetNotebook(ctx context.Context, in *GetNotebookReq, opts ...grpc.CallOption) (*GetNotebookResp, error)
|
GetNotebook(ctx context.Context, in *GetNotebookReq, opts ...grpc.CallOption) (*GetNotebookResp, error)
|
||||||
|
@ -249,6 +251,24 @@ func (c *octopusClient) DeleteDataSetVersion(ctx context.Context, in *DeleteData
|
||||||
return out, nil
|
return out, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *octopusClient) GetDatasetApplyList(ctx context.Context, in *GetDatasetApplyListReq, opts ...grpc.CallOption) (*GetDatasetApplyListResp, error) {
|
||||||
|
out := new(GetDatasetApplyListResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/octopus.Octopus/GetDatasetApplyList", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
func (c *octopusClient) GetDatasetTypeList(ctx context.Context, in *GetDatasetTypeListRep, opts ...grpc.CallOption) (*GetDatasetTypeListResp, error) {
|
||||||
|
out := new(GetDatasetTypeListResp)
|
||||||
|
err := c.cc.Invoke(ctx, "/octopus.Octopus/GetDatasetTypeList", in, out, opts...)
|
||||||
|
if err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return out, nil
|
||||||
|
}
|
||||||
|
|
||||||
func (c *octopusClient) GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error) {
|
func (c *octopusClient) GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error) {
|
||||||
out := new(GetNotebookListResp)
|
out := new(GetNotebookListResp)
|
||||||
err := c.cc.Invoke(ctx, "/octopus.Octopus/GetNotebookList", in, out, opts...)
|
err := c.cc.Invoke(ctx, "/octopus.Octopus/GetNotebookList", in, out, opts...)
|
||||||
|
@ -383,6 +403,8 @@ type OctopusServer interface {
|
||||||
UploadDataSetConfirm(context.Context, *UploadDataSetConfirmReq) (*UploadDataSetConfirmResp, error)
|
UploadDataSetConfirm(context.Context, *UploadDataSetConfirmReq) (*UploadDataSetConfirmResp, error)
|
||||||
CreateDataSetVersion(context.Context, *CreateDataSetVersionReq) (*CreateDataSetVersionResp, error)
|
CreateDataSetVersion(context.Context, *CreateDataSetVersionReq) (*CreateDataSetVersionResp, error)
|
||||||
DeleteDataSetVersion(context.Context, *DeleteDataSetVersionReq) (*DeleteDataSetVersionResp, error)
|
DeleteDataSetVersion(context.Context, *DeleteDataSetVersionReq) (*DeleteDataSetVersionResp, error)
|
||||||
|
GetDatasetApplyList(context.Context, *GetDatasetApplyListReq) (*GetDatasetApplyListResp, error)
|
||||||
|
GetDatasetTypeList(context.Context, *GetDatasetTypeListRep) (*GetDatasetTypeListResp, error)
|
||||||
// Develop
|
// Develop
|
||||||
GetNotebookList(context.Context, *GetNotebookListReq) (*GetNotebookListResp, error)
|
GetNotebookList(context.Context, *GetNotebookListReq) (*GetNotebookListResp, error)
|
||||||
GetNotebook(context.Context, *GetNotebookReq) (*GetNotebookResp, error)
|
GetNotebook(context.Context, *GetNotebookReq) (*GetNotebookResp, error)
|
||||||
|
@ -465,6 +487,12 @@ func (UnimplementedOctopusServer) CreateDataSetVersion(context.Context, *CreateD
|
||||||
func (UnimplementedOctopusServer) DeleteDataSetVersion(context.Context, *DeleteDataSetVersionReq) (*DeleteDataSetVersionResp, error) {
|
func (UnimplementedOctopusServer) DeleteDataSetVersion(context.Context, *DeleteDataSetVersionReq) (*DeleteDataSetVersionResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method DeleteDataSetVersion not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method DeleteDataSetVersion not implemented")
|
||||||
}
|
}
|
||||||
|
func (UnimplementedOctopusServer) GetDatasetApplyList(context.Context, *GetDatasetApplyListReq) (*GetDatasetApplyListResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetDatasetApplyList not implemented")
|
||||||
|
}
|
||||||
|
func (UnimplementedOctopusServer) GetDatasetTypeList(context.Context, *GetDatasetTypeListRep) (*GetDatasetTypeListResp, error) {
|
||||||
|
return nil, status.Errorf(codes.Unimplemented, "method GetDatasetTypeList not implemented")
|
||||||
|
}
|
||||||
func (UnimplementedOctopusServer) GetNotebookList(context.Context, *GetNotebookListReq) (*GetNotebookListResp, error) {
|
func (UnimplementedOctopusServer) GetNotebookList(context.Context, *GetNotebookListReq) (*GetNotebookListResp, error) {
|
||||||
return nil, status.Errorf(codes.Unimplemented, "method GetNotebookList not implemented")
|
return nil, status.Errorf(codes.Unimplemented, "method GetNotebookList not implemented")
|
||||||
}
|
}
|
||||||
|
@ -874,6 +902,42 @@ func _Octopus_DeleteDataSetVersion_Handler(srv interface{}, ctx context.Context,
|
||||||
return interceptor(ctx, in, info, handler)
|
return interceptor(ctx, in, info, handler)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func _Octopus_GetDatasetApplyList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetDatasetApplyListReq)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OctopusServer).GetDatasetApplyList(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/octopus.Octopus/GetDatasetApplyList",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OctopusServer).GetDatasetApplyList(ctx, req.(*GetDatasetApplyListReq))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
|
func _Octopus_GetDatasetTypeList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
|
in := new(GetDatasetTypeListRep)
|
||||||
|
if err := dec(in); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
if interceptor == nil {
|
||||||
|
return srv.(OctopusServer).GetDatasetTypeList(ctx, in)
|
||||||
|
}
|
||||||
|
info := &grpc.UnaryServerInfo{
|
||||||
|
Server: srv,
|
||||||
|
FullMethod: "/octopus.Octopus/GetDatasetTypeList",
|
||||||
|
}
|
||||||
|
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||||
|
return srv.(OctopusServer).GetDatasetTypeList(ctx, req.(*GetDatasetTypeListRep))
|
||||||
|
}
|
||||||
|
return interceptor(ctx, in, info, handler)
|
||||||
|
}
|
||||||
|
|
||||||
func _Octopus_GetNotebookList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
func _Octopus_GetNotebookList_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||||
in := new(GetNotebookListReq)
|
in := new(GetNotebookListReq)
|
||||||
if err := dec(in); err != nil {
|
if err := dec(in); err != nil {
|
||||||
|
@ -1177,6 +1241,14 @@ var Octopus_ServiceDesc = grpc.ServiceDesc{
|
||||||
MethodName: "DeleteDataSetVersion",
|
MethodName: "DeleteDataSetVersion",
|
||||||
Handler: _Octopus_DeleteDataSetVersion_Handler,
|
Handler: _Octopus_DeleteDataSetVersion_Handler,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetDatasetApplyList",
|
||||||
|
Handler: _Octopus_GetDatasetApplyList_Handler,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
MethodName: "GetDatasetTypeList",
|
||||||
|
Handler: _Octopus_GetDatasetTypeList_Handler,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
MethodName: "GetNotebookList",
|
MethodName: "GetNotebookList",
|
||||||
Handler: _Octopus_GetNotebookList_Handler,
|
Handler: _Octopus_GetNotebookList_Handler,
|
||||||
|
|
|
@ -59,6 +59,10 @@ type (
|
||||||
GetAlgorithmListResp = octopus.GetAlgorithmListResp
|
GetAlgorithmListResp = octopus.GetAlgorithmListResp
|
||||||
GetAlgorithmReq = octopus.GetAlgorithmReq
|
GetAlgorithmReq = octopus.GetAlgorithmReq
|
||||||
GetAlgorithmResp = octopus.GetAlgorithmResp
|
GetAlgorithmResp = octopus.GetAlgorithmResp
|
||||||
|
GetDatasetApplyListReq = octopus.GetDatasetApplyListReq
|
||||||
|
GetDatasetApplyListResp = octopus.GetDatasetApplyListResp
|
||||||
|
GetDatasetTypeListRep = octopus.GetDatasetTypeListRep
|
||||||
|
GetDatasetTypeListResp = octopus.GetDatasetTypeListResp
|
||||||
GetDatasetVersionListReq = octopus.GetDatasetVersionListReq
|
GetDatasetVersionListReq = octopus.GetDatasetVersionListReq
|
||||||
GetDatasetVersionListResp = octopus.GetDatasetVersionListResp
|
GetDatasetVersionListResp = octopus.GetDatasetVersionListResp
|
||||||
GetMyAlgorithmListReq = octopus.GetMyAlgorithmListReq
|
GetMyAlgorithmListReq = octopus.GetMyAlgorithmListReq
|
||||||
|
@ -96,6 +100,8 @@ type (
|
||||||
PayloadDownloadAlgorithm = octopus.PayloadDownloadAlgorithm
|
PayloadDownloadAlgorithm = octopus.PayloadDownloadAlgorithm
|
||||||
PayloadGetAlgorithm = octopus.PayloadGetAlgorithm
|
PayloadGetAlgorithm = octopus.PayloadGetAlgorithm
|
||||||
PayloadGetAlgorithmApplyList = octopus.PayloadGetAlgorithmApplyList
|
PayloadGetAlgorithmApplyList = octopus.PayloadGetAlgorithmApplyList
|
||||||
|
PayloadGetDatasetApplyList = octopus.PayloadGetDatasetApplyList
|
||||||
|
PayloadGetDatasetTypeList = octopus.PayloadGetDatasetTypeList
|
||||||
PayloadGetDatasetVersion = octopus.PayloadGetDatasetVersion
|
PayloadGetDatasetVersion = octopus.PayloadGetDatasetVersion
|
||||||
PayloadGetNotebook = octopus.PayloadGetNotebook
|
PayloadGetNotebook = octopus.PayloadGetNotebook
|
||||||
PayloadMyAlgorithmList = octopus.PayloadMyAlgorithmList
|
PayloadMyAlgorithmList = octopus.PayloadMyAlgorithmList
|
||||||
|
@ -158,6 +164,8 @@ type (
|
||||||
UploadDataSetConfirm(ctx context.Context, in *UploadDataSetConfirmReq, opts ...grpc.CallOption) (*UploadDataSetConfirmResp, error)
|
UploadDataSetConfirm(ctx context.Context, in *UploadDataSetConfirmReq, opts ...grpc.CallOption) (*UploadDataSetConfirmResp, error)
|
||||||
CreateDataSetVersion(ctx context.Context, in *CreateDataSetVersionReq, opts ...grpc.CallOption) (*CreateDataSetVersionResp, error)
|
CreateDataSetVersion(ctx context.Context, in *CreateDataSetVersionReq, opts ...grpc.CallOption) (*CreateDataSetVersionResp, error)
|
||||||
DeleteDataSetVersion(ctx context.Context, in *DeleteDataSetVersionReq, opts ...grpc.CallOption) (*DeleteDataSetVersionResp, error)
|
DeleteDataSetVersion(ctx context.Context, in *DeleteDataSetVersionReq, opts ...grpc.CallOption) (*DeleteDataSetVersionResp, error)
|
||||||
|
GetDatasetApplyList(ctx context.Context, in *GetDatasetApplyListReq, opts ...grpc.CallOption) (*GetDatasetApplyListResp, error)
|
||||||
|
GetDatasetTypeList(ctx context.Context, in *GetDatasetTypeListRep, opts ...grpc.CallOption) (*GetDatasetTypeListResp, error)
|
||||||
// Develop
|
// Develop
|
||||||
GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error)
|
GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error)
|
||||||
GetNotebook(ctx context.Context, in *GetNotebookReq, opts ...grpc.CallOption) (*GetNotebookResp, error)
|
GetNotebook(ctx context.Context, in *GetNotebookReq, opts ...grpc.CallOption) (*GetNotebookResp, error)
|
||||||
|
@ -288,6 +296,16 @@ func (m *defaultOctopus) DeleteDataSetVersion(ctx context.Context, in *DeleteDat
|
||||||
return client.DeleteDataSetVersion(ctx, in, opts...)
|
return client.DeleteDataSetVersion(ctx, in, opts...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (m *defaultOctopus) GetDatasetApplyList(ctx context.Context, in *GetDatasetApplyListReq, opts ...grpc.CallOption) (*GetDatasetApplyListResp, error) {
|
||||||
|
client := octopus.NewOctopusClient(m.cli.Conn())
|
||||||
|
return client.GetDatasetApplyList(ctx, in, opts...)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *defaultOctopus) GetDatasetTypeList(ctx context.Context, in *GetDatasetTypeListRep, opts ...grpc.CallOption) (*GetDatasetTypeListResp, error) {
|
||||||
|
client := octopus.NewOctopusClient(m.cli.Conn())
|
||||||
|
return client.GetDatasetTypeList(ctx, in, opts...)
|
||||||
|
}
|
||||||
|
|
||||||
// Develop
|
// Develop
|
||||||
func (m *defaultOctopus) GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error) {
|
func (m *defaultOctopus) GetNotebookList(ctx context.Context, in *GetNotebookListReq, opts ...grpc.CallOption) (*GetNotebookListResp, error) {
|
||||||
client := octopus.NewOctopusClient(m.cli.Conn())
|
client := octopus.NewOctopusClient(m.cli.Conn())
|
||||||
|
|
|
@ -5,6 +5,7 @@ option go_package = "/octopus";
|
||||||
|
|
||||||
|
|
||||||
message resourceReq{
|
message resourceReq{
|
||||||
|
string platform =1;
|
||||||
}
|
}
|
||||||
|
|
||||||
message cpResp{
|
message cpResp{
|
||||||
|
@ -60,7 +61,7 @@ message UploadAlgorithmReq{
|
||||||
string platform =1;
|
string platform =1;
|
||||||
string algorithmId = 2;
|
string algorithmId = 2;
|
||||||
string version = 3;
|
string version = 3;
|
||||||
UploadAlgorithmParam uploadAlgorithmParam = 4;
|
UploadAlgorithmParam params = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UploadAlgorithmParam{
|
message UploadAlgorithmParam{
|
||||||
|
@ -345,7 +346,7 @@ message UploadDataSetReq{
|
||||||
string platform =1;
|
string platform =1;
|
||||||
string datasetId=2;
|
string datasetId=2;
|
||||||
string version=3;
|
string version=3;
|
||||||
UploadDataSetParam UploadDataSetParam = 4;
|
UploadDataSetParam params = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UploadDataSetParam{
|
message UploadDataSetParam{
|
||||||
|
@ -412,6 +413,42 @@ message DeleteDataSetVersionResp{
|
||||||
message PayloadDeleteDataSetVersion{
|
message PayloadDeleteDataSetVersion{
|
||||||
int64 deletedAt = 1;
|
int64 deletedAt = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message GetDatasetApplyListReq{
|
||||||
|
string platform =1;
|
||||||
|
int32 pageIndex =2;
|
||||||
|
int32 pageSize =3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetDatasetApplyListResp{
|
||||||
|
bool success =1;
|
||||||
|
PayloadGetDatasetApplyList payload =2;
|
||||||
|
Error error = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PayloadGetDatasetApplyList{
|
||||||
|
int32 totalSize = 1;
|
||||||
|
repeated Lables lables =2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetDatasetTypeListRep{
|
||||||
|
string platform =1;
|
||||||
|
int32 pageIndex =2;
|
||||||
|
int32 pageSize =3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message GetDatasetTypeListResp{
|
||||||
|
bool success =1;
|
||||||
|
PayloadGetDatasetTypeList payload =2;
|
||||||
|
Error error = 3;
|
||||||
|
}
|
||||||
|
|
||||||
|
message PayloadGetDatasetTypeList{
|
||||||
|
int32 totalSize = 1;
|
||||||
|
repeated Lables lables =2;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/******************DatasetService End*************************/
|
/******************DatasetService End*************************/
|
||||||
|
|
||||||
/******************ModelDeployService Start*************************/
|
/******************ModelDeployService Start*************************/
|
||||||
|
@ -420,7 +457,7 @@ message PayloadDeleteDataSetVersion{
|
||||||
/******************Develop Start*************************/
|
/******************Develop Start*************************/
|
||||||
message CreateNotebookReq{
|
message CreateNotebookReq{
|
||||||
string platform =1;
|
string platform =1;
|
||||||
CreateNotebookParam param = 2;
|
CreateNotebookParam params = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateNotebookParam{
|
message CreateNotebookParam{
|
||||||
|
@ -642,7 +679,7 @@ message PayloadCreateImage{
|
||||||
message UploadImageReq{
|
message UploadImageReq{
|
||||||
string platform =1;
|
string platform =1;
|
||||||
string imageId=2;
|
string imageId=2;
|
||||||
UploadImageParam uploadImageParam = 3;
|
UploadImageParam params = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message UploadImageParam{
|
message UploadImageParam{
|
||||||
|
@ -690,7 +727,7 @@ message PayloadUploadImageConfirm{
|
||||||
/******************TrainJobService Start*************************/
|
/******************TrainJobService Start*************************/
|
||||||
message CreateTrainJobReq{
|
message CreateTrainJobReq{
|
||||||
string platform =1;
|
string platform =1;
|
||||||
CreateTrainJobParam param = 2;
|
CreateTrainJobParam params = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CreateTrainJobResp{
|
message CreateTrainJobResp{
|
||||||
|
@ -806,7 +843,8 @@ service Octopus {
|
||||||
rpc UploadDataSetConfirm(UploadDataSetConfirmReq) returns (UploadDataSetConfirmResp);
|
rpc UploadDataSetConfirm(UploadDataSetConfirmReq) returns (UploadDataSetConfirmResp);
|
||||||
rpc CreateDataSetVersion(CreateDataSetVersionReq) returns (CreateDataSetVersionResp); //创建版本
|
rpc CreateDataSetVersion(CreateDataSetVersionReq) returns (CreateDataSetVersionResp); //创建版本
|
||||||
rpc DeleteDataSetVersion(DeleteDataSetVersionReq) returns (DeleteDataSetVersionResp); //删除版本
|
rpc DeleteDataSetVersion(DeleteDataSetVersionReq) returns (DeleteDataSetVersionResp); //删除版本
|
||||||
|
rpc GetDatasetApplyList(GetDatasetApplyListReq) returns (GetDatasetApplyListResp); //查询数据集用途列表
|
||||||
|
rpc GetDatasetTypeList(GetDatasetTypeListRep) returns (GetDatasetTypeListResp); //查询数据集类型列表
|
||||||
|
|
||||||
|
|
||||||
//ModelDeployService
|
//ModelDeployService
|
||||||
|
|
|
@ -192,4 +192,7 @@ service pcm {
|
||||||
|
|
||||||
@handler imageListHandler
|
@handler imageListHandler
|
||||||
get /image/list () returns (imageListResp)
|
get /image/list () returns (imageListResp)
|
||||||
|
|
||||||
|
@handler checkHandler
|
||||||
|
get /image/check (checkReq) returns (checkResp)
|
||||||
}
|
}
|
|
@ -118,4 +118,13 @@ type (
|
||||||
name string `json:"name"`
|
name string `json:"name"`
|
||||||
tags []string `json:"tags" copier:"tags"`
|
tags []string `json:"tags" copier:"tags"`
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
checkReq {
|
||||||
|
fileMd5 string `json:"fileMd5"`
|
||||||
|
}
|
||||||
|
checkResp {
|
||||||
|
exist bool `json:"exist"`
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package image
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"PCM/adaptor/PCM-CORE/api/internal/logic/image"
|
||||||
|
"PCM/adaptor/PCM-CORE/api/internal/svc"
|
||||||
|
"PCM/adaptor/PCM-CORE/api/internal/types"
|
||||||
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
)
|
||||||
|
|
||||||
|
func CheckHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
var req types.CheckReq
|
||||||
|
if err := httpx.Parse(r, &req); err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
l := image.NewCheckLogic(r.Context(), svcCtx)
|
||||||
|
resp, err := l.Check(&req)
|
||||||
|
if err != nil {
|
||||||
|
httpx.ErrorCtx(r.Context(), w, err)
|
||||||
|
} else {
|
||||||
|
httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -286,8 +286,12 @@ func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||||
Path: "/image/list",
|
Path: "/image/list",
|
||||||
Handler: image.ImageListHandler(serverCtx),
|
Handler: image.ImageListHandler(serverCtx),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
Method: http.MethodGet,
|
||||||
|
Path: "/image/check",
|
||||||
|
Handler: image.CheckHandler(serverCtx),
|
||||||
|
},
|
||||||
},
|
},
|
||||||
rest.WithMaxBytes(624288000),
|
|
||||||
rest.WithPrefix("/pcm/v1"),
|
rest.WithPrefix("/pcm/v1"),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
package image
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"path"
|
||||||
|
|
||||||
|
"PCM/adaptor/PCM-CORE/api/internal/svc"
|
||||||
|
"PCM/adaptor/PCM-CORE/api/internal/types"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type CheckLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewCheckLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CheckLogic {
|
||||||
|
return &CheckLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *CheckLogic) Check(req *types.CheckReq) (resp *types.CheckResp, err error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
path.Join()
|
||||||
|
return
|
||||||
|
}
|
|
@ -1902,3 +1902,11 @@ type ImageTagsResp struct {
|
||||||
Name string `json:"name"`
|
Name string `json:"name"`
|
||||||
Tags []string `json:"tags" copier:"tags"`
|
Tags []string `json:"tags" copier:"tags"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type CheckReq struct {
|
||||||
|
FileMd5 string `json:"fileMd5"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type CheckResp struct {
|
||||||
|
Exist bool `json:"exist"`
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in New Issue