36 lines
702 B
Go
36 lines
702 B
Go
|
|
// Code scaffolded by goctl. Safe to edit.
|
||
|
|
// goctl 1.10.1
|
||
|
|
|
||
|
|
package brand
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"haixun-backend/internal/svc"
|
||
|
|
"haixun-backend/internal/types"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
|
)
|
||
|
|
|
||
|
|
type DeleteBrandLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewDeleteBrandLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteBrandLogic {
|
||
|
|
return &DeleteBrandLogic{
|
||
|
|
Logger: logx.WithContext(ctx),
|
||
|
|
ctx: ctx,
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *DeleteBrandLogic) DeleteBrand(req *types.BrandPath) error {
|
||
|
|
tenantID, uid, err := actorFrom(l.ctx)
|
||
|
|
if err != nil {
|
||
|
|
return err
|
||
|
|
}
|
||
|
|
return l.svcCtx.Brand.Delete(l.ctx, tenantID, uid, req.ID)
|
||
|
|
}
|