36 lines
807 B
Go
36 lines
807 B
Go
|
|
// Code scaffolded by goctl. Safe to edit.
|
||
|
|
// goctl 1.10.1
|
||
|
|
|
||
|
|
package logic
|
||
|
|
|
||
|
|
import (
|
||
|
|
"context"
|
||
|
|
|
||
|
|
"img_infinite_canvas/internal/svc"
|
||
|
|
"img_infinite_canvas/internal/types"
|
||
|
|
|
||
|
|
"github.com/zeromicro/go-zero/core/logx"
|
||
|
|
)
|
||
|
|
|
||
|
|
type DeleteProjectLogic struct {
|
||
|
|
logx.Logger
|
||
|
|
ctx context.Context
|
||
|
|
svcCtx *svc.ServiceContext
|
||
|
|
}
|
||
|
|
|
||
|
|
func NewDeleteProjectLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteProjectLogic {
|
||
|
|
return &DeleteProjectLogic{
|
||
|
|
Logger: logx.WithContext(ctx),
|
||
|
|
ctx: ctx,
|
||
|
|
svcCtx: svcCtx,
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (l *DeleteProjectLogic) DeleteProject(req *types.ProjectIdRequest) (resp *types.DeleteProjectResponse, err error) {
|
||
|
|
if err := l.svcCtx.DesignService.DeleteProject(l.ctx, req.Id); err != nil {
|
||
|
|
return nil, err
|
||
|
|
}
|
||
|
|
|
||
|
|
return &types.DeleteProjectResponse{Id: req.Id, Deleted: true}, nil
|
||
|
|
}
|