deletedomainlogic.go 761 B

12345678910111213141516171819202122232425262728293031323334
  1. package logic
  2. import (
  3. "context"
  4. "app.yhyue.com/moapp/jyfs/rpc/filesystem"
  5. "app.yhyue.com/moapp/jyfs/rpc/internal/svc"
  6. "github.com/tal-tech/go-zero/core/logx"
  7. )
  8. type DeleteDomainLogic struct {
  9. ctx context.Context
  10. svcCtx *svc.ServiceContext
  11. logx.Logger
  12. }
  13. func NewDeleteDomainLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteDomainLogic {
  14. return &DeleteDomainLogic{
  15. ctx: ctx,
  16. svcCtx: svcCtx,
  17. Logger: logx.WithContext(ctx),
  18. }
  19. }
  20. // 删除域
  21. func (l *DeleteDomainLogic) DeleteDomain(in *filesystem.DomainReq) (*filesystem.DomainResp, error) {
  22. err := l.svcCtx.OssClient.DeleteBucket(in.Name)
  23. if err != nil {
  24. return &filesystem.DomainResp{State: false}, nil
  25. } else {
  26. return &filesystem.DomainResp{State: true}, nil
  27. }
  28. }