package book

import (
	"context"

	v1 "server/api/book/v1"
	"server/internal/model"
	"server/internal/service"
)

func (c *ControllerV1) BookSetHot(ctx context.Context, req *v1.BookSetHotReq) (res *v1.BookSetHotRes, err error) {
	out, err := service.Book().SetHot(ctx, &model.BookSetHotIn{
		Id:    req.Id,
		IsHot: req.IsHot,
	})
	if err != nil {
		return nil, err
	}
	return &v1.BookSetHotRes{
		Success: out.Success,
	}, nil
}
