package author

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

	"server/api/author/v1"
)

func (c *ControllerV1) Detail(ctx context.Context, req *v1.DetailReq) (res *v1.DetailRes, err error) {
	out, err := service.Author().Detail(ctx, &model.AuthorDetailIn{AuthorId: req.AuthorId})
	if err != nil {
		return nil, err
	}
	return &v1.DetailRes{out}, nil
}
