Commit 69fa85cc authored by vikram singh's avatar vikram singh

Reverted Security Related Changes

parent dac93b4b
......@@ -81,21 +81,9 @@ public class AccountController {
}
// @RequestMapping(value = "/accounts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getAccounts(HttpServletRequest request) throws MyTeamException {
// List<Map<Object, Object>> accountsList = accountService.getAccountsList();
// log.info("The accounts list::" + accountsList);
//
// ResponseDetails getRespDetails = new ResponseDetails(new Date(), AccountStatus.GET_ACCOUNTS.getCode(), AccountStatus.GET_ACCOUNTS.getMessage(),
// "Accounts list", accountsList, request.getRequestURI(), "details", null);
//
// return new ResponseEntity<ResponseDetails>(getRespDetails, HttpStatus.OK);
//
// }
@RequestMapping(value = "/accountsByLoginId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAccounts(@RequestParam("loginId") String loginId ,HttpServletRequest request) throws MyTeamException {
List<Map<Object, Object>> accountsList = accountService.getAccountsListByLoginId(loginId);
@RequestMapping(value = "/accounts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAccounts(HttpServletRequest request) throws MyTeamException {
List<Map<Object, Object>> accountsList = accountService.getAccountsList();
log.info("The accounts list::" + accountsList);
ResponseDetails getRespDetails = new ResponseDetails(new Date(), AccountStatus.GET_ACCOUNTS.getCode(), AccountStatus.GET_ACCOUNTS.getMessage(),
......@@ -104,6 +92,18 @@ public class AccountController {
return new ResponseEntity<ResponseDetails>(getRespDetails, HttpStatus.OK);
}
// @RequestMapping(value = "/accountsByLoginId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getAccounts(@RequestParam("loginId") String loginId ,HttpServletRequest request) throws MyTeamException {
// List<Map<Object, Object>> accountsList = accountService.getAccountsListByLoginId(loginId);
// log.info("The accounts list::" + accountsList);
//
// ResponseDetails getRespDetails = new ResponseDetails(new Date(), AccountStatus.GET_ACCOUNTS.getCode(), AccountStatus.GET_ACCOUNTS.getMessage(),
// "Accounts list", accountsList, request.getRequestURI(), "details", null);
//
// return new ResponseEntity<ResponseDetails>(getRespDetails, HttpStatus.OK);
//
// }
@RequestMapping(value = "/accounts/names", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
......
......@@ -81,23 +81,23 @@ public class DomainController {
}
// @RequestMapping(value = "/domains", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getDomains(HttpServletRequest request) throws MyTeamException {
//
// ResponseDetails getRespDetails = new ResponseDetails(new Date(), DomainStatus.GET_DOMIAINS.getCode(), DomainStatus.GET_DOMIAINS.getMessage(),
// "Domains list", domainService.getDomainsList(), request.getRequestURI(), "details", null);
//
// return new ResponseEntity<ResponseDetails>(getRespDetails, HttpStatus.OK);
// }
@RequestMapping(value = "/domainsByLoginId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getDomains(@RequestParam("loginId") String loginId ,HttpServletRequest request) throws MyTeamException {
@RequestMapping(value = "/domains", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getDomains(HttpServletRequest request) throws MyTeamException {
ResponseDetails getRespDetails = new ResponseDetails(new Date(), DomainStatus.GET_DOMIAINS.getCode(), DomainStatus.GET_DOMIAINS.getMessage(),
"Domains list", domainService.getDomainsListByLoginId(loginId), request.getRequestURI(), "details", null);
"Domains list", domainService.getDomainsList(), request.getRequestURI(), "details", null);
return new ResponseEntity<ResponseDetails>(getRespDetails, HttpStatus.OK);
}
// @RequestMapping(value = "/domainsByLoginId", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getDomains(@RequestParam("loginId") String loginId ,HttpServletRequest request) throws MyTeamException {
//
// ResponseDetails getRespDetails = new ResponseDetails(new Date(), DomainStatus.GET_DOMIAINS.getCode(), DomainStatus.GET_DOMIAINS.getMessage(),
// "Domains list", domainService.getDomainsListByLoginId(loginId), request.getRequestURI(), "details", null);
//
// return new ResponseEntity<ResponseDetails>(getRespDetails, HttpStatus.OK);
// }
//getting domains list under accountId which is an active.
@RequestMapping(value = "/domains/{accountId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
......
......@@ -332,18 +332,6 @@ public class ProjectService implements IProjectService {
Need to refactor the following code
*/
@Override
public List<HashMap<Object, Object>> getRoleBasedProjects(String empId) throws MyTeamException {
List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>();
Set<String> accountIdSet = domainService.accountsAssignedToDeliveryLead(empId);
List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet);
for (Project proj : projectList) {
if(proj.getDeliveryLeadIds().stream().anyMatch(e->e.equals(empId)))
addToProjectList(projectsList, proj);
}
return projectsList;
}
// @Override
// public List<HashMap<Object, Object>> getRoleBasedProjects(String empId) throws MyTeamException {
// List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>();
......@@ -351,10 +339,22 @@ public class ProjectService implements IProjectService {
// List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet);
//
// for (Project proj : projectList) {
// addToProjectList(projectsList, proj);
// if(proj.getDeliveryLeadIds().stream().anyMatch(e->e.equals(empId)))
// addToProjectList(projectsList, proj);
// }
// return projectsList;
// }
@Override
public List<HashMap<Object, Object>> getRoleBasedProjects(String empId) throws MyTeamException {
List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>();
Set<String> accountIdSet = domainService.accountsAssignedToDeliveryLead(empId);
List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet);
for (Project proj : projectList) {
addToProjectList(projectsList, proj);
}
return projectsList;
}
@Override
public List<HashMap<Object, Object>> getProjectsInsteadOfRole() throws MyTeamException {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment