12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- // Code generated by goctl. DO NOT EDIT!
- // Source: fileCenter.proto
- package filecenter
- import (
- "context"
- "bp.jydev.jianyu360.cn/BaseService/fileCenter/rpc/pb"
- "github.com/zeromicro/go-zero/zrpc"
- "google.golang.org/grpc"
- )
- type (
- DeleteFileReq = pb.DeleteFileReq
- Resp = pb.Resp
- UploadReq = pb.UploadReq
- UploadResp = pb.UploadResp
- FileCenter interface {
- // 文件上传
- Upload(ctx context.Context, in *UploadReq, opts ...grpc.CallOption) (*UploadResp, error)
- // 文件删除
- Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*Resp, error)
- }
- defaultFileCenter struct {
- cli zrpc.Client
- }
- )
- func NewFileCenter(cli zrpc.Client) FileCenter {
- return &defaultFileCenter{
- cli: cli,
- }
- }
- // 文件上传
- func (m *defaultFileCenter) Upload(ctx context.Context, in *UploadReq, opts ...grpc.CallOption) (*UploadResp, error) {
- client := pb.NewFileCenterClient(m.cli.Conn())
- return client.Upload(ctx, in, opts...)
- }
- // 文件删除
- func (m *defaultFileCenter) Delete(ctx context.Context, in *DeleteFileReq, opts ...grpc.CallOption) (*Resp, error) {
- client := pb.NewFileCenterClient(m.cli.Conn())
- return client.Delete(ctx, in, opts...)
- }
|