refactor: localize protobuf definitions
This commit is contained in:
@@ -4,16 +4,10 @@ package server
|
||||
import (
|
||||
pb "bsm/full/module/base/cloud/pb"
|
||||
"context"
|
||||
"git.apinb.com/bsm-sdk/core/vars"
|
||||
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
"google.golang.org/grpc"
|
||||
"google.golang.org/grpc/credentials/insecure"
|
||||
"google.golang.org/grpc/reflection"
|
||||
"google.golang.org/protobuf/proto"
|
||||
"net/http"
|
||||
"os"
|
||||
"strings"
|
||||
"time"
|
||||
)
|
||||
|
||||
type Server struct {
|
||||
@@ -27,7 +21,6 @@ func New(addr string) *Server {
|
||||
srv := &Server{
|
||||
Ctx: context.Background(),
|
||||
Grpc: grpc.NewServer(),
|
||||
Mux: gwRuntime.NewServeMux(gwRuntime.WithForwardResponseRewriter(responseEnvelope)),
|
||||
grpcConns: make(map[string]*grpc.ClientConn),
|
||||
}
|
||||
|
||||
@@ -42,80 +35,5 @@ func New(addr string) *Server {
|
||||
|
||||
reflection.Register(srv.Grpc)
|
||||
|
||||
// 连接池: 只创建一次连接并复用
|
||||
conn, ok := srv.grpcConns[addr]
|
||||
if !ok {
|
||||
var err error
|
||||
conn, err = grpc.NewClient(addr, grpc.WithTransportCredentials(insecure.NewCredentials()))
|
||||
if err != nil {
|
||||
panic("failed to dial grpc server: " + err.Error())
|
||||
}
|
||||
srv.grpcConns[addr] = conn
|
||||
}
|
||||
|
||||
// 将服务注册到Gateway
|
||||
|
||||
if err := pb.RegisterAlbumHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Album handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterBookmarkHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Bookmark handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterDiskHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Disk handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterNoteHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Note handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterPrivateHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Private handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterShareHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Share handler: " + err.Error())
|
||||
}
|
||||
|
||||
if err := pb.RegisterSpaceHandler(srv.Ctx, srv.Mux, conn); err != nil {
|
||||
panic("Failed to register Space handler: " + err.Error())
|
||||
}
|
||||
|
||||
// Register services swagger
|
||||
srv.RegisterSwagger()
|
||||
|
||||
return srv
|
||||
}
|
||||
|
||||
// RegisterSwagger 注册swagger
|
||||
func (s *Server) RegisterSwagger() {
|
||||
srvKey := strings.ToLower(vars.ServiceKey)
|
||||
s.Mux.HandlePath("GET", "/"+srvKey+".swagger.json", func(w http.ResponseWriter, r *http.Request, pathParams map[string]string) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
bytes, err := os.ReadFile("./swagger/" + srvKey + ".swagger.json")
|
||||
if err != nil {
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
w.Write([]byte(err.Error()))
|
||||
return
|
||||
}
|
||||
w.Write(bytes)
|
||||
return
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
// response envelope
|
||||
func responseEnvelope(_ context.Context, response proto.Message) (interface{}, error) {
|
||||
name := string(response.ProtoReflect().Descriptor().Name())
|
||||
if name == "Status" || name == "Error" || name == "StatusReply" {
|
||||
return response, nil
|
||||
}
|
||||
return map[string]any{
|
||||
"code": 0,
|
||||
"message": vars.OK,
|
||||
"details": response,
|
||||
"timeseq": time.Now().Unix(),
|
||||
}, nil
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -595,7 +594,7 @@ var File_module_base_cloud_proto_album_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_album_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"#module/base/cloud/proto/album.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\"\xcc\x01\n" +
|
||||
"#module/base/cloud/proto/album.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\"\xcc\x01\n" +
|
||||
"\x12CreateAlbumRequest\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\x12\x12\n" +
|
||||
@@ -682,16 +681,16 @@ func file_module_base_cloud_proto_album_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cloud_proto_album_proto_msgTypes = make([]protoimpl.MessageInfo, 7)
|
||||
var file_module_base_cloud_proto_album_proto_goTypes = []any{
|
||||
(*CreateAlbumRequest)(nil), // 0: cloud.CreateAlbumRequest
|
||||
(*ListAlbumsResponse)(nil), // 1: cloud.ListAlbumsResponse
|
||||
(*SetCoverPhotoRequest)(nil), // 2: cloud.SetCoverPhotoRequest
|
||||
(*CloudAlbumItem)(nil), // 3: cloud.CloudAlbumItem
|
||||
(*ListPhotosResponse)(nil), // 4: cloud.ListPhotosResponse
|
||||
(*MovePhotoRequest)(nil), // 5: cloud.MovePhotoRequest
|
||||
(*CloudPhotoItem)(nil), // 6: cloud.CloudPhotoItem
|
||||
(*protobuf.IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*protobuf.FetchRequest)(nil), // 8: blocks.FetchRequest
|
||||
(*protobuf.StatusReply)(nil), // 9: blocks.StatusReply
|
||||
(*CreateAlbumRequest)(nil), // 0: cloud.CreateAlbumRequest
|
||||
(*ListAlbumsResponse)(nil), // 1: cloud.ListAlbumsResponse
|
||||
(*SetCoverPhotoRequest)(nil), // 2: cloud.SetCoverPhotoRequest
|
||||
(*CloudAlbumItem)(nil), // 3: cloud.CloudAlbumItem
|
||||
(*ListPhotosResponse)(nil), // 4: cloud.ListPhotosResponse
|
||||
(*MovePhotoRequest)(nil), // 5: cloud.MovePhotoRequest
|
||||
(*CloudPhotoItem)(nil), // 6: cloud.CloudPhotoItem
|
||||
(*IdentRequest)(nil), // 7: blocks.IdentRequest
|
||||
(*FetchRequest)(nil), // 8: blocks.FetchRequest
|
||||
(*StatusReply)(nil), // 9: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cloud_proto_album_proto_depIdxs = []int32{
|
||||
3, // 0: cloud.ListAlbumsResponse.albums:type_name -> cloud.CloudAlbumItem
|
||||
@@ -734,6 +733,7 @@ func file_module_base_cloud_proto_album_proto_init() {
|
||||
if File_module_base_cloud_proto_album_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,7 @@ func local_request_Album_CreateAlbum_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Album_GetAlbum_0(ctx context.Context, marshaler runtime.Marshaler, client AlbumClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Album_GetAlbum_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Album_GetAlbum_0(ctx context.Context, marshaler runtime.Marshaler, server AlbumServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Album_UpdateAlbum_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Album_DeleteAlbum_0(ctx context.Context, marshaler runtime.Marshaler, client AlbumClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Album_DeleteAlbum_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func local_request_Album_DeleteAlbum_0(ctx context.Context, marshaler runtime.Marshaler, server AlbumServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -146,7 +145,7 @@ func local_request_Album_DeleteAlbum_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Album_ListAlbums_0(ctx context.Context, marshaler runtime.Marshaler, client AlbumClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -161,7 +160,7 @@ func request_Album_ListAlbums_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func local_request_Album_ListAlbums_0(ctx context.Context, marshaler runtime.Marshaler, server AlbumServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -227,7 +226,7 @@ func local_request_Album_UploadPhoto_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Album_GetPhoto_0(ctx context.Context, marshaler runtime.Marshaler, client AlbumClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -242,7 +241,7 @@ func request_Album_GetPhoto_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Album_GetPhoto_0(ctx context.Context, marshaler runtime.Marshaler, server AlbumServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -281,7 +280,7 @@ func local_request_Album_UpdatePhoto_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Album_DeletePhoto_0(ctx context.Context, marshaler runtime.Marshaler, client AlbumClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -296,7 +295,7 @@ func request_Album_DeletePhoto_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func local_request_Album_DeletePhoto_0(ctx context.Context, marshaler runtime.Marshaler, server AlbumServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -308,7 +307,7 @@ func local_request_Album_DeletePhoto_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Album_ListPhotos_0(ctx context.Context, marshaler runtime.Marshaler, client AlbumClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -323,7 +322,7 @@ func request_Album_ListPhotos_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func local_request_Album_ListPhotos_0(ctx context.Context, marshaler runtime.Marshaler, server AlbumServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -41,29 +40,29 @@ const (
|
||||
// 相册服务
|
||||
type AlbumClient interface {
|
||||
// 创建相册
|
||||
CreateAlbum(ctx context.Context, in *CreateAlbumRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CreateAlbum(ctx context.Context, in *CreateAlbumRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取相册详情
|
||||
GetAlbum(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudAlbumItem, error)
|
||||
GetAlbum(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudAlbumItem, error)
|
||||
// 更新相册
|
||||
UpdateAlbum(ctx context.Context, in *CloudAlbumItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdateAlbum(ctx context.Context, in *CloudAlbumItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除相册
|
||||
DeleteAlbum(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteAlbum(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取相册列表
|
||||
ListAlbums(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListAlbumsResponse, error)
|
||||
ListAlbums(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListAlbumsResponse, error)
|
||||
// 设置封面照片
|
||||
SetCoverPhoto(ctx context.Context, in *SetCoverPhotoRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
SetCoverPhoto(ctx context.Context, in *SetCoverPhotoRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 上传照片
|
||||
UploadPhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UploadPhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取照片详情
|
||||
GetPhoto(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudPhotoItem, error)
|
||||
GetPhoto(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudPhotoItem, error)
|
||||
// 更新照片
|
||||
UpdatePhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdatePhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除照片
|
||||
DeletePhoto(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeletePhoto(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取照片列表
|
||||
ListPhotos(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPhotosResponse, error)
|
||||
ListPhotos(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPhotosResponse, error)
|
||||
// 移动照片到其他相册
|
||||
MovePhoto(ctx context.Context, in *MovePhotoRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
MovePhoto(ctx context.Context, in *MovePhotoRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type albumClient struct {
|
||||
@@ -74,9 +73,9 @@ func NewAlbumClient(cc grpc.ClientConnInterface) AlbumClient {
|
||||
return &albumClient{cc}
|
||||
}
|
||||
|
||||
func (c *albumClient) CreateAlbum(ctx context.Context, in *CreateAlbumRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) CreateAlbum(ctx context.Context, in *CreateAlbumRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_CreateAlbum_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -84,7 +83,7 @@ func (c *albumClient) CreateAlbum(ctx context.Context, in *CreateAlbumRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) GetAlbum(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudAlbumItem, error) {
|
||||
func (c *albumClient) GetAlbum(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudAlbumItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudAlbumItem)
|
||||
err := c.cc.Invoke(ctx, Album_GetAlbum_FullMethodName, in, out, cOpts...)
|
||||
@@ -94,9 +93,9 @@ func (c *albumClient) GetAlbum(ctx context.Context, in *protobuf.IdentRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) UpdateAlbum(ctx context.Context, in *CloudAlbumItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) UpdateAlbum(ctx context.Context, in *CloudAlbumItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_UpdateAlbum_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -104,9 +103,9 @@ func (c *albumClient) UpdateAlbum(ctx context.Context, in *CloudAlbumItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) DeleteAlbum(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) DeleteAlbum(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_DeleteAlbum_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -114,7 +113,7 @@ func (c *albumClient) DeleteAlbum(ctx context.Context, in *protobuf.IdentRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) ListAlbums(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListAlbumsResponse, error) {
|
||||
func (c *albumClient) ListAlbums(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListAlbumsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListAlbumsResponse)
|
||||
err := c.cc.Invoke(ctx, Album_ListAlbums_FullMethodName, in, out, cOpts...)
|
||||
@@ -124,9 +123,9 @@ func (c *albumClient) ListAlbums(ctx context.Context, in *protobuf.FetchRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) SetCoverPhoto(ctx context.Context, in *SetCoverPhotoRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) SetCoverPhoto(ctx context.Context, in *SetCoverPhotoRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_SetCoverPhoto_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -134,9 +133,9 @@ func (c *albumClient) SetCoverPhoto(ctx context.Context, in *SetCoverPhotoReques
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) UploadPhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) UploadPhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_UploadPhoto_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -144,7 +143,7 @@ func (c *albumClient) UploadPhoto(ctx context.Context, in *CloudPhotoItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) GetPhoto(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudPhotoItem, error) {
|
||||
func (c *albumClient) GetPhoto(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudPhotoItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudPhotoItem)
|
||||
err := c.cc.Invoke(ctx, Album_GetPhoto_FullMethodName, in, out, cOpts...)
|
||||
@@ -154,9 +153,9 @@ func (c *albumClient) GetPhoto(ctx context.Context, in *protobuf.IdentRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) UpdatePhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) UpdatePhoto(ctx context.Context, in *CloudPhotoItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_UpdatePhoto_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -164,9 +163,9 @@ func (c *albumClient) UpdatePhoto(ctx context.Context, in *CloudPhotoItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) DeletePhoto(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) DeletePhoto(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_DeletePhoto_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -174,7 +173,7 @@ func (c *albumClient) DeletePhoto(ctx context.Context, in *protobuf.IdentRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) ListPhotos(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPhotosResponse, error) {
|
||||
func (c *albumClient) ListPhotos(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPhotosResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPhotosResponse)
|
||||
err := c.cc.Invoke(ctx, Album_ListPhotos_FullMethodName, in, out, cOpts...)
|
||||
@@ -184,9 +183,9 @@ func (c *albumClient) ListPhotos(ctx context.Context, in *protobuf.FetchRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *albumClient) MovePhoto(ctx context.Context, in *MovePhotoRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *albumClient) MovePhoto(ctx context.Context, in *MovePhotoRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Album_MovePhoto_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -201,29 +200,29 @@ func (c *albumClient) MovePhoto(ctx context.Context, in *MovePhotoRequest, opts
|
||||
// 相册服务
|
||||
type AlbumServer interface {
|
||||
// 创建相册
|
||||
CreateAlbum(context.Context, *CreateAlbumRequest) (*protobuf.StatusReply, error)
|
||||
CreateAlbum(context.Context, *CreateAlbumRequest) (*StatusReply, error)
|
||||
// 获取相册详情
|
||||
GetAlbum(context.Context, *protobuf.IdentRequest) (*CloudAlbumItem, error)
|
||||
GetAlbum(context.Context, *IdentRequest) (*CloudAlbumItem, error)
|
||||
// 更新相册
|
||||
UpdateAlbum(context.Context, *CloudAlbumItem) (*protobuf.StatusReply, error)
|
||||
UpdateAlbum(context.Context, *CloudAlbumItem) (*StatusReply, error)
|
||||
// 删除相册
|
||||
DeleteAlbum(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteAlbum(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取相册列表
|
||||
ListAlbums(context.Context, *protobuf.FetchRequest) (*ListAlbumsResponse, error)
|
||||
ListAlbums(context.Context, *FetchRequest) (*ListAlbumsResponse, error)
|
||||
// 设置封面照片
|
||||
SetCoverPhoto(context.Context, *SetCoverPhotoRequest) (*protobuf.StatusReply, error)
|
||||
SetCoverPhoto(context.Context, *SetCoverPhotoRequest) (*StatusReply, error)
|
||||
// 上传照片
|
||||
UploadPhoto(context.Context, *CloudPhotoItem) (*protobuf.StatusReply, error)
|
||||
UploadPhoto(context.Context, *CloudPhotoItem) (*StatusReply, error)
|
||||
// 获取照片详情
|
||||
GetPhoto(context.Context, *protobuf.IdentRequest) (*CloudPhotoItem, error)
|
||||
GetPhoto(context.Context, *IdentRequest) (*CloudPhotoItem, error)
|
||||
// 更新照片
|
||||
UpdatePhoto(context.Context, *CloudPhotoItem) (*protobuf.StatusReply, error)
|
||||
UpdatePhoto(context.Context, *CloudPhotoItem) (*StatusReply, error)
|
||||
// 删除照片
|
||||
DeletePhoto(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeletePhoto(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取照片列表
|
||||
ListPhotos(context.Context, *protobuf.FetchRequest) (*ListPhotosResponse, error)
|
||||
ListPhotos(context.Context, *FetchRequest) (*ListPhotosResponse, error)
|
||||
// 移动照片到其他相册
|
||||
MovePhoto(context.Context, *MovePhotoRequest) (*protobuf.StatusReply, error)
|
||||
MovePhoto(context.Context, *MovePhotoRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedAlbumServer should be embedded to have
|
||||
@@ -233,40 +232,40 @@ type AlbumServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedAlbumServer struct{}
|
||||
|
||||
func (UnimplementedAlbumServer) CreateAlbum(context.Context, *CreateAlbumRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) CreateAlbum(context.Context, *CreateAlbumRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateAlbum not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) GetAlbum(context.Context, *protobuf.IdentRequest) (*CloudAlbumItem, error) {
|
||||
func (UnimplementedAlbumServer) GetAlbum(context.Context, *IdentRequest) (*CloudAlbumItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetAlbum not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) UpdateAlbum(context.Context, *CloudAlbumItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) UpdateAlbum(context.Context, *CloudAlbumItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateAlbum not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) DeleteAlbum(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) DeleteAlbum(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteAlbum not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) ListAlbums(context.Context, *protobuf.FetchRequest) (*ListAlbumsResponse, error) {
|
||||
func (UnimplementedAlbumServer) ListAlbums(context.Context, *FetchRequest) (*ListAlbumsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListAlbums not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) SetCoverPhoto(context.Context, *SetCoverPhotoRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) SetCoverPhoto(context.Context, *SetCoverPhotoRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SetCoverPhoto not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) UploadPhoto(context.Context, *CloudPhotoItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) UploadPhoto(context.Context, *CloudPhotoItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UploadPhoto not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) GetPhoto(context.Context, *protobuf.IdentRequest) (*CloudPhotoItem, error) {
|
||||
func (UnimplementedAlbumServer) GetPhoto(context.Context, *IdentRequest) (*CloudPhotoItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPhoto not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) UpdatePhoto(context.Context, *CloudPhotoItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) UpdatePhoto(context.Context, *CloudPhotoItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdatePhoto not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) DeletePhoto(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) DeletePhoto(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeletePhoto not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) ListPhotos(context.Context, *protobuf.FetchRequest) (*ListPhotosResponse, error) {
|
||||
func (UnimplementedAlbumServer) ListPhotos(context.Context, *FetchRequest) (*ListPhotosResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPhotos not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) MovePhoto(context.Context, *MovePhotoRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedAlbumServer) MovePhoto(context.Context, *MovePhotoRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method MovePhoto not implemented")
|
||||
}
|
||||
func (UnimplementedAlbumServer) testEmbeddedByValue() {}
|
||||
@@ -308,7 +307,7 @@ func _Album_CreateAlbum_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Album_GetAlbum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -320,7 +319,7 @@ func _Album_GetAlbum_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Album_GetAlbum_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlbumServer).GetAlbum(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(AlbumServer).GetAlbum(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -344,7 +343,7 @@ func _Album_UpdateAlbum_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Album_DeleteAlbum_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -356,13 +355,13 @@ func _Album_DeleteAlbum_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: Album_DeleteAlbum_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlbumServer).DeleteAlbum(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(AlbumServer).DeleteAlbum(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Album_ListAlbums_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -374,7 +373,7 @@ func _Album_ListAlbums_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Album_ListAlbums_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlbumServer).ListAlbums(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(AlbumServer).ListAlbums(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -416,7 +415,7 @@ func _Album_UploadPhoto_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Album_GetPhoto_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -428,7 +427,7 @@ func _Album_GetPhoto_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Album_GetPhoto_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlbumServer).GetPhoto(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(AlbumServer).GetPhoto(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -452,7 +451,7 @@ func _Album_UpdatePhoto_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Album_DeletePhoto_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -464,13 +463,13 @@ func _Album_DeletePhoto_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: Album_DeletePhoto_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlbumServer).DeletePhoto(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(AlbumServer).DeletePhoto(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Album_ListPhotos_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -482,7 +481,7 @@ func _Album_ListPhotos_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Album_ListPhotos_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(AlbumServer).ListPhotos(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(AlbumServer).ListPhotos(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
package cloud
|
||||
|
||||
import blocks "bsm/full/protobuf"
|
||||
|
||||
type Empty = blocks.Empty
|
||||
type FetchRequest = blocks.FetchRequest
|
||||
type IdentRequest = blocks.IdentRequest
|
||||
type StatusReply = blocks.StatusReply
|
||||
type IDRequest = blocks.IDRequest
|
||||
type IDListRequest = blocks.IDListRequest
|
||||
type StdIicuds = blocks.StdIicuds
|
||||
type StdPassport = blocks.StdPassport
|
||||
type CloudBase = blocks.CloudBase
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -363,7 +362,7 @@ var File_module_base_cloud_proto_bookmark_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_bookmark_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"&module/base/cloud/proto/bookmark.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\"\x86\x02\n" +
|
||||
"&module/base/cloud/proto/bookmark.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\"\x86\x02\n" +
|
||||
"\x15CreateBookmarkRequest\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\x12\x14\n" +
|
||||
@@ -423,9 +422,9 @@ var file_module_base_cloud_proto_bookmark_proto_goTypes = []any{
|
||||
(*ListBookmarksResponse)(nil), // 1: cloud.ListBookmarksResponse
|
||||
(*ImportBookmarksRequest)(nil), // 2: cloud.ImportBookmarksRequest
|
||||
(*CloudBookmarkItem)(nil), // 3: cloud.CloudBookmarkItem
|
||||
(*protobuf.IDRequest)(nil), // 4: blocks.IDRequest
|
||||
(*protobuf.FetchRequest)(nil), // 5: blocks.FetchRequest
|
||||
(*protobuf.StatusReply)(nil), // 6: blocks.StatusReply
|
||||
(*IDRequest)(nil), // 4: blocks.IDRequest
|
||||
(*FetchRequest)(nil), // 5: blocks.FetchRequest
|
||||
(*StatusReply)(nil), // 6: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cloud_proto_bookmark_proto_depIdxs = []int32{
|
||||
3, // 0: cloud.ListBookmarksResponse.bookmarks:type_name -> cloud.CloudBookmarkItem
|
||||
@@ -453,6 +452,7 @@ func file_module_base_cloud_proto_bookmark_proto_init() {
|
||||
if File_module_base_cloud_proto_bookmark_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,7 @@ func local_request_Bookmark_CreateBookmark_0(ctx context.Context, marshaler runt
|
||||
|
||||
func request_Bookmark_GetBookmark_0(ctx context.Context, marshaler runtime.Marshaler, client BookmarkClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IDRequest
|
||||
protoReq IDRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Bookmark_GetBookmark_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func local_request_Bookmark_GetBookmark_0(ctx context.Context, marshaler runtime.Marshaler, server BookmarkServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IDRequest
|
||||
protoReq IDRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Bookmark_UpdateBookmark_0(ctx context.Context, marshaler runt
|
||||
|
||||
func request_Bookmark_DeleteBookmark_0(ctx context.Context, marshaler runtime.Marshaler, client BookmarkClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IDRequest
|
||||
protoReq IDRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Bookmark_DeleteBookmark_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func local_request_Bookmark_DeleteBookmark_0(ctx context.Context, marshaler runtime.Marshaler, server BookmarkServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IDRequest
|
||||
protoReq IDRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -146,7 +145,7 @@ func local_request_Bookmark_DeleteBookmark_0(ctx context.Context, marshaler runt
|
||||
|
||||
func request_Bookmark_ListBookmarks_0(ctx context.Context, marshaler runtime.Marshaler, client BookmarkClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -161,7 +160,7 @@ func request_Bookmark_ListBookmarks_0(ctx context.Context, marshaler runtime.Mar
|
||||
|
||||
func local_request_Bookmark_ListBookmarks_0(ctx context.Context, marshaler runtime.Marshaler, server BookmarkServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -35,17 +34,17 @@ const (
|
||||
// 书签服务
|
||||
type BookmarkClient interface {
|
||||
// 创建书签
|
||||
CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取书签详情
|
||||
GetBookmark(ctx context.Context, in *protobuf.IDRequest, opts ...grpc.CallOption) (*CloudBookmarkItem, error)
|
||||
GetBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*CloudBookmarkItem, error)
|
||||
// 更新书签
|
||||
UpdateBookmark(ctx context.Context, in *CloudBookmarkItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdateBookmark(ctx context.Context, in *CloudBookmarkItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除书签
|
||||
DeleteBookmark(ctx context.Context, in *protobuf.IDRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取书签列表
|
||||
ListBookmarks(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error)
|
||||
ListBookmarks(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error)
|
||||
// 导入书签
|
||||
ImportBookmarks(ctx context.Context, in *ImportBookmarksRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
ImportBookmarks(ctx context.Context, in *ImportBookmarksRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type bookmarkClient struct {
|
||||
@@ -56,9 +55,9 @@ func NewBookmarkClient(cc grpc.ClientConnInterface) BookmarkClient {
|
||||
return &bookmarkClient{cc}
|
||||
}
|
||||
|
||||
func (c *bookmarkClient) CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *bookmarkClient) CreateBookmark(ctx context.Context, in *CreateBookmarkRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Bookmark_CreateBookmark_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -66,7 +65,7 @@ func (c *bookmarkClient) CreateBookmark(ctx context.Context, in *CreateBookmarkR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bookmarkClient) GetBookmark(ctx context.Context, in *protobuf.IDRequest, opts ...grpc.CallOption) (*CloudBookmarkItem, error) {
|
||||
func (c *bookmarkClient) GetBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*CloudBookmarkItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudBookmarkItem)
|
||||
err := c.cc.Invoke(ctx, Bookmark_GetBookmark_FullMethodName, in, out, cOpts...)
|
||||
@@ -76,9 +75,9 @@ func (c *bookmarkClient) GetBookmark(ctx context.Context, in *protobuf.IDRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bookmarkClient) UpdateBookmark(ctx context.Context, in *CloudBookmarkItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *bookmarkClient) UpdateBookmark(ctx context.Context, in *CloudBookmarkItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Bookmark_UpdateBookmark_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -86,9 +85,9 @@ func (c *bookmarkClient) UpdateBookmark(ctx context.Context, in *CloudBookmarkIt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bookmarkClient) DeleteBookmark(ctx context.Context, in *protobuf.IDRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *bookmarkClient) DeleteBookmark(ctx context.Context, in *IDRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Bookmark_DeleteBookmark_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -96,7 +95,7 @@ func (c *bookmarkClient) DeleteBookmark(ctx context.Context, in *protobuf.IDRequ
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bookmarkClient) ListBookmarks(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error) {
|
||||
func (c *bookmarkClient) ListBookmarks(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListBookmarksResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListBookmarksResponse)
|
||||
err := c.cc.Invoke(ctx, Bookmark_ListBookmarks_FullMethodName, in, out, cOpts...)
|
||||
@@ -106,9 +105,9 @@ func (c *bookmarkClient) ListBookmarks(ctx context.Context, in *protobuf.FetchRe
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *bookmarkClient) ImportBookmarks(ctx context.Context, in *ImportBookmarksRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *bookmarkClient) ImportBookmarks(ctx context.Context, in *ImportBookmarksRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Bookmark_ImportBookmarks_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -123,17 +122,17 @@ func (c *bookmarkClient) ImportBookmarks(ctx context.Context, in *ImportBookmark
|
||||
// 书签服务
|
||||
type BookmarkServer interface {
|
||||
// 创建书签
|
||||
CreateBookmark(context.Context, *CreateBookmarkRequest) (*protobuf.StatusReply, error)
|
||||
CreateBookmark(context.Context, *CreateBookmarkRequest) (*StatusReply, error)
|
||||
// 获取书签详情
|
||||
GetBookmark(context.Context, *protobuf.IDRequest) (*CloudBookmarkItem, error)
|
||||
GetBookmark(context.Context, *IDRequest) (*CloudBookmarkItem, error)
|
||||
// 更新书签
|
||||
UpdateBookmark(context.Context, *CloudBookmarkItem) (*protobuf.StatusReply, error)
|
||||
UpdateBookmark(context.Context, *CloudBookmarkItem) (*StatusReply, error)
|
||||
// 删除书签
|
||||
DeleteBookmark(context.Context, *protobuf.IDRequest) (*protobuf.StatusReply, error)
|
||||
DeleteBookmark(context.Context, *IDRequest) (*StatusReply, error)
|
||||
// 获取书签列表
|
||||
ListBookmarks(context.Context, *protobuf.FetchRequest) (*ListBookmarksResponse, error)
|
||||
ListBookmarks(context.Context, *FetchRequest) (*ListBookmarksResponse, error)
|
||||
// 导入书签
|
||||
ImportBookmarks(context.Context, *ImportBookmarksRequest) (*protobuf.StatusReply, error)
|
||||
ImportBookmarks(context.Context, *ImportBookmarksRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedBookmarkServer should be embedded to have
|
||||
@@ -143,22 +142,22 @@ type BookmarkServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedBookmarkServer struct{}
|
||||
|
||||
func (UnimplementedBookmarkServer) CreateBookmark(context.Context, *CreateBookmarkRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedBookmarkServer) CreateBookmark(context.Context, *CreateBookmarkRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateBookmark not implemented")
|
||||
}
|
||||
func (UnimplementedBookmarkServer) GetBookmark(context.Context, *protobuf.IDRequest) (*CloudBookmarkItem, error) {
|
||||
func (UnimplementedBookmarkServer) GetBookmark(context.Context, *IDRequest) (*CloudBookmarkItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetBookmark not implemented")
|
||||
}
|
||||
func (UnimplementedBookmarkServer) UpdateBookmark(context.Context, *CloudBookmarkItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedBookmarkServer) UpdateBookmark(context.Context, *CloudBookmarkItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateBookmark not implemented")
|
||||
}
|
||||
func (UnimplementedBookmarkServer) DeleteBookmark(context.Context, *protobuf.IDRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedBookmarkServer) DeleteBookmark(context.Context, *IDRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteBookmark not implemented")
|
||||
}
|
||||
func (UnimplementedBookmarkServer) ListBookmarks(context.Context, *protobuf.FetchRequest) (*ListBookmarksResponse, error) {
|
||||
func (UnimplementedBookmarkServer) ListBookmarks(context.Context, *FetchRequest) (*ListBookmarksResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListBookmarks not implemented")
|
||||
}
|
||||
func (UnimplementedBookmarkServer) ImportBookmarks(context.Context, *ImportBookmarksRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedBookmarkServer) ImportBookmarks(context.Context, *ImportBookmarksRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ImportBookmarks not implemented")
|
||||
}
|
||||
func (UnimplementedBookmarkServer) testEmbeddedByValue() {}
|
||||
@@ -200,7 +199,7 @@ func _Bookmark_CreateBookmark_Handler(srv interface{}, ctx context.Context, dec
|
||||
}
|
||||
|
||||
func _Bookmark_GetBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IDRequest)
|
||||
in := new(IDRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -212,7 +211,7 @@ func _Bookmark_GetBookmark_Handler(srv interface{}, ctx context.Context, dec fun
|
||||
FullMethod: Bookmark_GetBookmark_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BookmarkServer).GetBookmark(ctx, req.(*protobuf.IDRequest))
|
||||
return srv.(BookmarkServer).GetBookmark(ctx, req.(*IDRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -236,7 +235,7 @@ func _Bookmark_UpdateBookmark_Handler(srv interface{}, ctx context.Context, dec
|
||||
}
|
||||
|
||||
func _Bookmark_DeleteBookmark_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IDRequest)
|
||||
in := new(IDRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -248,13 +247,13 @@ func _Bookmark_DeleteBookmark_Handler(srv interface{}, ctx context.Context, dec
|
||||
FullMethod: Bookmark_DeleteBookmark_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BookmarkServer).DeleteBookmark(ctx, req.(*protobuf.IDRequest))
|
||||
return srv.(BookmarkServer).DeleteBookmark(ctx, req.(*IDRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Bookmark_ListBookmarks_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -266,7 +265,7 @@ func _Bookmark_ListBookmarks_Handler(srv interface{}, ctx context.Context, dec f
|
||||
FullMethod: Bookmark_ListBookmarks_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(BookmarkServer).ListBookmarks(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(BookmarkServer).ListBookmarks(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
3368
module/base/cloud/pb/const.pb.go
Normal file
3368
module/base/cloud/pb/const.pb.go
Normal file
File diff suppressed because it is too large
Load Diff
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -731,7 +730,7 @@ var File_module_base_cloud_proto_disk_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_disk_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\"module/base/cloud/proto/disk.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\"\x99\x01\n" +
|
||||
"\"module/base/cloud/proto/disk.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\"\x99\x01\n" +
|
||||
"\x10CreateDirRequest\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\x12\x1b\n" +
|
||||
@@ -829,18 +828,18 @@ func file_module_base_cloud_proto_disk_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cloud_proto_disk_proto_msgTypes = make([]protoimpl.MessageInfo, 9)
|
||||
var file_module_base_cloud_proto_disk_proto_goTypes = []any{
|
||||
(*CreateDirRequest)(nil), // 0: cloud.CreateDirRequest
|
||||
(*ListDirsResponse)(nil), // 1: cloud.ListDirsResponse
|
||||
(*CloudDiskDirItem)(nil), // 2: cloud.CloudDiskDirItem
|
||||
(*MoveDirRequest)(nil), // 3: cloud.MoveDirRequest
|
||||
(*ListFilesResponse)(nil), // 4: cloud.ListFilesResponse
|
||||
(*MoveFileRequest)(nil), // 5: cloud.MoveFileRequest
|
||||
(*CopyFileRequest)(nil), // 6: cloud.CopyFileRequest
|
||||
(*CloudDiskFileRequest)(nil), // 7: cloud.CloudDiskFileRequest
|
||||
(*CloudDiskFileItem)(nil), // 8: cloud.CloudDiskFileItem
|
||||
(*protobuf.IdentRequest)(nil), // 9: blocks.IdentRequest
|
||||
(*protobuf.FetchRequest)(nil), // 10: blocks.FetchRequest
|
||||
(*protobuf.StatusReply)(nil), // 11: blocks.StatusReply
|
||||
(*CreateDirRequest)(nil), // 0: cloud.CreateDirRequest
|
||||
(*ListDirsResponse)(nil), // 1: cloud.ListDirsResponse
|
||||
(*CloudDiskDirItem)(nil), // 2: cloud.CloudDiskDirItem
|
||||
(*MoveDirRequest)(nil), // 3: cloud.MoveDirRequest
|
||||
(*ListFilesResponse)(nil), // 4: cloud.ListFilesResponse
|
||||
(*MoveFileRequest)(nil), // 5: cloud.MoveFileRequest
|
||||
(*CopyFileRequest)(nil), // 6: cloud.CopyFileRequest
|
||||
(*CloudDiskFileRequest)(nil), // 7: cloud.CloudDiskFileRequest
|
||||
(*CloudDiskFileItem)(nil), // 8: cloud.CloudDiskFileItem
|
||||
(*IdentRequest)(nil), // 9: blocks.IdentRequest
|
||||
(*FetchRequest)(nil), // 10: blocks.FetchRequest
|
||||
(*StatusReply)(nil), // 11: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cloud_proto_disk_proto_depIdxs = []int32{
|
||||
2, // 0: cloud.ListDirsResponse.dirs:type_name -> cloud.CloudDiskDirItem
|
||||
@@ -891,6 +890,7 @@ func file_module_base_cloud_proto_disk_proto_init() {
|
||||
if File_module_base_cloud_proto_disk_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,7 @@ func local_request_Disk_CreateDir_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func request_Disk_GetDir_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Disk_GetDir_0(ctx context.Context, marshaler runtime.Marshaler, cli
|
||||
|
||||
func local_request_Disk_GetDir_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Disk_UpdateDir_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func request_Disk_DeleteDir_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Disk_DeleteDir_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Disk_DeleteDir_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -146,7 +145,7 @@ func local_request_Disk_DeleteDir_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func request_Disk_ListDirs_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -161,7 +160,7 @@ func request_Disk_ListDirs_0(ctx context.Context, marshaler runtime.Marshaler, c
|
||||
|
||||
func local_request_Disk_ListDirs_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -173,7 +172,7 @@ func local_request_Disk_ListDirs_0(ctx context.Context, marshaler runtime.Marsha
|
||||
|
||||
func request_Disk_GetDirTree_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -188,7 +187,7 @@ func request_Disk_GetDirTree_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Disk_GetDirTree_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -254,7 +253,7 @@ func local_request_Disk_UploadFile_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func request_Disk_GetFile_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -269,7 +268,7 @@ func request_Disk_GetFile_0(ctx context.Context, marshaler runtime.Marshaler, cl
|
||||
|
||||
func local_request_Disk_GetFile_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -308,7 +307,7 @@ func local_request_Disk_UpdateFile_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func request_Disk_DeleteFile_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -323,7 +322,7 @@ func request_Disk_DeleteFile_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Disk_DeleteFile_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -335,7 +334,7 @@ func local_request_Disk_DeleteFile_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func request_Disk_ListFiles_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -350,7 +349,7 @@ func request_Disk_ListFiles_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Disk_ListFiles_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -416,7 +415,7 @@ func local_request_Disk_CopyFile_0(ctx context.Context, marshaler runtime.Marsha
|
||||
|
||||
func request_Disk_SearchFiles_0(ctx context.Context, marshaler runtime.Marshaler, client DiskClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -431,7 +430,7 @@ func request_Disk_SearchFiles_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func local_request_Disk_SearchFiles_0(ctx context.Context, marshaler runtime.Marshaler, server DiskServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -44,35 +43,35 @@ const (
|
||||
// 云盘目录服务
|
||||
type DiskClient interface {
|
||||
// 创建目录
|
||||
CreateDir(ctx context.Context, in *CreateDirRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CreateDir(ctx context.Context, in *CreateDirRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取目录详情
|
||||
GetDir(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error)
|
||||
GetDir(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error)
|
||||
// 更新目录
|
||||
UpdateDir(ctx context.Context, in *CloudDiskDirItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdateDir(ctx context.Context, in *CloudDiskDirItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除目录
|
||||
DeleteDir(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteDir(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取目录列表
|
||||
ListDirs(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListDirsResponse, error)
|
||||
ListDirs(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListDirsResponse, error)
|
||||
// 获取目录树
|
||||
GetDirTree(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error)
|
||||
GetDirTree(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error)
|
||||
// 移动目录
|
||||
MoveDir(ctx context.Context, in *MoveDirRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
MoveDir(ctx context.Context, in *MoveDirRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 上传文件
|
||||
UploadFile(ctx context.Context, in *CloudDiskFileRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UploadFile(ctx context.Context, in *CloudDiskFileRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取文件详情
|
||||
GetFile(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudDiskFileItem, error)
|
||||
GetFile(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudDiskFileItem, error)
|
||||
// 更新文件
|
||||
UpdateFile(ctx context.Context, in *CloudDiskFileItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdateFile(ctx context.Context, in *CloudDiskFileItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除文件
|
||||
DeleteFile(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteFile(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取文件列表
|
||||
ListFiles(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
|
||||
ListFiles(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
|
||||
// 移动文件
|
||||
MoveFile(ctx context.Context, in *MoveFileRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
MoveFile(ctx context.Context, in *MoveFileRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 复制文件
|
||||
CopyFile(ctx context.Context, in *CopyFileRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CopyFile(ctx context.Context, in *CopyFileRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 搜索文件
|
||||
SearchFiles(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
|
||||
SearchFiles(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error)
|
||||
}
|
||||
|
||||
type diskClient struct {
|
||||
@@ -83,9 +82,9 @@ func NewDiskClient(cc grpc.ClientConnInterface) DiskClient {
|
||||
return &diskClient{cc}
|
||||
}
|
||||
|
||||
func (c *diskClient) CreateDir(ctx context.Context, in *CreateDirRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) CreateDir(ctx context.Context, in *CreateDirRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_CreateDir_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -93,7 +92,7 @@ func (c *diskClient) CreateDir(ctx context.Context, in *CreateDirRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) GetDir(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error) {
|
||||
func (c *diskClient) GetDir(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudDiskDirItem)
|
||||
err := c.cc.Invoke(ctx, Disk_GetDir_FullMethodName, in, out, cOpts...)
|
||||
@@ -103,9 +102,9 @@ func (c *diskClient) GetDir(ctx context.Context, in *protobuf.IdentRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) UpdateDir(ctx context.Context, in *CloudDiskDirItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) UpdateDir(ctx context.Context, in *CloudDiskDirItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_UpdateDir_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -113,9 +112,9 @@ func (c *diskClient) UpdateDir(ctx context.Context, in *CloudDiskDirItem, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) DeleteDir(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) DeleteDir(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_DeleteDir_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -123,7 +122,7 @@ func (c *diskClient) DeleteDir(ctx context.Context, in *protobuf.IdentRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) ListDirs(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListDirsResponse, error) {
|
||||
func (c *diskClient) ListDirs(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListDirsResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListDirsResponse)
|
||||
err := c.cc.Invoke(ctx, Disk_ListDirs_FullMethodName, in, out, cOpts...)
|
||||
@@ -133,7 +132,7 @@ func (c *diskClient) ListDirs(ctx context.Context, in *protobuf.FetchRequest, op
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) GetDirTree(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error) {
|
||||
func (c *diskClient) GetDirTree(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudDiskDirItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudDiskDirItem)
|
||||
err := c.cc.Invoke(ctx, Disk_GetDirTree_FullMethodName, in, out, cOpts...)
|
||||
@@ -143,9 +142,9 @@ func (c *diskClient) GetDirTree(ctx context.Context, in *protobuf.IdentRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) MoveDir(ctx context.Context, in *MoveDirRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) MoveDir(ctx context.Context, in *MoveDirRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_MoveDir_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -153,9 +152,9 @@ func (c *diskClient) MoveDir(ctx context.Context, in *MoveDirRequest, opts ...gr
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) UploadFile(ctx context.Context, in *CloudDiskFileRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) UploadFile(ctx context.Context, in *CloudDiskFileRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_UploadFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -163,7 +162,7 @@ func (c *diskClient) UploadFile(ctx context.Context, in *CloudDiskFileRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) GetFile(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudDiskFileItem, error) {
|
||||
func (c *diskClient) GetFile(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudDiskFileItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudDiskFileItem)
|
||||
err := c.cc.Invoke(ctx, Disk_GetFile_FullMethodName, in, out, cOpts...)
|
||||
@@ -173,9 +172,9 @@ func (c *diskClient) GetFile(ctx context.Context, in *protobuf.IdentRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) UpdateFile(ctx context.Context, in *CloudDiskFileItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) UpdateFile(ctx context.Context, in *CloudDiskFileItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_UpdateFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -183,9 +182,9 @@ func (c *diskClient) UpdateFile(ctx context.Context, in *CloudDiskFileItem, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) DeleteFile(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) DeleteFile(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_DeleteFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -193,7 +192,7 @@ func (c *diskClient) DeleteFile(ctx context.Context, in *protobuf.IdentRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) ListFiles(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
|
||||
func (c *diskClient) ListFiles(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListFilesResponse)
|
||||
err := c.cc.Invoke(ctx, Disk_ListFiles_FullMethodName, in, out, cOpts...)
|
||||
@@ -203,9 +202,9 @@ func (c *diskClient) ListFiles(ctx context.Context, in *protobuf.FetchRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) MoveFile(ctx context.Context, in *MoveFileRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) MoveFile(ctx context.Context, in *MoveFileRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_MoveFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -213,9 +212,9 @@ func (c *diskClient) MoveFile(ctx context.Context, in *MoveFileRequest, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) CopyFile(ctx context.Context, in *CopyFileRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *diskClient) CopyFile(ctx context.Context, in *CopyFileRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Disk_CopyFile_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -223,7 +222,7 @@ func (c *diskClient) CopyFile(ctx context.Context, in *CopyFileRequest, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *diskClient) SearchFiles(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
|
||||
func (c *diskClient) SearchFiles(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListFilesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListFilesResponse)
|
||||
err := c.cc.Invoke(ctx, Disk_SearchFiles_FullMethodName, in, out, cOpts...)
|
||||
@@ -240,35 +239,35 @@ func (c *diskClient) SearchFiles(ctx context.Context, in *protobuf.FetchRequest,
|
||||
// 云盘目录服务
|
||||
type DiskServer interface {
|
||||
// 创建目录
|
||||
CreateDir(context.Context, *CreateDirRequest) (*protobuf.StatusReply, error)
|
||||
CreateDir(context.Context, *CreateDirRequest) (*StatusReply, error)
|
||||
// 获取目录详情
|
||||
GetDir(context.Context, *protobuf.IdentRequest) (*CloudDiskDirItem, error)
|
||||
GetDir(context.Context, *IdentRequest) (*CloudDiskDirItem, error)
|
||||
// 更新目录
|
||||
UpdateDir(context.Context, *CloudDiskDirItem) (*protobuf.StatusReply, error)
|
||||
UpdateDir(context.Context, *CloudDiskDirItem) (*StatusReply, error)
|
||||
// 删除目录
|
||||
DeleteDir(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteDir(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取目录列表
|
||||
ListDirs(context.Context, *protobuf.FetchRequest) (*ListDirsResponse, error)
|
||||
ListDirs(context.Context, *FetchRequest) (*ListDirsResponse, error)
|
||||
// 获取目录树
|
||||
GetDirTree(context.Context, *protobuf.IdentRequest) (*CloudDiskDirItem, error)
|
||||
GetDirTree(context.Context, *IdentRequest) (*CloudDiskDirItem, error)
|
||||
// 移动目录
|
||||
MoveDir(context.Context, *MoveDirRequest) (*protobuf.StatusReply, error)
|
||||
MoveDir(context.Context, *MoveDirRequest) (*StatusReply, error)
|
||||
// 上传文件
|
||||
UploadFile(context.Context, *CloudDiskFileRequest) (*protobuf.StatusReply, error)
|
||||
UploadFile(context.Context, *CloudDiskFileRequest) (*StatusReply, error)
|
||||
// 获取文件详情
|
||||
GetFile(context.Context, *protobuf.IdentRequest) (*CloudDiskFileItem, error)
|
||||
GetFile(context.Context, *IdentRequest) (*CloudDiskFileItem, error)
|
||||
// 更新文件
|
||||
UpdateFile(context.Context, *CloudDiskFileItem) (*protobuf.StatusReply, error)
|
||||
UpdateFile(context.Context, *CloudDiskFileItem) (*StatusReply, error)
|
||||
// 删除文件
|
||||
DeleteFile(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteFile(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取文件列表
|
||||
ListFiles(context.Context, *protobuf.FetchRequest) (*ListFilesResponse, error)
|
||||
ListFiles(context.Context, *FetchRequest) (*ListFilesResponse, error)
|
||||
// 移动文件
|
||||
MoveFile(context.Context, *MoveFileRequest) (*protobuf.StatusReply, error)
|
||||
MoveFile(context.Context, *MoveFileRequest) (*StatusReply, error)
|
||||
// 复制文件
|
||||
CopyFile(context.Context, *CopyFileRequest) (*protobuf.StatusReply, error)
|
||||
CopyFile(context.Context, *CopyFileRequest) (*StatusReply, error)
|
||||
// 搜索文件
|
||||
SearchFiles(context.Context, *protobuf.FetchRequest) (*ListFilesResponse, error)
|
||||
SearchFiles(context.Context, *FetchRequest) (*ListFilesResponse, error)
|
||||
}
|
||||
|
||||
// UnimplementedDiskServer should be embedded to have
|
||||
@@ -278,49 +277,49 @@ type DiskServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedDiskServer struct{}
|
||||
|
||||
func (UnimplementedDiskServer) CreateDir(context.Context, *CreateDirRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) CreateDir(context.Context, *CreateDirRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateDir not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) GetDir(context.Context, *protobuf.IdentRequest) (*CloudDiskDirItem, error) {
|
||||
func (UnimplementedDiskServer) GetDir(context.Context, *IdentRequest) (*CloudDiskDirItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetDir not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) UpdateDir(context.Context, *CloudDiskDirItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) UpdateDir(context.Context, *CloudDiskDirItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateDir not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) DeleteDir(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) DeleteDir(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteDir not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) ListDirs(context.Context, *protobuf.FetchRequest) (*ListDirsResponse, error) {
|
||||
func (UnimplementedDiskServer) ListDirs(context.Context, *FetchRequest) (*ListDirsResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListDirs not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) GetDirTree(context.Context, *protobuf.IdentRequest) (*CloudDiskDirItem, error) {
|
||||
func (UnimplementedDiskServer) GetDirTree(context.Context, *IdentRequest) (*CloudDiskDirItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetDirTree not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) MoveDir(context.Context, *MoveDirRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) MoveDir(context.Context, *MoveDirRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method MoveDir not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) UploadFile(context.Context, *CloudDiskFileRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) UploadFile(context.Context, *CloudDiskFileRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UploadFile not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) GetFile(context.Context, *protobuf.IdentRequest) (*CloudDiskFileItem, error) {
|
||||
func (UnimplementedDiskServer) GetFile(context.Context, *IdentRequest) (*CloudDiskFileItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetFile not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) UpdateFile(context.Context, *CloudDiskFileItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) UpdateFile(context.Context, *CloudDiskFileItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateFile not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) DeleteFile(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) DeleteFile(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteFile not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) ListFiles(context.Context, *protobuf.FetchRequest) (*ListFilesResponse, error) {
|
||||
func (UnimplementedDiskServer) ListFiles(context.Context, *FetchRequest) (*ListFilesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListFiles not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) MoveFile(context.Context, *MoveFileRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) MoveFile(context.Context, *MoveFileRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method MoveFile not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) CopyFile(context.Context, *CopyFileRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedDiskServer) CopyFile(context.Context, *CopyFileRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CopyFile not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) SearchFiles(context.Context, *protobuf.FetchRequest) (*ListFilesResponse, error) {
|
||||
func (UnimplementedDiskServer) SearchFiles(context.Context, *FetchRequest) (*ListFilesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SearchFiles not implemented")
|
||||
}
|
||||
func (UnimplementedDiskServer) testEmbeddedByValue() {}
|
||||
@@ -362,7 +361,7 @@ func _Disk_CreateDir_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
}
|
||||
|
||||
func _Disk_GetDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -374,7 +373,7 @@ func _Disk_GetDir_Handler(srv interface{}, ctx context.Context, dec func(interfa
|
||||
FullMethod: Disk_GetDir_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).GetDir(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(DiskServer).GetDir(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -398,7 +397,7 @@ func _Disk_UpdateDir_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
}
|
||||
|
||||
func _Disk_DeleteDir_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -410,13 +409,13 @@ func _Disk_DeleteDir_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Disk_DeleteDir_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).DeleteDir(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(DiskServer).DeleteDir(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Disk_ListDirs_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -428,13 +427,13 @@ func _Disk_ListDirs_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
FullMethod: Disk_ListDirs_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).ListDirs(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(DiskServer).ListDirs(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Disk_GetDirTree_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -446,7 +445,7 @@ func _Disk_GetDirTree_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
FullMethod: Disk_GetDirTree_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).GetDirTree(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(DiskServer).GetDirTree(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -488,7 +487,7 @@ func _Disk_UploadFile_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
}
|
||||
|
||||
func _Disk_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -500,7 +499,7 @@ func _Disk_GetFile_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Disk_GetFile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).GetFile(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(DiskServer).GetFile(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -524,7 +523,7 @@ func _Disk_UpdateFile_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
}
|
||||
|
||||
func _Disk_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -536,13 +535,13 @@ func _Disk_DeleteFile_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
FullMethod: Disk_DeleteFile_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).DeleteFile(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(DiskServer).DeleteFile(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Disk_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -554,7 +553,7 @@ func _Disk_ListFiles_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Disk_ListFiles_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).ListFiles(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(DiskServer).ListFiles(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -596,7 +595,7 @@ func _Disk_CopyFile_Handler(srv interface{}, ctx context.Context, dec func(inter
|
||||
}
|
||||
|
||||
func _Disk_SearchFiles_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -608,7 +607,7 @@ func _Disk_SearchFiles_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Disk_SearchFiles_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(DiskServer).SearchFiles(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(DiskServer).SearchFiles(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -474,7 +473,7 @@ var File_module_base_cloud_proto_note_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_note_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"\"module/base/cloud/proto/note.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\"\x92\x02\n" +
|
||||
"\"module/base/cloud/proto/note.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\"\x92\x02\n" +
|
||||
"\x11CreateNoteRequest\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\x12\x14\n" +
|
||||
@@ -550,14 +549,14 @@ func file_module_base_cloud_proto_note_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cloud_proto_note_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
|
||||
var file_module_base_cloud_proto_note_proto_goTypes = []any{
|
||||
(*CreateNoteRequest)(nil), // 0: cloud.CreateNoteRequest
|
||||
(*ListNotesResponse)(nil), // 1: cloud.ListNotesResponse
|
||||
(*TogglePinRequest)(nil), // 2: cloud.TogglePinRequest
|
||||
(*CloudNoteItem)(nil), // 3: cloud.CloudNoteItem
|
||||
(*NoteAttachmentItem)(nil), // 4: cloud.NoteAttachmentItem
|
||||
(*protobuf.IdentRequest)(nil), // 5: blocks.IdentRequest
|
||||
(*protobuf.FetchRequest)(nil), // 6: blocks.FetchRequest
|
||||
(*protobuf.StatusReply)(nil), // 7: blocks.StatusReply
|
||||
(*CreateNoteRequest)(nil), // 0: cloud.CreateNoteRequest
|
||||
(*ListNotesResponse)(nil), // 1: cloud.ListNotesResponse
|
||||
(*TogglePinRequest)(nil), // 2: cloud.TogglePinRequest
|
||||
(*CloudNoteItem)(nil), // 3: cloud.CloudNoteItem
|
||||
(*NoteAttachmentItem)(nil), // 4: cloud.NoteAttachmentItem
|
||||
(*IdentRequest)(nil), // 5: blocks.IdentRequest
|
||||
(*FetchRequest)(nil), // 6: blocks.FetchRequest
|
||||
(*StatusReply)(nil), // 7: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cloud_proto_note_proto_depIdxs = []int32{
|
||||
3, // 0: cloud.ListNotesResponse.notes:type_name -> cloud.CloudNoteItem
|
||||
@@ -594,6 +593,7 @@ func file_module_base_cloud_proto_note_proto_init() {
|
||||
if File_module_base_cloud_proto_note_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,7 @@ func local_request_Note_CreateNote_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func request_Note_GetNote_0(ctx context.Context, marshaler runtime.Marshaler, client NoteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Note_GetNote_0(ctx context.Context, marshaler runtime.Marshaler, cl
|
||||
|
||||
func local_request_Note_GetNote_0(ctx context.Context, marshaler runtime.Marshaler, server NoteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Note_UpdateNote_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func request_Note_DeleteNote_0(ctx context.Context, marshaler runtime.Marshaler, client NoteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Note_DeleteNote_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Note_DeleteNote_0(ctx context.Context, marshaler runtime.Marshaler, server NoteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -146,7 +145,7 @@ func local_request_Note_DeleteNote_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func request_Note_ListNotes_0(ctx context.Context, marshaler runtime.Marshaler, client NoteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -161,7 +160,7 @@ func request_Note_ListNotes_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Note_ListNotes_0(ctx context.Context, marshaler runtime.Marshaler, server NoteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -200,7 +199,7 @@ func local_request_Note_TogglePin_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func request_Note_IncrementViews_0(ctx context.Context, marshaler runtime.Marshaler, client NoteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -215,7 +214,7 @@ func request_Note_IncrementViews_0(ctx context.Context, marshaler runtime.Marsha
|
||||
|
||||
func local_request_Note_IncrementViews_0(ctx context.Context, marshaler runtime.Marshaler, server NoteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -227,7 +226,7 @@ func local_request_Note_IncrementViews_0(ctx context.Context, marshaler runtime.
|
||||
|
||||
func request_Note_SearchNotes_0(ctx context.Context, marshaler runtime.Marshaler, client NoteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -242,7 +241,7 @@ func request_Note_SearchNotes_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func local_request_Note_SearchNotes_0(ctx context.Context, marshaler runtime.Marshaler, server NoteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -281,7 +280,7 @@ func local_request_Note_InsertAttachment_0(ctx context.Context, marshaler runtim
|
||||
|
||||
func request_Note_DeleteAttachment_0(ctx context.Context, marshaler runtime.Marshaler, client NoteClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -296,7 +295,7 @@ func request_Note_DeleteAttachment_0(ctx context.Context, marshaler runtime.Mars
|
||||
|
||||
func local_request_Note_DeleteAttachment_0(ctx context.Context, marshaler runtime.Marshaler, server NoteServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -39,25 +38,25 @@ const (
|
||||
// 笔记服务
|
||||
type NoteClient interface {
|
||||
// 创建笔记
|
||||
CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取笔记详情
|
||||
GetNote(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudNoteItem, error)
|
||||
GetNote(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudNoteItem, error)
|
||||
// 更新笔记
|
||||
UpdateNote(ctx context.Context, in *CloudNoteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdateNote(ctx context.Context, in *CloudNoteItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除笔记
|
||||
DeleteNote(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteNote(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取笔记列表
|
||||
ListNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error)
|
||||
ListNotes(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error)
|
||||
// 置顶/取消置顶笔记
|
||||
TogglePin(ctx context.Context, in *TogglePinRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
TogglePin(ctx context.Context, in *TogglePinRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 增加浏览次数
|
||||
IncrementViews(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
IncrementViews(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 搜索笔记
|
||||
SearchNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error)
|
||||
SearchNotes(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error)
|
||||
// 上传附件
|
||||
InsertAttachment(ctx context.Context, in *NoteAttachmentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
InsertAttachment(ctx context.Context, in *NoteAttachmentItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除附件
|
||||
DeleteAttachment(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteAttachment(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type noteClient struct {
|
||||
@@ -68,9 +67,9 @@ func NewNoteClient(cc grpc.ClientConnInterface) NoteClient {
|
||||
return ¬eClient{cc}
|
||||
}
|
||||
|
||||
func (c *noteClient) CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) CreateNote(ctx context.Context, in *CreateNoteRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_CreateNote_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -78,7 +77,7 @@ func (c *noteClient) CreateNote(ctx context.Context, in *CreateNoteRequest, opts
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) GetNote(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudNoteItem, error) {
|
||||
func (c *noteClient) GetNote(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudNoteItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudNoteItem)
|
||||
err := c.cc.Invoke(ctx, Note_GetNote_FullMethodName, in, out, cOpts...)
|
||||
@@ -88,9 +87,9 @@ func (c *noteClient) GetNote(ctx context.Context, in *protobuf.IdentRequest, opt
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) UpdateNote(ctx context.Context, in *CloudNoteItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) UpdateNote(ctx context.Context, in *CloudNoteItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_UpdateNote_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -98,9 +97,9 @@ func (c *noteClient) UpdateNote(ctx context.Context, in *CloudNoteItem, opts ...
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) DeleteNote(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) DeleteNote(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_DeleteNote_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -108,7 +107,7 @@ func (c *noteClient) DeleteNote(ctx context.Context, in *protobuf.IdentRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) ListNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) {
|
||||
func (c *noteClient) ListNotes(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListNotesResponse)
|
||||
err := c.cc.Invoke(ctx, Note_ListNotes_FullMethodName, in, out, cOpts...)
|
||||
@@ -118,9 +117,9 @@ func (c *noteClient) ListNotes(ctx context.Context, in *protobuf.FetchRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) TogglePin(ctx context.Context, in *TogglePinRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) TogglePin(ctx context.Context, in *TogglePinRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_TogglePin_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -128,9 +127,9 @@ func (c *noteClient) TogglePin(ctx context.Context, in *TogglePinRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) IncrementViews(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) IncrementViews(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_IncrementViews_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -138,7 +137,7 @@ func (c *noteClient) IncrementViews(ctx context.Context, in *protobuf.IdentReque
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) SearchNotes(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) {
|
||||
func (c *noteClient) SearchNotes(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListNotesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListNotesResponse)
|
||||
err := c.cc.Invoke(ctx, Note_SearchNotes_FullMethodName, in, out, cOpts...)
|
||||
@@ -148,9 +147,9 @@ func (c *noteClient) SearchNotes(ctx context.Context, in *protobuf.FetchRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) InsertAttachment(ctx context.Context, in *NoteAttachmentItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) InsertAttachment(ctx context.Context, in *NoteAttachmentItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_InsertAttachment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -158,9 +157,9 @@ func (c *noteClient) InsertAttachment(ctx context.Context, in *NoteAttachmentIte
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *noteClient) DeleteAttachment(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *noteClient) DeleteAttachment(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Note_DeleteAttachment_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -175,25 +174,25 @@ func (c *noteClient) DeleteAttachment(ctx context.Context, in *protobuf.IdentReq
|
||||
// 笔记服务
|
||||
type NoteServer interface {
|
||||
// 创建笔记
|
||||
CreateNote(context.Context, *CreateNoteRequest) (*protobuf.StatusReply, error)
|
||||
CreateNote(context.Context, *CreateNoteRequest) (*StatusReply, error)
|
||||
// 获取笔记详情
|
||||
GetNote(context.Context, *protobuf.IdentRequest) (*CloudNoteItem, error)
|
||||
GetNote(context.Context, *IdentRequest) (*CloudNoteItem, error)
|
||||
// 更新笔记
|
||||
UpdateNote(context.Context, *CloudNoteItem) (*protobuf.StatusReply, error)
|
||||
UpdateNote(context.Context, *CloudNoteItem) (*StatusReply, error)
|
||||
// 删除笔记
|
||||
DeleteNote(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteNote(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取笔记列表
|
||||
ListNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error)
|
||||
ListNotes(context.Context, *FetchRequest) (*ListNotesResponse, error)
|
||||
// 置顶/取消置顶笔记
|
||||
TogglePin(context.Context, *TogglePinRequest) (*protobuf.StatusReply, error)
|
||||
TogglePin(context.Context, *TogglePinRequest) (*StatusReply, error)
|
||||
// 增加浏览次数
|
||||
IncrementViews(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
IncrementViews(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 搜索笔记
|
||||
SearchNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error)
|
||||
SearchNotes(context.Context, *FetchRequest) (*ListNotesResponse, error)
|
||||
// 上传附件
|
||||
InsertAttachment(context.Context, *NoteAttachmentItem) (*protobuf.StatusReply, error)
|
||||
InsertAttachment(context.Context, *NoteAttachmentItem) (*StatusReply, error)
|
||||
// 删除附件
|
||||
DeleteAttachment(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteAttachment(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedNoteServer should be embedded to have
|
||||
@@ -203,34 +202,34 @@ type NoteServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedNoteServer struct{}
|
||||
|
||||
func (UnimplementedNoteServer) CreateNote(context.Context, *CreateNoteRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) CreateNote(context.Context, *CreateNoteRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateNote not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) GetNote(context.Context, *protobuf.IdentRequest) (*CloudNoteItem, error) {
|
||||
func (UnimplementedNoteServer) GetNote(context.Context, *IdentRequest) (*CloudNoteItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetNote not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) UpdateNote(context.Context, *CloudNoteItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) UpdateNote(context.Context, *CloudNoteItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdateNote not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) DeleteNote(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) DeleteNote(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteNote not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) ListNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error) {
|
||||
func (UnimplementedNoteServer) ListNotes(context.Context, *FetchRequest) (*ListNotesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListNotes not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) TogglePin(context.Context, *TogglePinRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) TogglePin(context.Context, *TogglePinRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method TogglePin not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) IncrementViews(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) IncrementViews(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method IncrementViews not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) SearchNotes(context.Context, *protobuf.FetchRequest) (*ListNotesResponse, error) {
|
||||
func (UnimplementedNoteServer) SearchNotes(context.Context, *FetchRequest) (*ListNotesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SearchNotes not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) InsertAttachment(context.Context, *NoteAttachmentItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) InsertAttachment(context.Context, *NoteAttachmentItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method InsertAttachment not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) DeleteAttachment(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedNoteServer) DeleteAttachment(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteAttachment not implemented")
|
||||
}
|
||||
func (UnimplementedNoteServer) testEmbeddedByValue() {}
|
||||
@@ -272,7 +271,7 @@ func _Note_CreateNote_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
}
|
||||
|
||||
func _Note_GetNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -284,7 +283,7 @@ func _Note_GetNote_Handler(srv interface{}, ctx context.Context, dec func(interf
|
||||
FullMethod: Note_GetNote_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NoteServer).GetNote(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(NoteServer).GetNote(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -308,7 +307,7 @@ func _Note_UpdateNote_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
}
|
||||
|
||||
func _Note_DeleteNote_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -320,13 +319,13 @@ func _Note_DeleteNote_Handler(srv interface{}, ctx context.Context, dec func(int
|
||||
FullMethod: Note_DeleteNote_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NoteServer).DeleteNote(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(NoteServer).DeleteNote(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Note_ListNotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -338,7 +337,7 @@ func _Note_ListNotes_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Note_ListNotes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NoteServer).ListNotes(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(NoteServer).ListNotes(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -362,7 +361,7 @@ func _Note_TogglePin_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
}
|
||||
|
||||
func _Note_IncrementViews_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -374,13 +373,13 @@ func _Note_IncrementViews_Handler(srv interface{}, ctx context.Context, dec func
|
||||
FullMethod: Note_IncrementViews_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NoteServer).IncrementViews(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(NoteServer).IncrementViews(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Note_SearchNotes_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -392,7 +391,7 @@ func _Note_SearchNotes_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Note_SearchNotes_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NoteServer).SearchNotes(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(NoteServer).SearchNotes(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -416,7 +415,7 @@ func _Note_InsertAttachment_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
}
|
||||
|
||||
func _Note_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -428,7 +427,7 @@ func _Note_DeleteAttachment_Handler(srv interface{}, ctx context.Context, dec fu
|
||||
FullMethod: Note_DeleteAttachment_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(NoteServer).DeleteAttachment(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(NoteServer).DeleteAttachment(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -348,7 +347,7 @@ var File_module_base_cloud_proto_private_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_private_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"%module/base/cloud/proto/private.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\"\xfc\x01\n" +
|
||||
"%module/base/cloud/proto/private.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\"\xfc\x01\n" +
|
||||
"\x18CreatePrivateDataRequest\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\x12\x1b\n" +
|
||||
@@ -407,9 +406,9 @@ var file_module_base_cloud_proto_private_proto_goTypes = []any{
|
||||
(*ListPrivateDataResponse)(nil), // 1: cloud.ListPrivateDataResponse
|
||||
(*DataRequest)(nil), // 2: cloud.DataRequest
|
||||
(*CloudPrivateItem)(nil), // 3: cloud.CloudPrivateItem
|
||||
(*protobuf.IdentRequest)(nil), // 4: blocks.IdentRequest
|
||||
(*protobuf.FetchRequest)(nil), // 5: blocks.FetchRequest
|
||||
(*protobuf.StatusReply)(nil), // 6: blocks.StatusReply
|
||||
(*IdentRequest)(nil), // 4: blocks.IdentRequest
|
||||
(*FetchRequest)(nil), // 5: blocks.FetchRequest
|
||||
(*StatusReply)(nil), // 6: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cloud_proto_private_proto_depIdxs = []int32{
|
||||
3, // 0: cloud.ListPrivateDataResponse.data:type_name -> cloud.CloudPrivateItem
|
||||
@@ -443,6 +442,7 @@ func file_module_base_cloud_proto_private_proto_init() {
|
||||
if File_module_base_cloud_proto_private_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,7 @@ func local_request_Private_CreatePrivateData_0(ctx context.Context, marshaler ru
|
||||
|
||||
func request_Private_GetPrivateData_0(ctx context.Context, marshaler runtime.Marshaler, client PrivateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Private_GetPrivateData_0(ctx context.Context, marshaler runtime.Mar
|
||||
|
||||
func local_request_Private_GetPrivateData_0(ctx context.Context, marshaler runtime.Marshaler, server PrivateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Private_UpdatePrivateData_0(ctx context.Context, marshaler ru
|
||||
|
||||
func request_Private_DeletePrivateData_0(ctx context.Context, marshaler runtime.Marshaler, client PrivateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Private_DeletePrivateData_0(ctx context.Context, marshaler runtime.
|
||||
|
||||
func local_request_Private_DeletePrivateData_0(ctx context.Context, marshaler runtime.Marshaler, server PrivateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -146,7 +145,7 @@ func local_request_Private_DeletePrivateData_0(ctx context.Context, marshaler ru
|
||||
|
||||
func request_Private_ListPrivateData_0(ctx context.Context, marshaler runtime.Marshaler, client PrivateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -161,7 +160,7 @@ func request_Private_ListPrivateData_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func local_request_Private_ListPrivateData_0(ctx context.Context, marshaler runtime.Marshaler, server PrivateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -173,7 +172,7 @@ func local_request_Private_ListPrivateData_0(ctx context.Context, marshaler runt
|
||||
|
||||
func request_Private_GetPrivateDataByType_0(ctx context.Context, marshaler runtime.Marshaler, client PrivateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -188,7 +187,7 @@ func request_Private_GetPrivateDataByType_0(ctx context.Context, marshaler runti
|
||||
|
||||
func local_request_Private_GetPrivateDataByType_0(ctx context.Context, marshaler runtime.Marshaler, server PrivateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -200,7 +199,7 @@ func local_request_Private_GetPrivateDataByType_0(ctx context.Context, marshaler
|
||||
|
||||
func request_Private_SearchPrivateData_0(ctx context.Context, marshaler runtime.Marshaler, client PrivateClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -215,7 +214,7 @@ func request_Private_SearchPrivateData_0(ctx context.Context, marshaler runtime.
|
||||
|
||||
func local_request_Private_SearchPrivateData_0(ctx context.Context, marshaler runtime.Marshaler, server PrivateServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -38,23 +37,23 @@ const (
|
||||
// 隐私数据服务
|
||||
type PrivateClient interface {
|
||||
// 创建隐私数据
|
||||
CreatePrivateData(ctx context.Context, in *CreatePrivateDataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CreatePrivateData(ctx context.Context, in *CreatePrivateDataRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取隐私数据详情
|
||||
GetPrivateData(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudPrivateItem, error)
|
||||
GetPrivateData(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudPrivateItem, error)
|
||||
// 更新隐私数据
|
||||
UpdatePrivateData(ctx context.Context, in *CloudPrivateItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
UpdatePrivateData(ctx context.Context, in *CloudPrivateItem, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 删除隐私数据
|
||||
DeletePrivateData(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeletePrivateData(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取隐私数据列表
|
||||
ListPrivateData(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error)
|
||||
ListPrivateData(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error)
|
||||
// 按类型获取隐私数据
|
||||
GetPrivateDataByType(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error)
|
||||
GetPrivateDataByType(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error)
|
||||
// 搜索隐私数据
|
||||
SearchPrivateData(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error)
|
||||
SearchPrivateData(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error)
|
||||
// 加密数据
|
||||
EncryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
EncryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 解密数据
|
||||
DecryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DecryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type privateClient struct {
|
||||
@@ -65,9 +64,9 @@ func NewPrivateClient(cc grpc.ClientConnInterface) PrivateClient {
|
||||
return &privateClient{cc}
|
||||
}
|
||||
|
||||
func (c *privateClient) CreatePrivateData(ctx context.Context, in *CreatePrivateDataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *privateClient) CreatePrivateData(ctx context.Context, in *CreatePrivateDataRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Private_CreatePrivateData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -75,7 +74,7 @@ func (c *privateClient) CreatePrivateData(ctx context.Context, in *CreatePrivate
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) GetPrivateData(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudPrivateItem, error) {
|
||||
func (c *privateClient) GetPrivateData(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudPrivateItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudPrivateItem)
|
||||
err := c.cc.Invoke(ctx, Private_GetPrivateData_FullMethodName, in, out, cOpts...)
|
||||
@@ -85,9 +84,9 @@ func (c *privateClient) GetPrivateData(ctx context.Context, in *protobuf.IdentRe
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) UpdatePrivateData(ctx context.Context, in *CloudPrivateItem, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *privateClient) UpdatePrivateData(ctx context.Context, in *CloudPrivateItem, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Private_UpdatePrivateData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -95,9 +94,9 @@ func (c *privateClient) UpdatePrivateData(ctx context.Context, in *CloudPrivateI
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) DeletePrivateData(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *privateClient) DeletePrivateData(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Private_DeletePrivateData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -105,7 +104,7 @@ func (c *privateClient) DeletePrivateData(ctx context.Context, in *protobuf.Iden
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) ListPrivateData(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error) {
|
||||
func (c *privateClient) ListPrivateData(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPrivateDataResponse)
|
||||
err := c.cc.Invoke(ctx, Private_ListPrivateData_FullMethodName, in, out, cOpts...)
|
||||
@@ -115,7 +114,7 @@ func (c *privateClient) ListPrivateData(ctx context.Context, in *protobuf.FetchR
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) GetPrivateDataByType(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error) {
|
||||
func (c *privateClient) GetPrivateDataByType(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPrivateDataResponse)
|
||||
err := c.cc.Invoke(ctx, Private_GetPrivateDataByType_FullMethodName, in, out, cOpts...)
|
||||
@@ -125,7 +124,7 @@ func (c *privateClient) GetPrivateDataByType(ctx context.Context, in *protobuf.F
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) SearchPrivateData(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error) {
|
||||
func (c *privateClient) SearchPrivateData(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListPrivateDataResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListPrivateDataResponse)
|
||||
err := c.cc.Invoke(ctx, Private_SearchPrivateData_FullMethodName, in, out, cOpts...)
|
||||
@@ -135,9 +134,9 @@ func (c *privateClient) SearchPrivateData(ctx context.Context, in *protobuf.Fetc
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) EncryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *privateClient) EncryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Private_EncryptData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -145,9 +144,9 @@ func (c *privateClient) EncryptData(ctx context.Context, in *DataRequest, opts .
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *privateClient) DecryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *privateClient) DecryptData(ctx context.Context, in *DataRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Private_DecryptData_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -162,23 +161,23 @@ func (c *privateClient) DecryptData(ctx context.Context, in *DataRequest, opts .
|
||||
// 隐私数据服务
|
||||
type PrivateServer interface {
|
||||
// 创建隐私数据
|
||||
CreatePrivateData(context.Context, *CreatePrivateDataRequest) (*protobuf.StatusReply, error)
|
||||
CreatePrivateData(context.Context, *CreatePrivateDataRequest) (*StatusReply, error)
|
||||
// 获取隐私数据详情
|
||||
GetPrivateData(context.Context, *protobuf.IdentRequest) (*CloudPrivateItem, error)
|
||||
GetPrivateData(context.Context, *IdentRequest) (*CloudPrivateItem, error)
|
||||
// 更新隐私数据
|
||||
UpdatePrivateData(context.Context, *CloudPrivateItem) (*protobuf.StatusReply, error)
|
||||
UpdatePrivateData(context.Context, *CloudPrivateItem) (*StatusReply, error)
|
||||
// 删除隐私数据
|
||||
DeletePrivateData(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeletePrivateData(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取隐私数据列表
|
||||
ListPrivateData(context.Context, *protobuf.FetchRequest) (*ListPrivateDataResponse, error)
|
||||
ListPrivateData(context.Context, *FetchRequest) (*ListPrivateDataResponse, error)
|
||||
// 按类型获取隐私数据
|
||||
GetPrivateDataByType(context.Context, *protobuf.FetchRequest) (*ListPrivateDataResponse, error)
|
||||
GetPrivateDataByType(context.Context, *FetchRequest) (*ListPrivateDataResponse, error)
|
||||
// 搜索隐私数据
|
||||
SearchPrivateData(context.Context, *protobuf.FetchRequest) (*ListPrivateDataResponse, error)
|
||||
SearchPrivateData(context.Context, *FetchRequest) (*ListPrivateDataResponse, error)
|
||||
// 加密数据
|
||||
EncryptData(context.Context, *DataRequest) (*protobuf.StatusReply, error)
|
||||
EncryptData(context.Context, *DataRequest) (*StatusReply, error)
|
||||
// 解密数据
|
||||
DecryptData(context.Context, *DataRequest) (*protobuf.StatusReply, error)
|
||||
DecryptData(context.Context, *DataRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedPrivateServer should be embedded to have
|
||||
@@ -188,31 +187,31 @@ type PrivateServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedPrivateServer struct{}
|
||||
|
||||
func (UnimplementedPrivateServer) CreatePrivateData(context.Context, *CreatePrivateDataRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPrivateServer) CreatePrivateData(context.Context, *CreatePrivateDataRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreatePrivateData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) GetPrivateData(context.Context, *protobuf.IdentRequest) (*CloudPrivateItem, error) {
|
||||
func (UnimplementedPrivateServer) GetPrivateData(context.Context, *IdentRequest) (*CloudPrivateItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPrivateData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) UpdatePrivateData(context.Context, *CloudPrivateItem) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPrivateServer) UpdatePrivateData(context.Context, *CloudPrivateItem) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method UpdatePrivateData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) DeletePrivateData(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPrivateServer) DeletePrivateData(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeletePrivateData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) ListPrivateData(context.Context, *protobuf.FetchRequest) (*ListPrivateDataResponse, error) {
|
||||
func (UnimplementedPrivateServer) ListPrivateData(context.Context, *FetchRequest) (*ListPrivateDataResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListPrivateData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) GetPrivateDataByType(context.Context, *protobuf.FetchRequest) (*ListPrivateDataResponse, error) {
|
||||
func (UnimplementedPrivateServer) GetPrivateDataByType(context.Context, *FetchRequest) (*ListPrivateDataResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetPrivateDataByType not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) SearchPrivateData(context.Context, *protobuf.FetchRequest) (*ListPrivateDataResponse, error) {
|
||||
func (UnimplementedPrivateServer) SearchPrivateData(context.Context, *FetchRequest) (*ListPrivateDataResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method SearchPrivateData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) EncryptData(context.Context, *DataRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPrivateServer) EncryptData(context.Context, *DataRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method EncryptData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) DecryptData(context.Context, *DataRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedPrivateServer) DecryptData(context.Context, *DataRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DecryptData not implemented")
|
||||
}
|
||||
func (UnimplementedPrivateServer) testEmbeddedByValue() {}
|
||||
@@ -254,7 +253,7 @@ func _Private_CreatePrivateData_Handler(srv interface{}, ctx context.Context, de
|
||||
}
|
||||
|
||||
func _Private_GetPrivateData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -266,7 +265,7 @@ func _Private_GetPrivateData_Handler(srv interface{}, ctx context.Context, dec f
|
||||
FullMethod: Private_GetPrivateData_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PrivateServer).GetPrivateData(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(PrivateServer).GetPrivateData(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
@@ -290,7 +289,7 @@ func _Private_UpdatePrivateData_Handler(srv interface{}, ctx context.Context, de
|
||||
}
|
||||
|
||||
func _Private_DeletePrivateData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -302,13 +301,13 @@ func _Private_DeletePrivateData_Handler(srv interface{}, ctx context.Context, de
|
||||
FullMethod: Private_DeletePrivateData_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PrivateServer).DeletePrivateData(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(PrivateServer).DeletePrivateData(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Private_ListPrivateData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -320,13 +319,13 @@ func _Private_ListPrivateData_Handler(srv interface{}, ctx context.Context, dec
|
||||
FullMethod: Private_ListPrivateData_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PrivateServer).ListPrivateData(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(PrivateServer).ListPrivateData(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Private_GetPrivateDataByType_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -338,13 +337,13 @@ func _Private_GetPrivateDataByType_Handler(srv interface{}, ctx context.Context,
|
||||
FullMethod: Private_GetPrivateDataByType_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PrivateServer).GetPrivateDataByType(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(PrivateServer).GetPrivateDataByType(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Private_SearchPrivateData_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -356,7 +355,7 @@ func _Private_SearchPrivateData_Handler(srv interface{}, ctx context.Context, de
|
||||
FullMethod: Private_SearchPrivateData_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(PrivateServer).SearchPrivateData(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(PrivateServer).SearchPrivateData(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -364,7 +363,7 @@ var File_module_base_cloud_proto_share_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_share_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"#module/base/cloud/proto/share.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\"\x8f\x02\n" +
|
||||
"#module/base/cloud/proto/share.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\"\x8f\x02\n" +
|
||||
"\x12CreateShareRequest\x12\x19\n" +
|
||||
"\bcloud_id\x18\x01 \x01(\x04R\acloudId\x12%\n" +
|
||||
"\x0ecloud_identity\x18\x02 \x01(\tR\rcloudIdentity\x12\x1d\n" +
|
||||
@@ -431,9 +430,9 @@ var file_module_base_cloud_proto_share_proto_goTypes = []any{
|
||||
(*ListSharesResponse)(nil), // 1: cloud.ListSharesResponse
|
||||
(*ValidateSharePasswordRequest)(nil), // 2: cloud.ValidateSharePasswordRequest
|
||||
(*CloudShareItem)(nil), // 3: cloud.CloudShareItem
|
||||
(*protobuf.IdentRequest)(nil), // 4: blocks.IdentRequest
|
||||
(*protobuf.FetchRequest)(nil), // 5: blocks.FetchRequest
|
||||
(*protobuf.StatusReply)(nil), // 6: blocks.StatusReply
|
||||
(*IdentRequest)(nil), // 4: blocks.IdentRequest
|
||||
(*FetchRequest)(nil), // 5: blocks.FetchRequest
|
||||
(*StatusReply)(nil), // 6: blocks.StatusReply
|
||||
}
|
||||
var file_module_base_cloud_proto_share_proto_depIdxs = []int32{
|
||||
3, // 0: cloud.ListSharesResponse.shares:type_name -> cloud.CloudShareItem
|
||||
@@ -459,6 +458,7 @@ func file_module_base_cloud_proto_share_proto_init() {
|
||||
if File_module_base_cloud_proto_share_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
type x struct{}
|
||||
out := protoimpl.TypeBuilder{
|
||||
File: protoimpl.DescBuilder{
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -65,7 +64,7 @@ func local_request_Share_CreateShare_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Share_GetShare_0(ctx context.Context, marshaler runtime.Marshaler, client ShareClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Share_GetShare_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func local_request_Share_GetShare_0(ctx context.Context, marshaler runtime.Marshaler, server ShareServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -92,7 +91,7 @@ func local_request_Share_GetShare_0(ctx context.Context, marshaler runtime.Marsh
|
||||
|
||||
func request_Share_DeleteShare_0(ctx context.Context, marshaler runtime.Marshaler, client ShareClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -107,7 +106,7 @@ func request_Share_DeleteShare_0(ctx context.Context, marshaler runtime.Marshale
|
||||
|
||||
func local_request_Share_DeleteShare_0(ctx context.Context, marshaler runtime.Marshaler, server ShareServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -119,7 +118,7 @@ func local_request_Share_DeleteShare_0(ctx context.Context, marshaler runtime.Ma
|
||||
|
||||
func request_Share_ListShares_0(ctx context.Context, marshaler runtime.Marshaler, client ShareClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -134,7 +133,7 @@ func request_Share_ListShares_0(ctx context.Context, marshaler runtime.Marshaler
|
||||
|
||||
func local_request_Share_ListShares_0(ctx context.Context, marshaler runtime.Marshaler, server ShareServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.FetchRequest
|
||||
protoReq FetchRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -34,15 +33,15 @@ const (
|
||||
// 分享服务
|
||||
type ShareClient interface {
|
||||
// 创建分享
|
||||
CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取分享详情
|
||||
GetShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error)
|
||||
GetShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error)
|
||||
// 删除分享
|
||||
DeleteShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
DeleteShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
// 获取分享列表
|
||||
ListShares(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error)
|
||||
ListShares(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error)
|
||||
// 验证分享密码
|
||||
ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error)
|
||||
ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*StatusReply, error)
|
||||
}
|
||||
|
||||
type shareClient struct {
|
||||
@@ -53,9 +52,9 @@ func NewShareClient(cc grpc.ClientConnInterface) ShareClient {
|
||||
return &shareClient{cc}
|
||||
}
|
||||
|
||||
func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Share_CreateShare_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -63,7 +62,7 @@ func (c *shareClient) CreateShare(ctx context.Context, in *CreateShareRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *shareClient) GetShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error) {
|
||||
func (c *shareClient) GetShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudShareItem, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudShareItem)
|
||||
err := c.cc.Invoke(ctx, Share_GetShare_FullMethodName, in, out, cOpts...)
|
||||
@@ -73,9 +72,9 @@ func (c *shareClient) GetShare(ctx context.Context, in *protobuf.IdentRequest, o
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *shareClient) DeleteShare(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *shareClient) DeleteShare(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Share_DeleteShare_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -83,7 +82,7 @@ func (c *shareClient) DeleteShare(ctx context.Context, in *protobuf.IdentRequest
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *shareClient) ListShares(ctx context.Context, in *protobuf.FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error) {
|
||||
func (c *shareClient) ListShares(ctx context.Context, in *FetchRequest, opts ...grpc.CallOption) (*ListSharesResponse, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(ListSharesResponse)
|
||||
err := c.cc.Invoke(ctx, Share_ListShares_FullMethodName, in, out, cOpts...)
|
||||
@@ -93,9 +92,9 @@ func (c *shareClient) ListShares(ctx context.Context, in *protobuf.FetchRequest,
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*protobuf.StatusReply, error) {
|
||||
func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSharePasswordRequest, opts ...grpc.CallOption) (*StatusReply, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(protobuf.StatusReply)
|
||||
out := new(StatusReply)
|
||||
err := c.cc.Invoke(ctx, Share_ValidateSharePassword_FullMethodName, in, out, cOpts...)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
@@ -110,15 +109,15 @@ func (c *shareClient) ValidateSharePassword(ctx context.Context, in *ValidateSha
|
||||
// 分享服务
|
||||
type ShareServer interface {
|
||||
// 创建分享
|
||||
CreateShare(context.Context, *CreateShareRequest) (*protobuf.StatusReply, error)
|
||||
CreateShare(context.Context, *CreateShareRequest) (*StatusReply, error)
|
||||
// 获取分享详情
|
||||
GetShare(context.Context, *protobuf.IdentRequest) (*CloudShareItem, error)
|
||||
GetShare(context.Context, *IdentRequest) (*CloudShareItem, error)
|
||||
// 删除分享
|
||||
DeleteShare(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error)
|
||||
DeleteShare(context.Context, *IdentRequest) (*StatusReply, error)
|
||||
// 获取分享列表
|
||||
ListShares(context.Context, *protobuf.FetchRequest) (*ListSharesResponse, error)
|
||||
ListShares(context.Context, *FetchRequest) (*ListSharesResponse, error)
|
||||
// 验证分享密码
|
||||
ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*protobuf.StatusReply, error)
|
||||
ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*StatusReply, error)
|
||||
}
|
||||
|
||||
// UnimplementedShareServer should be embedded to have
|
||||
@@ -128,19 +127,19 @@ type ShareServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedShareServer struct{}
|
||||
|
||||
func (UnimplementedShareServer) CreateShare(context.Context, *CreateShareRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedShareServer) CreateShare(context.Context, *CreateShareRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method CreateShare not implemented")
|
||||
}
|
||||
func (UnimplementedShareServer) GetShare(context.Context, *protobuf.IdentRequest) (*CloudShareItem, error) {
|
||||
func (UnimplementedShareServer) GetShare(context.Context, *IdentRequest) (*CloudShareItem, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetShare not implemented")
|
||||
}
|
||||
func (UnimplementedShareServer) DeleteShare(context.Context, *protobuf.IdentRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedShareServer) DeleteShare(context.Context, *IdentRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method DeleteShare not implemented")
|
||||
}
|
||||
func (UnimplementedShareServer) ListShares(context.Context, *protobuf.FetchRequest) (*ListSharesResponse, error) {
|
||||
func (UnimplementedShareServer) ListShares(context.Context, *FetchRequest) (*ListSharesResponse, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ListShares not implemented")
|
||||
}
|
||||
func (UnimplementedShareServer) ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*protobuf.StatusReply, error) {
|
||||
func (UnimplementedShareServer) ValidateSharePassword(context.Context, *ValidateSharePasswordRequest) (*StatusReply, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method ValidateSharePassword not implemented")
|
||||
}
|
||||
func (UnimplementedShareServer) testEmbeddedByValue() {}
|
||||
@@ -182,7 +181,7 @@ func _Share_CreateShare_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
}
|
||||
|
||||
func _Share_GetShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -194,13 +193,13 @@ func _Share_GetShare_Handler(srv interface{}, ctx context.Context, dec func(inte
|
||||
FullMethod: Share_GetShare_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ShareServer).GetShare(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ShareServer).GetShare(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Share_DeleteShare_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -212,13 +211,13 @@ func _Share_DeleteShare_Handler(srv interface{}, ctx context.Context, dec func(i
|
||||
FullMethod: Share_DeleteShare_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ShareServer).DeleteShare(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(ShareServer).DeleteShare(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Share_ListShares_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.FetchRequest)
|
||||
in := new(FetchRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -230,7 +229,7 @@ func _Share_ListShares_Handler(srv interface{}, ctx context.Context, dec func(in
|
||||
FullMethod: Share_ListShares_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(ShareServer).ListShares(ctx, req.(*protobuf.FetchRequest))
|
||||
return srv.(ShareServer).ListShares(ctx, req.(*FetchRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
||||
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
||||
reflect "reflect"
|
||||
@@ -216,7 +215,7 @@ var File_module_base_cloud_proto_space_proto protoreflect.FileDescriptor
|
||||
|
||||
const file_module_base_cloud_proto_space_proto_rawDesc = "" +
|
||||
"\n" +
|
||||
"#module/base/cloud/proto/space.proto\x12\x05cloud\x1a\x15protobuf/blocks.proto\x1a\"module/base/cloud/proto/disk.proto\x1a#module/base/cloud/proto/album.proto\x1a\"module/base/cloud/proto/note.proto\x1a&module/base/cloud/proto/bookmark.proto\x1a%module/base/cloud/proto/private.proto\x1a#module/base/cloud/proto/share.proto\"\x98\x06\n" +
|
||||
"#module/base/cloud/proto/space.proto\x12\x05cloud\x1a#module/base/cloud/proto/const.proto\x1a\"module/base/cloud/proto/disk.proto\x1a#module/base/cloud/proto/album.proto\x1a\"module/base/cloud/proto/note.proto\x1a&module/base/cloud/proto/bookmark.proto\x1a%module/base/cloud/proto/private.proto\x1a#module/base/cloud/proto/share.proto\"\x98\x06\n" +
|
||||
"\n" +
|
||||
"CloudSpace\x12\x0e\n" +
|
||||
"\x02id\x18\x01 \x01(\x04R\x02id\x12\x1a\n" +
|
||||
@@ -265,15 +264,15 @@ func file_module_base_cloud_proto_space_proto_rawDescGZIP() []byte {
|
||||
|
||||
var file_module_base_cloud_proto_space_proto_msgTypes = make([]protoimpl.MessageInfo, 1)
|
||||
var file_module_base_cloud_proto_space_proto_goTypes = []any{
|
||||
(*CloudSpace)(nil), // 0: cloud.CloudSpace
|
||||
(*CloudDiskDirItem)(nil), // 1: cloud.CloudDiskDirItem
|
||||
(*CloudAlbumItem)(nil), // 2: cloud.CloudAlbumItem
|
||||
(*CloudNoteItem)(nil), // 3: cloud.CloudNoteItem
|
||||
(*CloudBookmarkItem)(nil), // 4: cloud.CloudBookmarkItem
|
||||
(*CloudPrivateItem)(nil), // 5: cloud.CloudPrivateItem
|
||||
(*CloudShareItem)(nil), // 6: cloud.CloudShareItem
|
||||
(*protobuf.Empty)(nil), // 7: blocks.Empty
|
||||
(*protobuf.IdentRequest)(nil), // 8: blocks.IdentRequest
|
||||
(*CloudSpace)(nil), // 0: cloud.CloudSpace
|
||||
(*CloudDiskDirItem)(nil), // 1: cloud.CloudDiskDirItem
|
||||
(*CloudAlbumItem)(nil), // 2: cloud.CloudAlbumItem
|
||||
(*CloudNoteItem)(nil), // 3: cloud.CloudNoteItem
|
||||
(*CloudBookmarkItem)(nil), // 4: cloud.CloudBookmarkItem
|
||||
(*CloudPrivateItem)(nil), // 5: cloud.CloudPrivateItem
|
||||
(*CloudShareItem)(nil), // 6: cloud.CloudShareItem
|
||||
(*Empty)(nil), // 7: blocks.Empty
|
||||
(*IdentRequest)(nil), // 8: blocks.IdentRequest
|
||||
}
|
||||
var file_module_base_cloud_proto_space_proto_depIdxs = []int32{
|
||||
1, // 0: cloud.CloudSpace.cloud_disk_dirs:type_name -> cloud.CloudDiskDirItem
|
||||
@@ -298,6 +297,7 @@ func file_module_base_cloud_proto_space_proto_init() {
|
||||
if File_module_base_cloud_proto_space_proto != nil {
|
||||
return
|
||||
}
|
||||
file_module_base_cloud_proto_const_proto_init()
|
||||
file_module_base_cloud_proto_disk_proto_init()
|
||||
file_module_base_cloud_proto_album_proto_init()
|
||||
file_module_base_cloud_proto_note_proto_init()
|
||||
|
||||
@@ -9,7 +9,6 @@ It translates gRPC into RESTful JSON APIs.
|
||||
package cloud
|
||||
|
||||
import (
|
||||
"bsm/full/protobuf"
|
||||
"context"
|
||||
"errors"
|
||||
"io"
|
||||
@@ -38,7 +37,7 @@ var (
|
||||
|
||||
func request_Space_Get_0(ctx context.Context, marshaler runtime.Marshaler, client SpaceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.Empty
|
||||
protoReq Empty
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -53,7 +52,7 @@ func request_Space_Get_0(ctx context.Context, marshaler runtime.Marshaler, clien
|
||||
|
||||
func local_request_Space_Get_0(ctx context.Context, marshaler runtime.Marshaler, server SpaceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.Empty
|
||||
protoReq Empty
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -65,7 +64,7 @@ func local_request_Space_Get_0(ctx context.Context, marshaler runtime.Marshaler,
|
||||
|
||||
func request_Space_GetByKeyIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, client SpaceClient, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
@@ -80,7 +79,7 @@ func request_Space_GetByKeyIdentifier_0(ctx context.Context, marshaler runtime.M
|
||||
|
||||
func local_request_Space_GetByKeyIdentifier_0(ctx context.Context, marshaler runtime.Marshaler, server SpaceServer, req *http.Request, pathParams map[string]string) (proto.Message, runtime.ServerMetadata, error) {
|
||||
var (
|
||||
protoReq blocks.IdentRequest
|
||||
protoReq IdentRequest
|
||||
metadata runtime.ServerMetadata
|
||||
)
|
||||
if err := marshaler.NewDecoder(req.Body).Decode(&protoReq); err != nil && !errors.Is(err, io.EOF) {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
package cloud
|
||||
|
||||
import (
|
||||
protobuf "bsm/full/protobuf"
|
||||
context "context"
|
||||
grpc "google.golang.org/grpc"
|
||||
codes "google.golang.org/grpc/codes"
|
||||
@@ -29,9 +28,9 @@ const (
|
||||
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
|
||||
type SpaceClient interface {
|
||||
// 获取空间数据
|
||||
Get(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*CloudSpace, error)
|
||||
Get(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CloudSpace, error)
|
||||
// 获取空间数据
|
||||
GetByKeyIdentifier(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudSpace, error)
|
||||
GetByKeyIdentifier(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudSpace, error)
|
||||
}
|
||||
|
||||
type spaceClient struct {
|
||||
@@ -42,7 +41,7 @@ func NewSpaceClient(cc grpc.ClientConnInterface) SpaceClient {
|
||||
return &spaceClient{cc}
|
||||
}
|
||||
|
||||
func (c *spaceClient) Get(ctx context.Context, in *protobuf.Empty, opts ...grpc.CallOption) (*CloudSpace, error) {
|
||||
func (c *spaceClient) Get(ctx context.Context, in *Empty, opts ...grpc.CallOption) (*CloudSpace, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudSpace)
|
||||
err := c.cc.Invoke(ctx, Space_Get_FullMethodName, in, out, cOpts...)
|
||||
@@ -52,7 +51,7 @@ func (c *spaceClient) Get(ctx context.Context, in *protobuf.Empty, opts ...grpc.
|
||||
return out, nil
|
||||
}
|
||||
|
||||
func (c *spaceClient) GetByKeyIdentifier(ctx context.Context, in *protobuf.IdentRequest, opts ...grpc.CallOption) (*CloudSpace, error) {
|
||||
func (c *spaceClient) GetByKeyIdentifier(ctx context.Context, in *IdentRequest, opts ...grpc.CallOption) (*CloudSpace, error) {
|
||||
cOpts := append([]grpc.CallOption{grpc.StaticMethod()}, opts...)
|
||||
out := new(CloudSpace)
|
||||
err := c.cc.Invoke(ctx, Space_GetByKeyIdentifier_FullMethodName, in, out, cOpts...)
|
||||
@@ -67,9 +66,9 @@ func (c *spaceClient) GetByKeyIdentifier(ctx context.Context, in *protobuf.Ident
|
||||
// for forward compatibility.
|
||||
type SpaceServer interface {
|
||||
// 获取空间数据
|
||||
Get(context.Context, *protobuf.Empty) (*CloudSpace, error)
|
||||
Get(context.Context, *Empty) (*CloudSpace, error)
|
||||
// 获取空间数据
|
||||
GetByKeyIdentifier(context.Context, *protobuf.IdentRequest) (*CloudSpace, error)
|
||||
GetByKeyIdentifier(context.Context, *IdentRequest) (*CloudSpace, error)
|
||||
}
|
||||
|
||||
// UnimplementedSpaceServer should be embedded to have
|
||||
@@ -79,10 +78,10 @@ type SpaceServer interface {
|
||||
// pointer dereference when methods are called.
|
||||
type UnimplementedSpaceServer struct{}
|
||||
|
||||
func (UnimplementedSpaceServer) Get(context.Context, *protobuf.Empty) (*CloudSpace, error) {
|
||||
func (UnimplementedSpaceServer) Get(context.Context, *Empty) (*CloudSpace, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method Get not implemented")
|
||||
}
|
||||
func (UnimplementedSpaceServer) GetByKeyIdentifier(context.Context, *protobuf.IdentRequest) (*CloudSpace, error) {
|
||||
func (UnimplementedSpaceServer) GetByKeyIdentifier(context.Context, *IdentRequest) (*CloudSpace, error) {
|
||||
return nil, status.Error(codes.Unimplemented, "method GetByKeyIdentifier not implemented")
|
||||
}
|
||||
func (UnimplementedSpaceServer) testEmbeddedByValue() {}
|
||||
@@ -106,7 +105,7 @@ func RegisterSpaceServer(s grpc.ServiceRegistrar, srv SpaceServer) {
|
||||
}
|
||||
|
||||
func _Space_Get_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.Empty)
|
||||
in := new(Empty)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -118,13 +117,13 @@ func _Space_Get_Handler(srv interface{}, ctx context.Context, dec func(interface
|
||||
FullMethod: Space_Get_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SpaceServer).Get(ctx, req.(*protobuf.Empty))
|
||||
return srv.(SpaceServer).Get(ctx, req.(*Empty))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
func _Space_GetByKeyIdentifier_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
|
||||
in := new(protobuf.IdentRequest)
|
||||
in := new(IdentRequest)
|
||||
if err := dec(in); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
@@ -136,7 +135,7 @@ func _Space_GetByKeyIdentifier_Handler(srv interface{}, ctx context.Context, dec
|
||||
FullMethod: Space_GetByKeyIdentifier_FullMethodName,
|
||||
}
|
||||
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
|
||||
return srv.(SpaceServer).GetByKeyIdentifier(ctx, req.(*protobuf.IdentRequest))
|
||||
return srv.(SpaceServer).GetByKeyIdentifier(ctx, req.(*IdentRequest))
|
||||
}
|
||||
return interceptor(ctx, in, info, handler)
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
|
||||
// 相册服务
|
||||
service Album {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
|
||||
// 书签服务
|
||||
service Bookmark {
|
||||
|
||||
326
module/base/cloud/proto/const.proto
Normal file
326
module/base/cloud/proto/const.proto
Normal file
@@ -0,0 +1,326 @@
|
||||
syntax = "proto3";
|
||||
|
||||
package blocks;
|
||||
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
|
||||
// Shared request and response messages.
|
||||
message Empty {}
|
||||
|
||||
message FetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"];
|
||||
int64 page_size = 2 [json_name = "page_size"];
|
||||
map<string, string> params = 3;
|
||||
}
|
||||
|
||||
message IdentRequest {
|
||||
int64 id = 1;
|
||||
string identity = 2;
|
||||
}
|
||||
|
||||
message VersionRequest {
|
||||
int64 version = 1;
|
||||
}
|
||||
|
||||
message SearchRequest {
|
||||
string keyword = 1;
|
||||
}
|
||||
|
||||
message StatusReply {
|
||||
int32 code = 1;
|
||||
string message = 2;
|
||||
string details = 3;
|
||||
int64 timeseq = 4;
|
||||
}
|
||||
|
||||
// Service-specific variants whose wire formats differ from the shared types.
|
||||
message CmsSearchRequest {
|
||||
string keyword = 1;
|
||||
int64 page_no = 2 [json_name = "page_no"];
|
||||
int64 page_size = 3 [json_name = "page_size"];
|
||||
}
|
||||
|
||||
message MallFetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"];
|
||||
int64 page_size = 2 [json_name = "page_size"];
|
||||
map<string, string> params = 3;
|
||||
string store_identity = 4 [json_name = "store_identity"];
|
||||
string keyword = 5;
|
||||
repeated int64 category_id = 6;
|
||||
string sort = 7;
|
||||
int64 min_price = 8 [json_name = "min_price"];
|
||||
int64 max_price = 9 [json_name = "max_price"];
|
||||
}
|
||||
|
||||
message MarketFetchRequest {
|
||||
int64 page_no = 1 [json_name = "page_no"];
|
||||
int64 page_size = 2 [json_name = "page_size"];
|
||||
map<string, string> params = 3;
|
||||
string identity = 4;
|
||||
string keyword = 5;
|
||||
int32 status = 6;
|
||||
int32 approve = 7;
|
||||
}
|
||||
|
||||
message OrderIdentRequest {
|
||||
int64 id = 1;
|
||||
string identity = 2;
|
||||
string reason = 3;
|
||||
int32 approve = 4;
|
||||
string agency = 5;
|
||||
string store_identity = 6;
|
||||
}
|
||||
|
||||
message DeliveryStatusReply {
|
||||
int64 status = 1;
|
||||
string identity = 2;
|
||||
string message = 3;
|
||||
int64 timeseq = 4;
|
||||
}
|
||||
|
||||
message IdentityStatusReply {
|
||||
int32 code = 1;
|
||||
string identity = 2;
|
||||
string message = 3;
|
||||
int64 timeseq = 4;
|
||||
}
|
||||
|
||||
message OrderStatusReply {
|
||||
int32 code = 1;
|
||||
string identity = 2;
|
||||
string message = 3;
|
||||
int64 timeseq = 4;
|
||||
string reason = 5;
|
||||
}
|
||||
|
||||
message DataStatusReply {
|
||||
string data = 1;
|
||||
int64 timeseq = 2;
|
||||
}
|
||||
|
||||
message StoreSerialRequest {
|
||||
string store_identity = 1 [json_name = "store_identity"];
|
||||
repeated string serial_id = 2 [json_name = "serial_id"];
|
||||
}
|
||||
|
||||
// Cloud messages.
|
||||
message IDRequest {
|
||||
uint64 id = 1;
|
||||
}
|
||||
|
||||
message IDListRequest {
|
||||
repeated uint64 ids = 1;
|
||||
}
|
||||
|
||||
message StdIicuds {
|
||||
uint64 id = 1;
|
||||
string created_at = 2;
|
||||
string updated_at = 3;
|
||||
string deleted_at = 4;
|
||||
}
|
||||
|
||||
message StdPassport {
|
||||
uint64 passport_id = 1;
|
||||
string passport_identity = 2;
|
||||
}
|
||||
|
||||
message CloudBase {
|
||||
uint64 cloud_id = 1;
|
||||
string cloud_identity = 2;
|
||||
}
|
||||
|
||||
// CMS messages.
|
||||
message CmsCategoryItem {
|
||||
string site_identity = 1 [json_name = "site_identity"];
|
||||
int64 id = 2;
|
||||
string identity = 3;
|
||||
int64 parent_id = 4 [json_name = "parent_id"];
|
||||
string title = 5;
|
||||
string cover_path = 6 [json_name = "cover_path"];
|
||||
string intro = 7;
|
||||
string created_at = 8 [json_name = "created_at"];
|
||||
string updated_at = 9 [json_name = "updated_at"];
|
||||
repeated CmsCategoryItem child = 10;
|
||||
string category_key = 11 [json_name = "category_key"];
|
||||
}
|
||||
|
||||
message CmsTagsItem {
|
||||
int64 id = 1;
|
||||
string identity = 2;
|
||||
string title = 3;
|
||||
string cover_path = 4 [json_name = "cover_path"];
|
||||
string intro = 5;
|
||||
string created_at = 6 [json_name = "created_at"];
|
||||
}
|
||||
|
||||
message CmsAccessoryItem {
|
||||
string identity = 1;
|
||||
string title = 2;
|
||||
string file_path = 3 [json_name = "file_path"];
|
||||
string created_at = 4 [json_name = "created_at"];
|
||||
}
|
||||
|
||||
// Passport messages.
|
||||
message VerifyStatus {
|
||||
int32 email_verify = 1;
|
||||
int32 phone_verify = 2;
|
||||
int32 face_verify = 3;
|
||||
int32 document_verify = 4;
|
||||
int32 kyc_verify = 5;
|
||||
}
|
||||
|
||||
// Market messages.
|
||||
message MarketLoginReply {
|
||||
string token = 1;
|
||||
string identity = 2;
|
||||
string market_identity = 3 [json_name = "market_identity"];
|
||||
string name = 4;
|
||||
string account = 5;
|
||||
string role = 6;
|
||||
int32 status = 7;
|
||||
string created_at = 8 [json_name = "created_at"];
|
||||
string market_name = 9 [json_name = "market_name"];
|
||||
}
|
||||
|
||||
// Order messages.
|
||||
message OrderSummaryItem {
|
||||
int64 id = 1;
|
||||
string order_no = 2 [json_name = "order_no"];
|
||||
int64 partner_id = 3 [json_name = "partner_id"];
|
||||
string identity = 4;
|
||||
int64 total_price = 7 [json_name = "total_price"];
|
||||
int64 trans_price = 8 [json_name = "trans_price"];
|
||||
int64 refund_price = 9 [json_name = "refund_price"];
|
||||
int64 logistics_fee = 11 [json_name = "logistics_fee"];
|
||||
int64 coupon_amount = 12 [json_name = "coupon_amount"];
|
||||
string remark = 13;
|
||||
int32 status = 14;
|
||||
string logistics_number = 15 [json_name = "logistics_number"];
|
||||
string address_identity = 16 [json_name = "address_identity"];
|
||||
string county = 17;
|
||||
string province = 18;
|
||||
string city = 19;
|
||||
string area = 20;
|
||||
string address = 21;
|
||||
string contact = 22;
|
||||
string phone = 23;
|
||||
string delivery_time = 24 [json_name = "delivery_time"];
|
||||
string delivery_identity = 25 [json_name = "delivery_identity"];
|
||||
int32 pay_type = 26 [json_name = "pay_type"];
|
||||
int64 pay_amount = 27 [json_name = "pay_amount"];
|
||||
string pay_trade_no = 28 [json_name = "pay_trade_no"];
|
||||
string pay_time = 29 [json_name = "pay_time"];
|
||||
string pay_remark = 30 [json_name = "pay_remark"];
|
||||
string created = 31;
|
||||
string updated = 32;
|
||||
repeated OrderDetails details = 33;
|
||||
string addr = 34;
|
||||
string car_identity = 35 [json_name = "car_identity"];
|
||||
string delivery_address = 36 [json_name = "delivery_address"];
|
||||
string brand = 37;
|
||||
string version = 38;
|
||||
string license_number = 39 [json_name = "license_number"];
|
||||
string member_name = 40 [json_name = "member_name"];
|
||||
string member_phone = 41 [json_name = "member_phone"];
|
||||
int32 approve = 42;
|
||||
}
|
||||
|
||||
message OrderDetails {
|
||||
int64 id = 1;
|
||||
int64 product_id = 2 [json_name = "product_id"];
|
||||
string spec_no = 3 [json_name = "spec_no"];
|
||||
string spec = 4;
|
||||
int64 type = 5;
|
||||
string title = 6;
|
||||
string cover_image = 7 [json_name = "cover_image"];
|
||||
int64 sales_price = 8 [json_name = "sales_price"];
|
||||
string product_args = 9 [json_name = "product_args"];
|
||||
int64 number = 10;
|
||||
int64 unit_price = 11 [json_name = "unit_price"];
|
||||
int64 spec_id = 12 [json_name = "spec_id"];
|
||||
string product_identity = 13 [json_name = "product_identity"];
|
||||
int64 gas_types = 14 [json_name = "gas_types"];
|
||||
int64 total_price = 15 [json_name = "total_price"];
|
||||
}
|
||||
|
||||
// Social feed messages.
|
||||
message FeedPostListReply {
|
||||
repeated FeedPostItem list = 1;
|
||||
int64 cnt = 2;
|
||||
}
|
||||
|
||||
message FeedPostItem {
|
||||
string identity = 1;
|
||||
string content = 2;
|
||||
int64 feed_id = 3;
|
||||
string feed_identity = 4;
|
||||
bool is_open = 5;
|
||||
int64 cnt_unlike = 6;
|
||||
int64 cnt_comment = 7;
|
||||
int64 cnt_like = 8;
|
||||
repeated FeedAttachItem attachs = 9;
|
||||
repeated FeedTagItem tags = 10;
|
||||
}
|
||||
|
||||
message FeedAttachItem {
|
||||
string identity = 1;
|
||||
string attach_type = 2;
|
||||
string url = 3;
|
||||
}
|
||||
|
||||
message FeedTagItem {
|
||||
string key = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
// Social group messages.
|
||||
message GroupPostListReply {
|
||||
repeated GroupPostItem list = 1;
|
||||
int64 cnt = 2;
|
||||
}
|
||||
|
||||
message GroupPostItem {
|
||||
string identity = 1;
|
||||
string content = 2;
|
||||
int64 passport_id = 3;
|
||||
string passport_identity = 4;
|
||||
bool is_open = 5;
|
||||
int64 cnt_unlike = 6;
|
||||
int64 cnt_comment = 7;
|
||||
int64 cnt_like = 8;
|
||||
repeated GroupAttachItem attachs = 9;
|
||||
repeated GroupTagItem tags = 10;
|
||||
}
|
||||
|
||||
message GroupAttachItem {
|
||||
string identity = 1;
|
||||
string attach_type = 2;
|
||||
string url = 3;
|
||||
}
|
||||
|
||||
message GroupTagItem {
|
||||
string key = 1;
|
||||
string content = 2;
|
||||
}
|
||||
|
||||
// Social relation messages.
|
||||
message RelationItem {
|
||||
string identity = 1;
|
||||
string nickname = 2;
|
||||
string remark_name = 3;
|
||||
int32 popular = 4;
|
||||
string avatar = 5;
|
||||
string birthday = 6;
|
||||
int32 sex = 7;
|
||||
int32 province = 8;
|
||||
int32 city = 9;
|
||||
int32 area = 10;
|
||||
string sign = 11;
|
||||
repeated string tags = 12;
|
||||
int32 foreign_status = 13;
|
||||
}
|
||||
|
||||
message FetchRelationItemReply {
|
||||
int64 total = 1;
|
||||
repeated RelationItem data = 2;
|
||||
}
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
|
||||
// 云盘目录服务
|
||||
service Disk {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
|
||||
// 笔记服务
|
||||
service Note {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
|
||||
// 隐私数据服务
|
||||
service Private {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
|
||||
// 分享服务
|
||||
service Share {
|
||||
|
||||
@@ -2,7 +2,7 @@ syntax = "proto3";
|
||||
package cloud;
|
||||
option go_package = "bsm/full/module/base/cloud/pb;cloud";
|
||||
|
||||
import "protobuf/blocks.proto";
|
||||
import "module/base/cloud/proto/const.proto";
|
||||
import "module/base/cloud/proto/disk.proto";
|
||||
import "module/base/cloud/proto/album.proto";
|
||||
import "module/base/cloud/proto/note.proto";
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
filebeat.inputs:
|
||||
- type: log
|
||||
enabled: true
|
||||
# 开启json解析
|
||||
json.keys_under_root: true
|
||||
json.add_error_key: true
|
||||
# 日志文件路径
|
||||
paths:
|
||||
- ./logs/cloud/error.log
|
||||
- ./logs/cloud/slow.log
|
||||
|
||||
setup.template.settings:
|
||||
index.number_of_shards: 1
|
||||
|
||||
# 定义kafka topic field
|
||||
fields:
|
||||
log_topic: scf.cloud.dev
|
||||
|
||||
# 输出到kafka
|
||||
output.kafka:
|
||||
hosts: ["127.0.0.1:9092"]
|
||||
topic: '%{[fields.log_topic]}'
|
||||
partition.round_robin:
|
||||
reachable_only: false
|
||||
required_acks: 1
|
||||
keep_alive: 10s
|
||||
|
||||
# ================================= Processors =================================
|
||||
processors:
|
||||
- decode_json_fields:
|
||||
fields: ['@timestamp','level','content','trace','span','duration']
|
||||
target: ""
|
||||
@@ -1,5 +0,0 @@
|
||||
#install
|
||||
go install github.com/securego/gosec/v2/cmd/gosec@latest
|
||||
|
||||
#run
|
||||
gosec -fmt=json -out=./test/lint/gosec.json ./...
|
||||
@@ -1,795 +0,0 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "blocks.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "Album"
|
||||
},
|
||||
{
|
||||
"name": "Bookmark"
|
||||
},
|
||||
{
|
||||
"name": "Disk"
|
||||
},
|
||||
{
|
||||
"name": "Note"
|
||||
},
|
||||
{
|
||||
"name": "Private"
|
||||
},
|
||||
{
|
||||
"name": "Share"
|
||||
},
|
||||
{
|
||||
"name": "Space"
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"cloudCloudAlbumItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "相册名称"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"title": "相册描述"
|
||||
},
|
||||
"coverPhoto": {
|
||||
"type": "string",
|
||||
"title": "封面照片URL"
|
||||
},
|
||||
"isPrivate": {
|
||||
"type": "boolean",
|
||||
"title": "是否私有"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"photos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudPhotoItem"
|
||||
},
|
||||
"description": "相册下的照片",
|
||||
"title": "关联关系"
|
||||
}
|
||||
},
|
||||
"title": "相册模型"
|
||||
},
|
||||
"cloudCloudBookmarkItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"title": "标题"
|
||||
},
|
||||
"url": {
|
||||
"type": "string",
|
||||
"title": "网址"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"title": "描述"
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"title": "分类"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
"title": "标签"
|
||||
},
|
||||
"icon": {
|
||||
"type": "string",
|
||||
"title": "网站图标URL"
|
||||
},
|
||||
"isPrivate": {
|
||||
"type": "boolean",
|
||||
"title": "是否私有"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "网址收藏夹模型"
|
||||
},
|
||||
"cloudCloudDiskDirItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"parentId": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"title": "支持嵌套目录"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "目录名称"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"title": "完整路径"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"parent": {
|
||||
"$ref": "#/definitions/cloudCloudDiskDirItem",
|
||||
"description": "父级目录",
|
||||
"title": "自关联"
|
||||
},
|
||||
"subdirectories": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudDiskDirItem"
|
||||
},
|
||||
"title": "子级目录"
|
||||
},
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudDiskFileItem"
|
||||
},
|
||||
"title": "文件"
|
||||
}
|
||||
},
|
||||
"title": "云盘目录模型"
|
||||
},
|
||||
"cloudCloudDiskFileItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"directoryId": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"title": "文件所属目录"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "文件名"
|
||||
},
|
||||
"originalName": {
|
||||
"type": "string",
|
||||
"title": "原始文件名"
|
||||
},
|
||||
"size": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "文件大小 (bytes)"
|
||||
},
|
||||
"mimeType": {
|
||||
"type": "string",
|
||||
"title": "文件类型"
|
||||
},
|
||||
"storagePath": {
|
||||
"type": "string",
|
||||
"title": "实际存储路径"
|
||||
},
|
||||
"hash": {
|
||||
"type": "string",
|
||||
"title": "文件哈希,用于去重"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"directory": {
|
||||
"$ref": "#/definitions/cloudCloudDiskDirItem",
|
||||
"description": "文件所属目录",
|
||||
"title": "关联关系"
|
||||
}
|
||||
},
|
||||
"title": "云盘文件"
|
||||
},
|
||||
"cloudCloudNoteItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"title": "标题"
|
||||
},
|
||||
"content": {
|
||||
"type": "string",
|
||||
"title": "内容"
|
||||
},
|
||||
"category": {
|
||||
"type": "string",
|
||||
"title": "分类"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
"title": "标签,逗号分隔"
|
||||
},
|
||||
"isMarkdown": {
|
||||
"type": "boolean",
|
||||
"title": "是否是markdown格式"
|
||||
},
|
||||
"isPinned": {
|
||||
"type": "boolean",
|
||||
"title": "是否是置顶"
|
||||
},
|
||||
"isPrivate": {
|
||||
"type": "boolean",
|
||||
"title": "是否是私有"
|
||||
},
|
||||
"views": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "浏览次数"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"attachments": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudNoteAttachmentItem"
|
||||
},
|
||||
"title": "关联关系"
|
||||
}
|
||||
},
|
||||
"title": "知识笔记模型"
|
||||
},
|
||||
"cloudCloudPhotoItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"albumId": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"title": "专辑ID"
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"title": "照片标题"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"title": "照片描述"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string",
|
||||
"title": "文件路径"
|
||||
},
|
||||
"fileSize": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "文件大小"
|
||||
},
|
||||
"mimeType": {
|
||||
"type": "string",
|
||||
"title": "文件类型"
|
||||
},
|
||||
"width": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "图片宽度"
|
||||
},
|
||||
"height": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "图片高度"
|
||||
},
|
||||
"takenAt": {
|
||||
"type": "string",
|
||||
"title": "拍摄时间"
|
||||
},
|
||||
"location": {
|
||||
"type": "string",
|
||||
"title": "拍摄地点"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
"title": "标签,逗号分隔"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"album": {
|
||||
"$ref": "#/definitions/cloudCloudAlbumItem",
|
||||
"title": "关联关系"
|
||||
}
|
||||
},
|
||||
"title": "照片模型"
|
||||
},
|
||||
"cloudCloudPrivateItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"dataType": {
|
||||
"type": "string",
|
||||
"description": "数据类型: password, card, document, etc."
|
||||
},
|
||||
"title": {
|
||||
"type": "string",
|
||||
"title": "标题"
|
||||
},
|
||||
"description": {
|
||||
"type": "string",
|
||||
"title": "描述"
|
||||
},
|
||||
"data": {
|
||||
"type": "string",
|
||||
"title": "加密存储的实际数据"
|
||||
},
|
||||
"isEncrypted": {
|
||||
"type": "boolean",
|
||||
"title": "是否已加密"
|
||||
},
|
||||
"tags": {
|
||||
"type": "string",
|
||||
"title": "标签"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "个人隐私数据模型"
|
||||
},
|
||||
"cloudCloudShareItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"shareType": {
|
||||
"type": "string",
|
||||
"description": "file, album, note, etc."
|
||||
},
|
||||
"resourceId": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"title": "对应资源的ID"
|
||||
},
|
||||
"shareToken": {
|
||||
"type": "string",
|
||||
"title": "分享令牌"
|
||||
},
|
||||
"password": {
|
||||
"type": "string",
|
||||
"title": "可选分享密码"
|
||||
},
|
||||
"expiresAt": {
|
||||
"type": "string",
|
||||
"title": "过期时间"
|
||||
},
|
||||
"viewCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "浏览次数"
|
||||
},
|
||||
"downloadCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "下载次数"
|
||||
},
|
||||
"isPublic": {
|
||||
"type": "boolean",
|
||||
"title": "是否公开"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"title": "分享系统模型"
|
||||
},
|
||||
"cloudCloudSpace": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"identity": {
|
||||
"type": "string"
|
||||
},
|
||||
"totalStorage": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "总存储空间"
|
||||
},
|
||||
"usedStorage": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "已用存储空间"
|
||||
},
|
||||
"maxStorage": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "最大存储空间"
|
||||
},
|
||||
"fileCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "文件数量"
|
||||
},
|
||||
"albumCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "相册数量"
|
||||
},
|
||||
"photoCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "照片数量"
|
||||
},
|
||||
"noteCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "笔记数量"
|
||||
},
|
||||
"bookmarkCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "书签数量"
|
||||
},
|
||||
"privateCount": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "私有数量"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"cloudDiskDirs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudDiskDirItem"
|
||||
},
|
||||
"description": "关联云盘目录",
|
||||
"title": "关联关系"
|
||||
},
|
||||
"cloudAlbums": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudAlbumItem"
|
||||
},
|
||||
"title": "关联相册"
|
||||
},
|
||||
"cloudNotes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudNoteItem"
|
||||
},
|
||||
"title": "关联笔记"
|
||||
},
|
||||
"cloudBookmarks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudBookmarkItem"
|
||||
},
|
||||
"title": "关联书签"
|
||||
},
|
||||
"cloudPrivate": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudPrivateItem"
|
||||
},
|
||||
"title": "关联私有数据"
|
||||
},
|
||||
"cloudShares": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudShareItem"
|
||||
},
|
||||
"title": "关联分享"
|
||||
}
|
||||
},
|
||||
"title": "系统统计和配置模型"
|
||||
},
|
||||
"cloudListAlbumsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"albums": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudAlbumItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListBookmarksResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"bookmarks": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudBookmarkItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListDirsResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"dirs": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudDiskDirItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
},
|
||||
"title": "请求消息定义"
|
||||
},
|
||||
"cloudListFilesResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"files": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudDiskFileItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListNotesResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"notes": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudNoteItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListPhotosResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"photos": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudPhotoItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListPrivateDataResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"data": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudPrivateItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListSharesResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"shares": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudCloudShareItem"
|
||||
}
|
||||
},
|
||||
"total": {
|
||||
"type": "string",
|
||||
"format": "int64"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudNoteAttachmentItem": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"id": {
|
||||
"type": "string",
|
||||
"format": "uint64"
|
||||
},
|
||||
"noteId": {
|
||||
"type": "string",
|
||||
"format": "uint64",
|
||||
"title": "笔记ID"
|
||||
},
|
||||
"fileName": {
|
||||
"type": "string",
|
||||
"title": "文件名"
|
||||
},
|
||||
"filePath": {
|
||||
"type": "string",
|
||||
"title": "文件路径"
|
||||
},
|
||||
"fileSize": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "文件大小"
|
||||
},
|
||||
"mimeType": {
|
||||
"type": "string",
|
||||
"title": "文件类型"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string",
|
||||
"title": "创建时间"
|
||||
}
|
||||
},
|
||||
"title": "笔记附件模型"
|
||||
},
|
||||
"cloudStatusReply": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32",
|
||||
"title": "状态码"
|
||||
},
|
||||
"message": {
|
||||
"type": "string",
|
||||
"title": "状态说明"
|
||||
},
|
||||
"details": {
|
||||
"type": "string",
|
||||
"title": "数据"
|
||||
},
|
||||
"timeseq": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "响应时间序列"
|
||||
}
|
||||
},
|
||||
"title": "状态回复"
|
||||
},
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,251 +0,0 @@
|
||||
# Disk
|
||||
|
||||
全都需要登录
|
||||
|
||||
- [/cloud.Disk/List](#clouddisklist)
|
||||
- [/cloud.Disk/DirTree](#clouddiskdirtree)
|
||||
- [/cloud.Disk/Download](#clouddiskdownload)
|
||||
- [/cloud.Disk/Make](#clouddiskmake)
|
||||
- [/cloud.Disk/Rename](#clouddiskrename)
|
||||
- [/cloud.Disk/Remove](#clouddiskremove)
|
||||
- [/cloud.Disk/Move](#clouddiskmove)
|
||||
- [/cloud.Disk/Copy](#clouddiskcopy)
|
||||
- [/cloud.Disk/Share](#clouddiskshare)
|
||||
- [/cloud.Disk/ParseShare](#clouddiskparseshare)
|
||||
|
||||
## /cloud.Disk/List
|
||||
|
||||
本级目录列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>, 文件夹唯一标识,获取顶级的不传
|
||||
name: "", // type<string>, 根据文件名称模糊查找,当该字段不为空时identity的限定失效
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/DirTree
|
||||
|
||||
目录树
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>, 文件夹唯一标识,获取顶级的不传
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>, 只返回文件夹
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/Download
|
||||
|
||||
本级及子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表,必传
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/Make
|
||||
|
||||
创建文件/文件夹
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
name: "", // type<string>, 文件/文件夹名称,必传
|
||||
ext: "", // type<string>, 后缀,文件夹传空即可
|
||||
parent_identity: "", // type<string>, 父文件夹标识,选填
|
||||
size: "0", // type<int64>, 文件大小,非文件夹时必传,单位:B
|
||||
hash: "", // type<string>, 文件hash值,非文件夹时必传
|
||||
path: "", // type<string>, 文件地址,非文件夹时必传
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/Rename
|
||||
|
||||
修改文件/文件夹名称
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>, 必传
|
||||
name: "", // type<string>, 文件/文件夹名称,必传
|
||||
ext: "", // type<string>, 后缀,文件夹传空即可
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Remove
|
||||
|
||||
移除文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Move
|
||||
|
||||
移动文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
target_identity: "", // type<string>, 目标文件夹标识,如果是顶级则不填
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Copy
|
||||
|
||||
复制文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
target_identity: "", // type<string>, 目标文件夹标识,如果是顶级则不填
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Share
|
||||
|
||||
分享文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
days: "0", // type<int64>, 有效天数,默认永久
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
key: "", // type<string>, 解析分享内容关键key
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/ParseShare
|
||||
|
||||
解析分享内容
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
key: "", // type<string>, 解析分享内容关键key
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,251 +0,0 @@
|
||||
# Disk
|
||||
|
||||
全都需要登录
|
||||
|
||||
- [/cloud.Disk/List](#clouddisklist)
|
||||
- [/cloud.Disk/DirTree](#clouddiskdirtree)
|
||||
- [/cloud.Disk/Download](#clouddiskdownload)
|
||||
- [/cloud.Disk/Make](#clouddiskmake)
|
||||
- [/cloud.Disk/Rename](#clouddiskrename)
|
||||
- [/cloud.Disk/Remove](#clouddiskremove)
|
||||
- [/cloud.Disk/Move](#clouddiskmove)
|
||||
- [/cloud.Disk/Copy](#clouddiskcopy)
|
||||
- [/cloud.Disk/Share](#clouddiskshare)
|
||||
- [/cloud.Disk/ParseShare](#clouddiskparseshare)
|
||||
|
||||
## /cloud.Disk/List
|
||||
|
||||
本级目录列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>, 文件夹唯一标识,获取顶级的不传
|
||||
name: "", // type<string>, 根据文件名称模糊查找,当该字段不为空时identity的限定失效
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/DirTree
|
||||
|
||||
目录树
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>, 文件夹唯一标识,获取顶级的不传
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>, 只返回文件夹
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/Download
|
||||
|
||||
本级及子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表,必传
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/Make
|
||||
|
||||
创建文件/文件夹
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
name: "", // type<string>, 文件/文件夹名称,必传
|
||||
ext: "", // type<string>, 后缀,文件夹传空即可
|
||||
parent_identity: "", // type<string>, 父文件夹标识,选填
|
||||
size: "0", // type<int64>, 文件大小,非文件夹时必传,单位:B
|
||||
hash: "", // type<string>, 文件hash值,非文件夹时必传
|
||||
path: "", // type<string>, 文件地址,非文件夹时必传
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/Rename
|
||||
|
||||
修改文件/文件夹名称
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
identity: "", // type<string>, 必传
|
||||
name: "", // type<string>, 文件/文件夹名称,必传
|
||||
ext: "", // type<string>, 后缀,文件夹传空即可
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Remove
|
||||
|
||||
移除文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Move
|
||||
|
||||
移动文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
target_identity: "", // type<string>, 目标文件夹标识,如果是顶级则不填
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Copy
|
||||
|
||||
复制文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
target_identity: "", // type<string>, 目标文件夹标识,如果是顶级则不填
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{}
|
||||
```
|
||||
## /cloud.Disk/Share
|
||||
|
||||
分享文件/文件夹及其子级递归列表
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
list: [""], // list<string>, identity列表
|
||||
days: "0", // type<int64>, 有效天数,默认永久
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
key: "", // type<string>, 解析分享内容关键key
|
||||
}
|
||||
```
|
||||
## /cloud.Disk/ParseShare
|
||||
|
||||
解析分享内容
|
||||
|
||||
|
||||
### Request
|
||||
```javascript
|
||||
{
|
||||
key: "", // type<string>, 解析分享内容关键key
|
||||
}
|
||||
```
|
||||
|
||||
### Reply
|
||||
```javascript
|
||||
{
|
||||
list: [{
|
||||
identity: "", // type<string>, 唯一标识
|
||||
name: "", // type<string>, 文件/文件夹名称
|
||||
ext: "", // type<string>, 后缀,文件夹时为空
|
||||
parent: [""], // list<string>, 父级文件夹序列,按文件名称查询时候生效
|
||||
file: {
|
||||
identity: "", // type<string>, 唯一标识
|
||||
path: "", // type<string>, 文件路径
|
||||
size: "0", // type<int64>, 文件大小,单位:B
|
||||
}, // type<File>, 文件信息
|
||||
created_at: "", // type<string>
|
||||
updated_at: "", // type<string>
|
||||
children: [{}], // list<UserFile>, 子文件夹
|
||||
}], // list<UserFile>
|
||||
}
|
||||
```
|
||||
|
||||
@@ -1,166 +0,0 @@
|
||||
{
|
||||
"swagger": "2.0",
|
||||
"info": {
|
||||
"title": "disk.proto",
|
||||
"version": "version not set"
|
||||
},
|
||||
"tags": [
|
||||
{
|
||||
"name": "Disk"
|
||||
}
|
||||
],
|
||||
"consumes": [
|
||||
"application/json"
|
||||
],
|
||||
"produces": [
|
||||
"application/json"
|
||||
],
|
||||
"paths": {},
|
||||
"definitions": {
|
||||
"cloudDirTreeResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudUserFile"
|
||||
},
|
||||
"title": "只返回文件夹"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudEmpty": {
|
||||
"type": "object"
|
||||
},
|
||||
"cloudFile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identity": {
|
||||
"type": "string",
|
||||
"title": "唯一标识"
|
||||
},
|
||||
"path": {
|
||||
"type": "string",
|
||||
"title": "文件路径"
|
||||
},
|
||||
"size": {
|
||||
"type": "string",
|
||||
"format": "int64",
|
||||
"title": "文件大小,单位:B"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudListResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudUserFile"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudMakeResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identity": {
|
||||
"type": "string"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudParseShareResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"list": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudUserFile"
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudShareResponse": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"key": {
|
||||
"type": "string",
|
||||
"title": "解析分享内容关键key"
|
||||
}
|
||||
}
|
||||
},
|
||||
"cloudUserFile": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"identity": {
|
||||
"type": "string",
|
||||
"title": "唯一标识"
|
||||
},
|
||||
"name": {
|
||||
"type": "string",
|
||||
"title": "文件/文件夹名称"
|
||||
},
|
||||
"ext": {
|
||||
"type": "string",
|
||||
"title": "后缀,文件夹时为空"
|
||||
},
|
||||
"parent": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "string"
|
||||
},
|
||||
"title": "父级文件夹序列,按文件名称查询时候生效"
|
||||
},
|
||||
"file": {
|
||||
"$ref": "#/definitions/cloudFile",
|
||||
"title": "文件信息"
|
||||
},
|
||||
"createdAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"updatedAt": {
|
||||
"type": "string"
|
||||
},
|
||||
"children": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/cloudUserFile"
|
||||
},
|
||||
"title": "子文件夹"
|
||||
}
|
||||
}
|
||||
},
|
||||
"protobufAny": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"@type": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"additionalProperties": {}
|
||||
},
|
||||
"rpcStatus": {
|
||||
"type": "object",
|
||||
"properties": {
|
||||
"code": {
|
||||
"type": "integer",
|
||||
"format": "int32"
|
||||
},
|
||||
"message": {
|
||||
"type": "string"
|
||||
},
|
||||
"details": {
|
||||
"type": "array",
|
||||
"items": {
|
||||
"type": "object",
|
||||
"$ref": "#/definitions/protobufAny"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user