It is estimated that you are using hibernate's automatic annotation, and there is a one-to-many and many-to-one relationship. This requires adding the annotation @JsonIgnore to the unnecessary fields.
In this case, in the list When converting to json, fields with @JsonIgnore will be ignored