0
Je suis en train de tester Spring Data REST. Je suivais this tutorial pour comprendre comment cela fonctionne.Configuration de X-Total-Count avec Spring Data REST
Le code à ce jour est simple:
@Entity
@SequenceGenerator(name="my_seq", sequenceName="user_id_seq")
@Table(name = "employees")
data class Employee (@Id @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "my_seq") val id: Long? = null,
val name: String = "defConstructorHell")
et quand je demande avec GET
j'obtenir le JSON suivant:
{
"_embedded" : {
"employees" : [ {
"name" : "ciao",
"_links" : {
"self" : {
"href" : "http://localhost:5000/api/employees/1"
},
"employee" : {
"href" : "http://localhost:5000/api/employees/1"
}
}
} ]
},
"_links" : {
"self" : {
"href" : "http://localhost:5000/api/employees{?page,size,sort}",
"templated" : true
},
"profile" : {
"href" : "http://localhost:5000/api/profile/employees"
}
},
"page" : {
"size" : 20,
"totalElements" : 1,
"totalPages" : 1,
"number" : 0
}
}
Ce qui est tout à fait bien, mais j'utilise un cadre de js cela nécessite l'en-tête X-Total-Count.
Savez-vous s'il y a un moyen de le faire avec Spring Data REST?
Avez-vous vu ce post https://stackoverflow.com/q/19251846/5380322 .. – Cepr0