initial commit
This commit is contained in:
74
gallery/internal/server/galleryserver.go
Normal file
74
gallery/internal/server/galleryserver.go
Normal file
@ -0,0 +1,74 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.8.3
|
||||
// Source: gallery.proto
|
||||
|
||||
package server
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"godemo/gallery/gallery"
|
||||
"godemo/gallery/internal/logic"
|
||||
"godemo/gallery/internal/svc"
|
||||
)
|
||||
|
||||
type GalleryServer struct {
|
||||
svcCtx *svc.ServiceContext
|
||||
gallery.UnimplementedGalleryServer
|
||||
}
|
||||
|
||||
func NewGalleryServer(svcCtx *svc.ServiceContext) *GalleryServer {
|
||||
return &GalleryServer{
|
||||
svcCtx: svcCtx,
|
||||
}
|
||||
}
|
||||
|
||||
// 健康检查
|
||||
func (s *GalleryServer) Ping(ctx context.Context, in *gallery.PingRequest) (*gallery.PingResponse, error) {
|
||||
l := logic.NewPingLogic(ctx, s.svcCtx)
|
||||
return l.Ping(in)
|
||||
}
|
||||
|
||||
// 图片元数据操作
|
||||
func (s *GalleryServer) GetImageList(ctx context.Context, in *gallery.ImageListRequest) (*gallery.ImageListResponse, error) {
|
||||
l := logic.NewGetImageListLogic(ctx, s.svcCtx)
|
||||
return l.GetImageList(in)
|
||||
}
|
||||
|
||||
func (s *GalleryServer) GetImageDetail(ctx context.Context, in *gallery.ImageDetailRequest) (*gallery.ImageDetailResponse, error) {
|
||||
l := logic.NewGetImageDetailLogic(ctx, s.svcCtx)
|
||||
return l.GetImageDetail(in)
|
||||
}
|
||||
|
||||
func (s *GalleryServer) UpdateImage(ctx context.Context, in *gallery.UpdateImageRequest) (*gallery.UpdateImageResponse, error) {
|
||||
l := logic.NewUpdateImageLogic(ctx, s.svcCtx)
|
||||
return l.UpdateImage(in)
|
||||
}
|
||||
|
||||
func (s *GalleryServer) DeleteImage(ctx context.Context, in *gallery.DeleteImageRequest) (*gallery.DeleteImageResponse, error) {
|
||||
l := logic.NewDeleteImageLogic(ctx, s.svcCtx)
|
||||
return l.DeleteImage(in)
|
||||
}
|
||||
|
||||
// 图片上传
|
||||
func (s *GalleryServer) UploadImage(ctx context.Context, in *gallery.UploadImageRequest) (*gallery.UploadImageResponse, error) {
|
||||
l := logic.NewUploadImageLogic(ctx, s.svcCtx)
|
||||
return l.UploadImage(in)
|
||||
}
|
||||
|
||||
// 分类管理
|
||||
func (s *GalleryServer) GetCategoryTree(ctx context.Context, in *gallery.CategoryTreeRequest) (*gallery.CategoryTreeResponse, error) {
|
||||
l := logic.NewGetCategoryTreeLogic(ctx, s.svcCtx)
|
||||
return l.GetCategoryTree(in)
|
||||
}
|
||||
|
||||
func (s *GalleryServer) CreateCategory(ctx context.Context, in *gallery.CreateCategoryRequest) (*gallery.CreateCategoryResponse, error) {
|
||||
l := logic.NewCreateCategoryLogic(ctx, s.svcCtx)
|
||||
return l.CreateCategory(in)
|
||||
}
|
||||
|
||||
// 访问控制
|
||||
func (s *GalleryServer) GenerateUrl(ctx context.Context, in *gallery.GenerateUrlRequest) (*gallery.GenerateUrlResponse, error) {
|
||||
l := logic.NewGenerateUrlLogic(ctx, s.svcCtx)
|
||||
return l.GenerateUrl(in)
|
||||
}
|
||||
Reference in New Issue
Block a user