package book

import (
	"context"
	"server/internal/model"
	"server/internal/service"

	"server/api/book/v1"
)

func (c *ControllerV1) BookSetRecommended(ctx context.Context, req *v1.BookSetRecommendedReq) (res *v1.BookSetRecommendedRes, err error) {
	out, err := service.Book().SetRecommended(ctx, &model.BookSetRecommendedIn{Id: req.Id, IsRecommended: req.IsRecommended})
	if err != nil {
		return nil, err
	}
	return &v1.BookSetRecommendedRes{Success: out.Success}, nil
}
