No serializer found for class com.example.news.entity.Users and no properties discovered to create BeanSerializer (to avoid exception, disable SerializationFeature.FAIL_ON_EMPTY_BEANS) (through reference chain: java.util.ArrayList[0])
问题:序列化器(Serializer)未找到,无法将 Users 对象转换为 JSON
解决方案
方案1:使用 Jackson 的注解来标记需要序列化的字段
方案2:如果你不想手动编写 getter 和 setter 方法,可以使用 Lombok 注解来自动生成这些方法