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

Reverted Security Related Changes

parent dac93b4b
...@@ -81,21 +81,9 @@ public class AccountController { ...@@ -81,21 +81,9 @@ public class AccountController {
} }
// @RequestMapping(value = "/accounts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/accounts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getAccounts(HttpServletRequest request) throws MyTeamException { public ResponseEntity<?> getAccounts(HttpServletRequest request) throws MyTeamException {
// List<Map<Object, Object>> accountsList = accountService.getAccountsList(); 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);
log.info("The accounts list::" + accountsList); log.info("The accounts list::" + accountsList);
ResponseDetails getRespDetails = new ResponseDetails(new Date(), AccountStatus.GET_ACCOUNTS.getCode(), AccountStatus.GET_ACCOUNTS.getMessage(), ResponseDetails getRespDetails = new ResponseDetails(new Date(), AccountStatus.GET_ACCOUNTS.getCode(), AccountStatus.GET_ACCOUNTS.getMessage(),
...@@ -105,6 +93,18 @@ public class AccountController { ...@@ -105,6 +93,18 @@ public class AccountController {
} }
// @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) @RequestMapping(value = "/accounts/names", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<?> getAccountNames(HttpServletRequest request) throws MyTeamException { public ResponseEntity<?> getAccountNames(HttpServletRequest request) throws MyTeamException {
......
...@@ -81,24 +81,24 @@ public class DomainController { ...@@ -81,24 +81,24 @@ public class DomainController {
} }
// @RequestMapping(value = "/domains", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/domains", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
// public ResponseEntity<?> getDomains(HttpServletRequest request) throws MyTeamException { 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 {
ResponseDetails getRespDetails = new ResponseDetails(new Date(), DomainStatus.GET_DOMIAINS.getCode(), DomainStatus.GET_DOMIAINS.getMessage(), 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); 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. //getting domains list under accountId which is an active.
@RequestMapping(value = "/domains/{accountId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE) @RequestMapping(value = "/domains/{accountId}", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Domain>> getDomains(@PathVariable("accountId") String accountId) throws MyTeamException { public ResponseEntity<List<Domain>> getDomains(@PathVariable("accountId") String accountId) throws MyTeamException {
......
...@@ -332,18 +332,6 @@ public class ProjectService implements IProjectService { ...@@ -332,18 +332,6 @@ public class ProjectService implements IProjectService {
Need to refactor the following code 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 // @Override
// public List<HashMap<Object, Object>> getRoleBasedProjects(String empId) throws MyTeamException { // public List<HashMap<Object, Object>> getRoleBasedProjects(String empId) throws MyTeamException {
// List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>(); // List<HashMap<Object, Object>> projectsList = new ArrayList<HashMap<Object, Object>>();
...@@ -351,10 +339,22 @@ public class ProjectService implements IProjectService { ...@@ -351,10 +339,22 @@ public class ProjectService implements IProjectService {
// List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet); // List<Project> projectList = projectRepo.findByAccountIdIn(accountIdSet);
// //
// for (Project proj : projectList) { // for (Project proj : projectList) {
// if(proj.getDeliveryLeadIds().stream().anyMatch(e->e.equals(empId)))
// addToProjectList(projectsList, proj); // addToProjectList(projectsList, proj);
// } // }
// return projectsList; // 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 @Override
public List<HashMap<Object, Object>> getProjectsInsteadOfRole() throws MyTeamException { 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