package com.ankurm.feign;

import com.ankurm.feign.client.StudentClient;
import java.util.List;
import org.springframework.stereotype.Service;

/** Inject the Feign interface like any other bean; Spring Cloud OpenFeign builds the proxy behind it. */
@Service
public class EnrollmentService {

    private final StudentClient studentClient;

    public EnrollmentService(StudentClient studentClient) {
        this.studentClient = studentClient;   // inject the interface; Feign builds the proxy
    }

    public List<Student> activeStudents() {
        return studentClient.findAll();
    }
}
