Move Views config into component
This commit is contained in:
@@ -5,7 +5,7 @@ import fr.dcproject.entity.ViewAggregation
|
||||
import fr.dcproject.utils.contentToString
|
||||
import fr.dcproject.utils.getJsonField
|
||||
import fr.dcproject.utils.toIso
|
||||
import fr.dcproject.views.ViewManager
|
||||
import fr.dcproject.component.views.ViewManager
|
||||
import org.elasticsearch.client.Request
|
||||
import org.elasticsearch.client.Response
|
||||
import org.elasticsearch.client.RestClient
|
||||
|
||||
18
src/main/kotlin/component/views/ViewManager.kt
Normal file
18
src/main/kotlin/component/views/ViewManager.kt
Normal file
@@ -0,0 +1,18 @@
|
||||
package fr.dcproject.component.views
|
||||
|
||||
import fr.dcproject.component.citizen.CitizenI
|
||||
import fr.dcproject.entity.ViewAggregation
|
||||
import org.elasticsearch.client.Response
|
||||
import org.joda.time.DateTime
|
||||
|
||||
interface ViewManager <T> {
|
||||
/**
|
||||
* Add view to one entity
|
||||
*/
|
||||
fun addView(ip: String, entity: T, citizen: CitizenI? = null, dateTime: DateTime = DateTime.now()): Response?
|
||||
|
||||
/**
|
||||
* Get Views aggregations
|
||||
*/
|
||||
fun getViewsCount(entity: T): ViewAggregation
|
||||
}
|
||||
Reference in New Issue
Block a user