All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.mosip.kernel.masterdata.controller.UserDetailsHistoryController Maven / Gradle / Ivy

There is a newer version: 1.2.1.0
Show newest version
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;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy