io.mosip.kernel.masterdata.controller.UserDetailsHistoryController Maven / Gradle / Ivy
package io.mosip.kernel.masterdata.controller;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;
import io.mosip.kernel.core.http.ResponseFilter;
import io.mosip.kernel.core.http.ResponseWrapper;
import io.mosip.kernel.masterdata.dto.postresponse.UserDetailsHistoryResponseDto;
import io.mosip.kernel.masterdata.service.UserDetailsHistoryService;
import io.swagger.annotations.Api;
/**
* Controller class for user details
*
* @author Sidhant Agarwal
* @since 1.0.0
*
*/
@RestController
@Api(tags = { "User Details" })
public class UserDetailsHistoryController {
@Autowired
UserDetailsHistoryService userDetailsHistoryService;
@PreAuthorize("hasAnyRole('INDIVIDUAL','ID_AUTHENTICATION','REGISTRATION_SUPERVISOR','REGISTRATION_OFFICER','REGISTRATION_PROCESSOR','ZONAL_ADMIN','PRE_REGISTRATION','RESIDENT')")
@ResponseFilter
@GetMapping(value = "/users/{id}/{eff_dtimes}")
public ResponseWrapper getTitlesBylangCode(@PathVariable("id") String userId,
@PathVariable("eff_dtimes") String date) {
ResponseWrapper responseWrapper = new ResponseWrapper<>();
responseWrapper.setResponse(userDetailsHistoryService.getByUserIdAndTimestamp(userId, date));
return responseWrapper;
}
}