package recommend

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

	v1 "server/api/recommend/v1"
)

func (c *ControllerV1) UploadCover(ctx context.Context, req *v1.UploadCoverReq) (res *v1.UploadCoverRes, err error) {
	url, err := service.BookRecommendations().UploadCover(ctx, req.File)
	if err != nil {
		return nil, err
	}
	return &v1.UploadCoverRes{Url: url}, nil
}
