package logic import ( "context" "app.yhyue.com/moapp/jybase/common" "bp.jydev.jianyu360.cn/BaseService/fileCenter/entity" "bp.jydev.jianyu360.cn/BaseService/fileCenter/rpc/internal/svc" "bp.jydev.jianyu360.cn/BaseService/fileCenter/rpc/pb" "github.com/zeromicro/go-zero/core/logx" ) type DeleteLogic struct { ctx context.Context svcCtx *svc.ServiceContext logx.Logger } func NewDeleteLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteLogic { return &DeleteLogic{ ctx: ctx, svcCtx: svcCtx, Logger: logx.WithContext(ctx), } } // 文件删除 func (l *DeleteLogic) Delete(in *pb.DeleteFileReq) (*pb.FileResp, error) { // todo: add your logic here and delete this line resp := &pb.FileResp{ Status: 0, } b, err := entity.OssDelObject(in.Name, common.InterfaceToStr(in.OssBucketName)) if err == nil && b { resp.Status = 1 } return resp, nil }