Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mytime
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Narendar Vakiti
mytime
Commits
69fa85cc
Commit
69fa85cc
authored
Jun 24, 2019
by
vikram singh
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Reverted Security Related Changes
parent
dac93b4b
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
40 additions
and
40 deletions
+40
-40
AccountController.java
...n/java/com/nisum/myteam/controller/AccountController.java
+15
-15
DomainController.java
...in/java/com/nisum/myteam/controller/DomainController.java
+12
-12
ProjectService.java
...in/java/com/nisum/myteam/service/impl/ProjectService.java
+13
-13
No files found.
src/main/java/com/nisum/myteam/controller/AccountController.java
View file @
69fa85cc
...
...
@@ -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
)
...
...
src/main/java/com/nisum/myteam/controller/DomainController.java
View file @
69fa85cc
...
...
@@ -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
.
getDomainsList
ByLoginId
(
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
)
...
...
src/main/java/com/nisum/myteam/service/impl/ProjectService.java
View file @
69fa85cc
...
...
@@ -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
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment