package author

import (
	"context"
	v1 "server/api/author/v1"
	"server/internal/model"
	"server/internal/service"
)

func (c *ControllerV1) Del(ctx context.Context, req *v1.DelReq) (res *v1.DelRes, err error) {
	out, err := service.Author().Delete(ctx, &model.AuthorDelIn{
		Id: req.Id,
	})
	if err != nil {
		return nil, err
	}

	return &v1.DelRes{
		Success: out.Success,
	}, nil
}
