package logic import ( "app.yhyue.com/moapp/jyfs/api/internal/svc" "app.yhyue.com/moapp/jyfs/api/internal/types" "context" fsc "app.yhyue.com/moapp/jyfs/rpc/filesystemclient" "github.com/zeromicro/go-zero/core/logx" ) type DeleteDomainLogic struct { logx.Logger ctx context.Context svcCtx *svc.ServiceContext } func NewDeleteDomainLogic(ctx context.Context, svcCtx *svc.ServiceContext) DeleteDomainLogic { return DeleteDomainLogic{ Logger: logx.WithContext(ctx), ctx: ctx, svcCtx: svcCtx, } } func (l *DeleteDomainLogic) DeleteDomain(req types.LoadDomainReq) (*types.DomainOpResp, error) { resp, err := l.svcCtx.FileSystem.DeleteDomain(l.ctx, &fsc.DomainReq{ Name: req.Name, }) if err != nil || (resp != nil && !resp.State) { return &types.DomainOpResp{State: "删除失败"}, nil } else { return &types.DomainOpResp{State: "删除成功"}, nil } }