12345678910111213141516171819202122232425262728293031323334 |
- package logic
- import (
- "app.yhyue.com/moapp/jyfs/rpc/filesystem"
- "app.yhyue.com/moapp/jyfs/rpc/internal/svc"
- "context"
- "github.com/tal-tech/go-zero/core/logx"
- )
- type CreateDomainLogic struct {
- ctx context.Context
- svcCtx *svc.ServiceContext
- logx.Logger
- }
- func NewCreateDomainLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateDomainLogic {
- return &CreateDomainLogic{
- ctx: ctx,
- svcCtx: svcCtx,
- Logger: logx.WithContext(ctx),
- }
- }
- // 创建域
- func (l *CreateDomainLogic) CreateDomain(in *filesystem.DomainReq) (*filesystem.DomainResp, error) {
- err := l.svcCtx.OssClient.CreateBucket(in.Name)
- // todo: 本地存储bucket和meta的对应关系
- if err != nil {
- return &filesystem.DomainResp{State: false}, nil
- } else {
- return &filesystem.DomainResp{State: true}, nil
- }
- }
|