init: init refactor
This commit is contained in:
@@ -0,0 +1,52 @@
|
||||
// Code generated by goctl. DO NOT EDIT.
|
||||
// goctl 1.10.1
|
||||
// Source: file.proto
|
||||
|
||||
package fileservice
|
||||
|
||||
import (
|
||||
"context"
|
||||
|
||||
"sundynix-micro-go/app/file/rpc/file"
|
||||
|
||||
"github.com/zeromicro/go-zero/zrpc"
|
||||
"google.golang.org/grpc"
|
||||
)
|
||||
|
||||
type (
|
||||
CommonResp = file.CommonResp
|
||||
FileInfo = file.FileInfo
|
||||
GetFileByIdReq = file.GetFileByIdReq
|
||||
GetFileByIdResp = file.GetFileByIdResp
|
||||
GetFilesByIdsReq = file.GetFilesByIdsReq
|
||||
GetFilesByIdsResp = file.GetFilesByIdsResp
|
||||
|
||||
FileService interface {
|
||||
// 根据ID获取文件信息
|
||||
GetFileById(ctx context.Context, in *GetFileByIdReq, opts ...grpc.CallOption) (*GetFileByIdResp, error)
|
||||
// 根据ID列表批量获取文件信息
|
||||
GetFilesByIds(ctx context.Context, in *GetFilesByIdsReq, opts ...grpc.CallOption) (*GetFilesByIdsResp, error)
|
||||
}
|
||||
|
||||
defaultFileService struct {
|
||||
cli zrpc.Client
|
||||
}
|
||||
)
|
||||
|
||||
func NewFileService(cli zrpc.Client) FileService {
|
||||
return &defaultFileService{
|
||||
cli: cli,
|
||||
}
|
||||
}
|
||||
|
||||
// 根据ID获取文件信息
|
||||
func (m *defaultFileService) GetFileById(ctx context.Context, in *GetFileByIdReq, opts ...grpc.CallOption) (*GetFileByIdResp, error) {
|
||||
client := file.NewFileServiceClient(m.cli.Conn())
|
||||
return client.GetFileById(ctx, in, opts...)
|
||||
}
|
||||
|
||||
// 根据ID列表批量获取文件信息
|
||||
func (m *defaultFileService) GetFilesByIds(ctx context.Context, in *GetFilesByIdsReq, opts ...grpc.CallOption) (*GetFilesByIdsResp, error) {
|
||||
client := file.NewFileServiceClient(m.cli.Conn())
|
||||
return client.GetFilesByIds(ctx, in, opts...)
|
||||
}
|
||||
Reference in New Issue
Block a user