12345678910111213141516171819202122232425262728293031323334353637 |
- package logic
- import (
- "context"
- "app.yhyue.com/moapp/jyfs/rpc/internal/redis"
- "app.yhyue.com/moapp/jyfs/rpc/filesystem"
- "app.yhyue.com/moapp/jyfs/rpc/internal/svc"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type DeleteDomainLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewDeleteDomainLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteDomainLogic {
- return &DeleteDomainLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 删除域
- func (l *DeleteDomainLogic) DeleteDomain(in *filesystem.DomainReq) (*filesystem.DomainResp, error) {
- err := l.svcCtx.OssClient.DeleteBucket(in.Name)
- if err != nil {
- return &filesystem.DomainResp{State: false}, nil
- } else {
- redis.Del("jyfs", "jyfs_"+in.Name)
- return &filesystem.DomainResp{State: true}, nil
- }
- }
|