-
Notifications
You must be signed in to change notification settings - Fork 0
LocationServer
This is a server for location service
- controller : spring controller
- service : spring service
- converter : spring converter
- exception : spring exception handler and custom exceptions
- interceptor: spring mvc interceptor
- task : spring task
- entity : hibernate orm entity
- data : internal processing data
controller handles all request, which means it will call corresponding service to fetch data based on the type of request, all return values from service are in type of entity, so it has to call corresponding converters to convert the data to correct type, after fetching all required data, those data will be returned to client in format of json. there is another process you have to notice, since we have to index the data for fuzzy search, we need to update indexes periodly, this is executed by task.
-
controller are all restfult controller and they are separated by api versions
-
service are simply divided into two types :
- database type: they all extend the
entityManagerContainer
so that they can use JPA to fetch data - index type : use indexer from lucene to manage data
- database type: they all extend the
-
exception contains a
APIExceptionHandler
, this is a global spring exception handler, it will block all exception, log it and then return a readable message -
interceptor contains a
LoggerInterceptor
, it will log all request message -
task contains a
IndexUpdateTask
, which use spring-task annotation to schedule the index update task