一、问题场景:泛型类型擦除引发的血案 在基于Spring的BaseService框架中,我们经常遇到这样的代码: public class BaseService<T, ID> { public T getById(ID id) { // 硬编码索引获取实际类型 ……