feat: import services and standardize Go 1.26.5
This commit is contained in:
76
apps/base/cloud/internal/server/album_server.go
Normal file
76
apps/base/cloud/internal/server/album_server.go
Normal file
@@ -0,0 +1,76 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/album"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type AlbumServer struct {
|
||||
pb.UnimplementedAlbumServer
|
||||
}
|
||||
|
||||
func NewAlbumServer() *AlbumServer {
|
||||
return &AlbumServer{}
|
||||
}
|
||||
|
||||
// 创建相册
|
||||
func (s *AlbumServer) CreateAlbum(ctx context.Context, in *pb.CreateAlbumRequest) (*pb.StatusReply, error) {
|
||||
return album.CreateAlbum(ctx, in)
|
||||
}
|
||||
|
||||
// 获取相册详情
|
||||
func (s *AlbumServer) GetAlbum(ctx context.Context, in *pb.IdentRequest) (*pb.CloudAlbumItem, error) {
|
||||
return album.GetAlbum(ctx, in)
|
||||
}
|
||||
|
||||
// 更新相册
|
||||
func (s *AlbumServer) UpdateAlbum(ctx context.Context, in *pb.CloudAlbumItem) (*pb.StatusReply, error) {
|
||||
return album.UpdateAlbum(ctx, in)
|
||||
}
|
||||
|
||||
// 删除相册
|
||||
func (s *AlbumServer) DeleteAlbum(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return album.DeleteAlbum(ctx, in)
|
||||
}
|
||||
|
||||
// 获取相册列表
|
||||
func (s *AlbumServer) ListAlbums(ctx context.Context, in *pb.FetchRequest) (*pb.ListAlbumsResponse, error) {
|
||||
return album.ListAlbums(ctx, in)
|
||||
}
|
||||
|
||||
// 设置封面照片
|
||||
func (s *AlbumServer) SetCoverPhoto(ctx context.Context, in *pb.SetCoverPhotoRequest) (*pb.StatusReply, error) {
|
||||
return album.SetCoverPhoto(ctx, in)
|
||||
}
|
||||
|
||||
// 上传照片
|
||||
func (s *AlbumServer) UploadPhoto(ctx context.Context, in *pb.CloudPhotoItem) (*pb.StatusReply, error) {
|
||||
return album.UploadPhoto(ctx, in)
|
||||
}
|
||||
|
||||
// 获取照片详情
|
||||
func (s *AlbumServer) GetPhoto(ctx context.Context, in *pb.IdentRequest) (*pb.CloudPhotoItem, error) {
|
||||
return album.GetPhoto(ctx, in)
|
||||
}
|
||||
|
||||
// 更新照片
|
||||
func (s *AlbumServer) UpdatePhoto(ctx context.Context, in *pb.CloudPhotoItem) (*pb.StatusReply, error) {
|
||||
return album.UpdatePhoto(ctx, in)
|
||||
}
|
||||
|
||||
// 删除照片
|
||||
func (s *AlbumServer) DeletePhoto(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return album.DeletePhoto(ctx, in)
|
||||
}
|
||||
|
||||
// 获取照片列表
|
||||
func (s *AlbumServer) ListPhotos(ctx context.Context, in *pb.FetchRequest) (*pb.ListPhotosResponse, error) {
|
||||
return album.ListPhotos(ctx, in)
|
||||
}
|
||||
|
||||
// 移动照片到其他相册
|
||||
func (s *AlbumServer) MovePhoto(ctx context.Context, in *pb.MovePhotoRequest) (*pb.StatusReply, error) {
|
||||
return album.MovePhoto(ctx, in)
|
||||
}
|
||||
46
apps/base/cloud/internal/server/bookmark_server.go
Normal file
46
apps/base/cloud/internal/server/bookmark_server.go
Normal file
@@ -0,0 +1,46 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/bookmark"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type BookmarkServer struct {
|
||||
pb.UnimplementedBookmarkServer
|
||||
}
|
||||
|
||||
func NewBookmarkServer() *BookmarkServer {
|
||||
return &BookmarkServer{}
|
||||
}
|
||||
|
||||
// 创建书签
|
||||
func (s *BookmarkServer) CreateBookmark(ctx context.Context, in *pb.CreateBookmarkRequest) (*pb.StatusReply, error) {
|
||||
return bookmark.CreateBookmark(ctx, in)
|
||||
}
|
||||
|
||||
// 获取书签详情
|
||||
func (s *BookmarkServer) GetBookmark(ctx context.Context, in *pb.IDRequest) (*pb.CloudBookmarkItem, error) {
|
||||
return bookmark.GetBookmark(ctx, in)
|
||||
}
|
||||
|
||||
// 更新书签
|
||||
func (s *BookmarkServer) UpdateBookmark(ctx context.Context, in *pb.CloudBookmarkItem) (*pb.StatusReply, error) {
|
||||
return bookmark.UpdateBookmark(ctx, in)
|
||||
}
|
||||
|
||||
// 删除书签
|
||||
func (s *BookmarkServer) DeleteBookmark(ctx context.Context, in *pb.IDRequest) (*pb.StatusReply, error) {
|
||||
return bookmark.DeleteBookmark(ctx, in)
|
||||
}
|
||||
|
||||
// 获取书签列表
|
||||
func (s *BookmarkServer) ListBookmarks(ctx context.Context, in *pb.FetchRequest) (*pb.ListBookmarksResponse, error) {
|
||||
return bookmark.ListBookmarks(ctx, in)
|
||||
}
|
||||
|
||||
// 导入书签
|
||||
func (s *BookmarkServer) ImportBookmarks(ctx context.Context, in *pb.ImportBookmarksRequest) (*pb.StatusReply, error) {
|
||||
return bookmark.ImportBookmarks(ctx, in)
|
||||
}
|
||||
91
apps/base/cloud/internal/server/disk_server.go
Normal file
91
apps/base/cloud/internal/server/disk_server.go
Normal file
@@ -0,0 +1,91 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/disk"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type DiskServer struct {
|
||||
pb.UnimplementedDiskServer
|
||||
}
|
||||
|
||||
func NewDiskServer() *DiskServer {
|
||||
return &DiskServer{}
|
||||
}
|
||||
|
||||
// 创建目录
|
||||
func (s *DiskServer) CreateDir(ctx context.Context, in *pb.CreateDirRequest) (*pb.StatusReply, error) {
|
||||
return disk.CreateDir(ctx, in)
|
||||
}
|
||||
|
||||
// 获取目录详情
|
||||
func (s *DiskServer) GetDir(ctx context.Context, in *pb.IdentRequest) (*pb.CloudDiskDirItem, error) {
|
||||
return disk.GetDir(ctx, in)
|
||||
}
|
||||
|
||||
// 更新目录
|
||||
func (s *DiskServer) UpdateDir(ctx context.Context, in *pb.CloudDiskDirItem) (*pb.StatusReply, error) {
|
||||
return disk.UpdateDir(ctx, in)
|
||||
}
|
||||
|
||||
// 删除目录
|
||||
func (s *DiskServer) DeleteDir(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return disk.DeleteDir(ctx, in)
|
||||
}
|
||||
|
||||
// 获取目录列表
|
||||
func (s *DiskServer) ListDirs(ctx context.Context, in *pb.FetchRequest) (*pb.ListDirsResponse, error) {
|
||||
return disk.ListDirs(ctx, in)
|
||||
}
|
||||
|
||||
// 获取目录树
|
||||
func (s *DiskServer) GetDirTree(ctx context.Context, in *pb.IdentRequest) (*pb.CloudDiskDirItem, error) {
|
||||
return disk.GetDirTree(ctx, in)
|
||||
}
|
||||
|
||||
// 移动目录
|
||||
func (s *DiskServer) MoveDir(ctx context.Context, in *pb.MoveDirRequest) (*pb.StatusReply, error) {
|
||||
return disk.MoveDir(ctx, in)
|
||||
}
|
||||
|
||||
// 上传文件
|
||||
func (s *DiskServer) UploadFile(ctx context.Context, in *pb.CloudDiskFileRequest) (*pb.StatusReply, error) {
|
||||
return disk.UploadFile(ctx, in)
|
||||
}
|
||||
|
||||
// 获取文件详情
|
||||
func (s *DiskServer) GetFile(ctx context.Context, in *pb.IdentRequest) (*pb.CloudDiskFileItem, error) {
|
||||
return disk.GetFile(ctx, in)
|
||||
}
|
||||
|
||||
// 更新文件
|
||||
func (s *DiskServer) UpdateFile(ctx context.Context, in *pb.CloudDiskFileItem) (*pb.StatusReply, error) {
|
||||
return disk.UpdateFile(ctx, in)
|
||||
}
|
||||
|
||||
// 删除文件
|
||||
func (s *DiskServer) DeleteFile(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return disk.DeleteFile(ctx, in)
|
||||
}
|
||||
|
||||
// 获取文件列表
|
||||
func (s *DiskServer) ListFiles(ctx context.Context, in *pb.FetchRequest) (*pb.ListFilesResponse, error) {
|
||||
return disk.ListFiles(ctx, in)
|
||||
}
|
||||
|
||||
// 移动文件
|
||||
func (s *DiskServer) MoveFile(ctx context.Context, in *pb.MoveFileRequest) (*pb.StatusReply, error) {
|
||||
return disk.MoveFile(ctx, in)
|
||||
}
|
||||
|
||||
// 复制文件
|
||||
func (s *DiskServer) CopyFile(ctx context.Context, in *pb.CopyFileRequest) (*pb.StatusReply, error) {
|
||||
return disk.CopyFile(ctx, in)
|
||||
}
|
||||
|
||||
// 搜索文件
|
||||
func (s *DiskServer) SearchFiles(ctx context.Context, in *pb.FetchRequest) (*pb.ListFilesResponse, error) {
|
||||
return disk.SearchFiles(ctx, in)
|
||||
}
|
||||
121
apps/base/cloud/internal/server/new.go
Normal file
121
apps/base/cloud/internal/server/new.go
Normal file
@@ -0,0 +1,121 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
"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 {
|
||||
Grpc *grpc.Server
|
||||
Ctx context.Context
|
||||
Mux *gwRuntime.ServeMux
|
||||
grpcConns map[string]*grpc.ClientConn // 连接池
|
||||
}
|
||||
|
||||
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),
|
||||
}
|
||||
|
||||
// register service to grpc.Server
|
||||
pb.RegisterAlbumServer(srv.Grpc, NewAlbumServer())
|
||||
pb.RegisterBookmarkServer(srv.Grpc, NewBookmarkServer())
|
||||
pb.RegisterDiskServer(srv.Grpc, NewDiskServer())
|
||||
pb.RegisterNoteServer(srv.Grpc, NewNoteServer())
|
||||
pb.RegisterPrivateServer(srv.Grpc, NewPrivateServer())
|
||||
pb.RegisterShareServer(srv.Grpc, NewShareServer())
|
||||
pb.RegisterSpaceServer(srv.Grpc, NewSpaceServer())
|
||||
|
||||
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
|
||||
}
|
||||
66
apps/base/cloud/internal/server/note_server.go
Normal file
66
apps/base/cloud/internal/server/note_server.go
Normal file
@@ -0,0 +1,66 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/note"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type NoteServer struct {
|
||||
pb.UnimplementedNoteServer
|
||||
}
|
||||
|
||||
func NewNoteServer() *NoteServer {
|
||||
return &NoteServer{}
|
||||
}
|
||||
|
||||
// 创建笔记
|
||||
func (s *NoteServer) CreateNote(ctx context.Context, in *pb.CreateNoteRequest) (*pb.StatusReply, error) {
|
||||
return note.CreateNote(ctx, in)
|
||||
}
|
||||
|
||||
// 获取笔记详情
|
||||
func (s *NoteServer) GetNote(ctx context.Context, in *pb.IdentRequest) (*pb.CloudNoteItem, error) {
|
||||
return note.GetNote(ctx, in)
|
||||
}
|
||||
|
||||
// 更新笔记
|
||||
func (s *NoteServer) UpdateNote(ctx context.Context, in *pb.CloudNoteItem) (*pb.StatusReply, error) {
|
||||
return note.UpdateNote(ctx, in)
|
||||
}
|
||||
|
||||
// 删除笔记
|
||||
func (s *NoteServer) DeleteNote(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return note.DeleteNote(ctx, in)
|
||||
}
|
||||
|
||||
// 获取笔记列表
|
||||
func (s *NoteServer) ListNotes(ctx context.Context, in *pb.FetchRequest) (*pb.ListNotesResponse, error) {
|
||||
return note.ListNotes(ctx, in)
|
||||
}
|
||||
|
||||
// 置顶/取消置顶笔记
|
||||
func (s *NoteServer) TogglePin(ctx context.Context, in *pb.TogglePinRequest) (*pb.StatusReply, error) {
|
||||
return note.TogglePin(ctx, in)
|
||||
}
|
||||
|
||||
// 增加浏览次数
|
||||
func (s *NoteServer) IncrementViews(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return note.IncrementViews(ctx, in)
|
||||
}
|
||||
|
||||
// 搜索笔记
|
||||
func (s *NoteServer) SearchNotes(ctx context.Context, in *pb.FetchRequest) (*pb.ListNotesResponse, error) {
|
||||
return note.SearchNotes(ctx, in)
|
||||
}
|
||||
|
||||
// 上传附件
|
||||
func (s *NoteServer) InsertAttachment(ctx context.Context, in *pb.NoteAttachmentItem) (*pb.StatusReply, error) {
|
||||
return note.InsertAttachment(ctx, in)
|
||||
}
|
||||
|
||||
// 删除附件
|
||||
func (s *NoteServer) DeleteAttachment(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return note.DeleteAttachment(ctx, in)
|
||||
}
|
||||
61
apps/base/cloud/internal/server/private_server.go
Normal file
61
apps/base/cloud/internal/server/private_server.go
Normal file
@@ -0,0 +1,61 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/private"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type PrivateServer struct {
|
||||
pb.UnimplementedPrivateServer
|
||||
}
|
||||
|
||||
func NewPrivateServer() *PrivateServer {
|
||||
return &PrivateServer{}
|
||||
}
|
||||
|
||||
// 创建隐私数据
|
||||
func (s *PrivateServer) CreatePrivateData(ctx context.Context, in *pb.CreatePrivateDataRequest) (*pb.StatusReply, error) {
|
||||
return private.CreatePrivateData(ctx, in)
|
||||
}
|
||||
|
||||
// 获取隐私数据详情
|
||||
func (s *PrivateServer) GetPrivateData(ctx context.Context, in *pb.IdentRequest) (*pb.CloudPrivateItem, error) {
|
||||
return private.GetPrivateData(ctx, in)
|
||||
}
|
||||
|
||||
// 更新隐私数据
|
||||
func (s *PrivateServer) UpdatePrivateData(ctx context.Context, in *pb.CloudPrivateItem) (*pb.StatusReply, error) {
|
||||
return private.UpdatePrivateData(ctx, in)
|
||||
}
|
||||
|
||||
// 删除隐私数据
|
||||
func (s *PrivateServer) DeletePrivateData(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return private.DeletePrivateData(ctx, in)
|
||||
}
|
||||
|
||||
// 获取隐私数据列表
|
||||
func (s *PrivateServer) ListPrivateData(ctx context.Context, in *pb.FetchRequest) (*pb.ListPrivateDataResponse, error) {
|
||||
return private.ListPrivateData(ctx, in)
|
||||
}
|
||||
|
||||
// 按类型获取隐私数据
|
||||
func (s *PrivateServer) GetPrivateDataByType(ctx context.Context, in *pb.FetchRequest) (*pb.ListPrivateDataResponse, error) {
|
||||
return private.GetPrivateDataByType(ctx, in)
|
||||
}
|
||||
|
||||
// 搜索隐私数据
|
||||
func (s *PrivateServer) SearchPrivateData(ctx context.Context, in *pb.FetchRequest) (*pb.ListPrivateDataResponse, error) {
|
||||
return private.SearchPrivateData(ctx, in)
|
||||
}
|
||||
|
||||
// 加密数据
|
||||
func (s *PrivateServer) EncryptData(ctx context.Context, in *pb.DataRequest) (*pb.StatusReply, error) {
|
||||
return private.EncryptData(ctx, in)
|
||||
}
|
||||
|
||||
// 解密数据
|
||||
func (s *PrivateServer) DecryptData(ctx context.Context, in *pb.DataRequest) (*pb.StatusReply, error) {
|
||||
return private.DecryptData(ctx, in)
|
||||
}
|
||||
41
apps/base/cloud/internal/server/share_server.go
Normal file
41
apps/base/cloud/internal/server/share_server.go
Normal file
@@ -0,0 +1,41 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/share"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type ShareServer struct {
|
||||
pb.UnimplementedShareServer
|
||||
}
|
||||
|
||||
func NewShareServer() *ShareServer {
|
||||
return &ShareServer{}
|
||||
}
|
||||
|
||||
// 创建分享
|
||||
func (s *ShareServer) CreateShare(ctx context.Context, in *pb.CreateShareRequest) (*pb.StatusReply, error) {
|
||||
return share.CreateShare(ctx, in)
|
||||
}
|
||||
|
||||
// 获取分享详情
|
||||
func (s *ShareServer) GetShare(ctx context.Context, in *pb.IdentRequest) (*pb.CloudShareItem, error) {
|
||||
return share.GetShare(ctx, in)
|
||||
}
|
||||
|
||||
// 删除分享
|
||||
func (s *ShareServer) DeleteShare(ctx context.Context, in *pb.IdentRequest) (*pb.StatusReply, error) {
|
||||
return share.DeleteShare(ctx, in)
|
||||
}
|
||||
|
||||
// 获取分享列表
|
||||
func (s *ShareServer) ListShares(ctx context.Context, in *pb.FetchRequest) (*pb.ListSharesResponse, error) {
|
||||
return share.ListShares(ctx, in)
|
||||
}
|
||||
|
||||
// 验证分享密码
|
||||
func (s *ShareServer) ValidateSharePassword(ctx context.Context, in *pb.ValidateSharePasswordRequest) (*pb.StatusReply, error) {
|
||||
return share.ValidateSharePassword(ctx, in)
|
||||
}
|
||||
26
apps/base/cloud/internal/server/space_server.go
Normal file
26
apps/base/cloud/internal/server/space_server.go
Normal file
@@ -0,0 +1,26 @@
|
||||
// Code generated by protoc-gen-slc. DO NOT EDIT.
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
"git.apinb.com/bsm-apps/cloud/internal/logic/space"
|
||||
pb "git.apinb.com/bsm-apps/cloud/pb"
|
||||
)
|
||||
|
||||
type SpaceServer struct {
|
||||
pb.UnimplementedSpaceServer
|
||||
}
|
||||
|
||||
func NewSpaceServer() *SpaceServer {
|
||||
return &SpaceServer{}
|
||||
}
|
||||
|
||||
// 获取空间数据
|
||||
func (s *SpaceServer) Get(ctx context.Context, in *pb.Empty) (*pb.CloudSpace, error) {
|
||||
return space.Get(ctx, in)
|
||||
}
|
||||
|
||||
// 获取空间数据
|
||||
func (s *SpaceServer) GetByKeyIdentifier(ctx context.Context, in *pb.IdentRequest) (*pb.CloudSpace, error) {
|
||||
return space.GetByKeyIdentifier(ctx, in)
|
||||
}
|
||||
Reference in New Issue
Block a user