Commit deb28aca authored by Vijay Akula's avatar Vijay Akula

Refactored the code related to UserController,UserService and UserRepo.

parent 65c9aaa9
......@@ -18,18 +18,18 @@ import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.AttendenceData;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.service.AttendanceService;
import com.nisum.mytime.service.UserService;
import com.nisum.mytime.service.IAttendanceService;
import com.nisum.mytime.service.IEmployeeService;
@RestController
@RequestMapping("/attendance")
public class AttendanceController {
@Autowired
private UserService userService;
private IEmployeeService userService;
@Autowired
private AttendanceService attendanceService;
private IAttendanceService attendanceService;
@RequestMapping(value = "employeeLoginsBasedOnDate",
method = RequestMethod.GET,
......
package com.nisum.mytime.controller;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Designation;
import com.nisum.mytime.service.impl.DesignationService;
@RestController
public class DesignationController {
@Autowired
DesignationService designationService;
// @RequestMapping(value = "/getAllDesignations", method =
// RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/employees/designations/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAllDesignations() throws MyTimeException {
List<String> designations = designationService.getAllDesignations().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getActiveStatus())).map(Designation::getDesignationName).sorted()
.collect(Collectors.toList());
return new ResponseEntity<>(designations, HttpStatus.OK);
}
}
......@@ -11,13 +11,13 @@ import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.model.EmailDomain;
import com.nisum.mytime.service.MailService;
import com.nisum.mytime.service.IMailService;
@RestController
public class EmailController {
@Autowired
private MailService mailService;
private IMailService mailService;
@RequestMapping(value = "/sendEmail", method = RequestMethod.POST, produces = MediaType.TEXT_PLAIN_VALUE)
public ResponseEntity<String> sendAttachmentMail(@RequestBody EmailDomain emailObj) {
......
package com.nisum.mytime.controller;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmployeeLocationDetails;
import com.nisum.mytime.service.impl.EmployeeLocationService;
@RestController
public class EmployeeLocationController {
@Autowired
EmployeeLocationService empLocationService;
@RequestMapping(value = "/getEmployeeLocations", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<EmployeeLocationDetails>> getEmployeeLocations(@RequestParam("employeeId") String empId)
throws MyTimeException {
List<EmployeeLocationDetails> employeeLocationDetails = empLocationService.getEmployeeLocationDetails(empId);
return new ResponseEntity<>(employeeLocationDetails, HttpStatus.OK);
}
}
package com.nisum.mytime.controller;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.MasterData;
import com.nisum.mytime.service.impl.MasterDataService;
@RestController
public class MasterDataController {
@Autowired
MasterDataService masterDataService;
@RequestMapping(value = "/getMasterData", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Map<String, List<String>>> getMasterData() throws MyTimeException {
Map<String, List<String>> masterDataMap = new HashMap<>();
Map<String, List<MasterData>> result = masterDataService.getMasterData().stream()
.filter(e -> (e.isActiveStatus() == true))
.collect(Collectors.groupingBy(MasterData::getMasterDataType));
for (String key : result.keySet()) {
List<MasterData> valueList = result.get(key);
List<String> technologies = valueList.stream().map(MasterData::getMasterDataName).sorted()
.collect(Collectors.toList());
masterDataMap.put(key, technologies);
}
return new ResponseEntity<>(masterDataMap, HttpStatus.OK);
}
}
package com.nisum.mytime.controller;
import java.util.List;
import java.util.stream.Collectors;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Location;
import com.nisum.mytime.service.impl.OrgLocationService;
@RestController
public class OrgLocationController {
@Autowired
OrgLocationService orgLocationService;
private static final Logger logger = LoggerFactory.getLogger(OrgLocationController.class);
// @RequestMapping(value = "/getLocations", method = RequestMethod.GET,
// produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/employees/locations/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getLocations() throws MyTimeException {
// System.out.println(" userService.getLocations()" +
// orgLocationService.getLocations());
List<String> locations = orgLocationService.getLocations().stream().filter(e -> (e.isActiveStatus() == true))
.map(Location::getLocation).sorted().collect(Collectors.toList());
logger.info("getLocations " + locations);
return new ResponseEntity<>(locations, HttpStatus.OK);
}
}
......@@ -19,8 +19,8 @@ import com.nisum.mytime.model.Employee;
import com.nisum.mytime.model.Project;
import com.nisum.mytime.repository.AccountRepo;
import com.nisum.mytime.repository.ProjectRepo;
import com.nisum.mytime.service.ProjectService;
import com.nisum.mytime.service.UserService;
import com.nisum.mytime.service.IProjectService;
import com.nisum.mytime.service.IEmployeeService;
import com.nisum.mytime.utils.MyTimeUtils;
@RestController
......@@ -28,10 +28,10 @@ import com.nisum.mytime.utils.MyTimeUtils;
public class ProjectController {
@Autowired
private UserService userService;
private IEmployeeService userService;
@Autowired
private ProjectService projectService;
private IProjectService projectService;
@Autowired
private AccountRepo accountRepo;
......@@ -42,7 +42,7 @@ public class ProjectController {
@RequestMapping(value = "/employee", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Employee> getEmployeeRole(@RequestParam("emailId") String emailId)
throws MyTimeException {
Employee employeesRole = userService.getEmployeesRole(emailId);
Employee employeesRole = userService.getEmployeeByEmaillId(emailId);
return new ResponseEntity<>(employeesRole, HttpStatus.OK);
}
......
......@@ -23,8 +23,8 @@ import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.Project;
import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.repository.EmployeeVisaRepo;
import com.nisum.mytime.service.ProjectService;
import com.nisum.mytime.service.UserService;
import com.nisum.mytime.service.IProjectService;
import com.nisum.mytime.service.IEmployeeService;
import com.nisum.mytime.utils.MyTimeUtils;
@RestController
......@@ -32,10 +32,10 @@ import com.nisum.mytime.utils.MyTimeUtils;
public class ProjectTeamController {
@Autowired
private UserService userService;
private IEmployeeService userService;
@Autowired
private ProjectService projectService;
private IProjectService projectService;
@Autowired
private EmployeeVisaRepo employeeVisaRepo;
......@@ -44,7 +44,7 @@ public class ProjectTeamController {
produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<Employee> getEmployeeRole(
@RequestParam("emailId") String emailId) throws MyTimeException {
Employee employeesRole = userService.getEmployeesRole(emailId);
Employee employeesRole = userService.getEmployeeByEmaillId(emailId);
return new ResponseEntity<>(employeesRole, HttpStatus.OK);
}
......@@ -98,8 +98,8 @@ public class ProjectTeamController {
public ResponseEntity<List<Employee>> getManagers()
throws MyTimeException {
List<Employee> employeesRoles = new ArrayList<>();
if (userService.getEmployeeRoles() != null) {
employeesRoles = userService.getEmployeeRoles().stream()
if (userService.getActiveEmployees() != null) {
employeesRoles = userService.getActiveEmployees().stream()
.sorted((o1, o2) -> o1.getEmployeeName()
.compareTo(o2.getEmployeeName()))
.collect(Collectors.toList());
......@@ -301,7 +301,7 @@ public class ProjectTeamController {
.collect(Collectors.toList());
}
if (employeeIds != null && !employeeIds.isEmpty()) {
List<Employee> emps = userService.getEmployeeRoles();
List<Employee> emps = userService.getActiveEmployees();
for (Employee emp : emps) {
if (employeeIds.contains(emp.getEmployeeId())) {
employees.add(emp);
......@@ -311,8 +311,8 @@ public class ProjectTeamController {
return new ResponseEntity<>(employees, HttpStatus.OK);
} else {
//List<EmployeeRoles> employees = new ArrayList<>();
if (userService.getEmployeeRoles() != null) {
employees = userService.getEmployeeRoles().stream()
if (userService.getActiveEmployees() != null) {
employees = userService.getActiveEmployees().stream()
.sorted((o1, o2) -> o1.getEmployeeName()
.compareTo(o2.getEmployeeName()))
.collect(Collectors.toList());
......
......@@ -41,18 +41,18 @@ import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.model.ReportSeriesRecord;
import com.nisum.mytime.repository.EmployeeVisaRepo;
import com.nisum.mytime.repository.TeamMatesBillingRepo;
import com.nisum.mytime.service.ProjectService;
import com.nisum.mytime.service.UserService;
import com.nisum.mytime.service.IProjectService;
import com.nisum.mytime.service.IEmployeeService;
@RestController
@RequestMapping("/reports")
public class ReportsController {
@Autowired
private UserService userService;
private IEmployeeService userService;
@Autowired
private ProjectService projectService;
private IProjectService projectService;
@Autowired
private EmployeeVisaRepo employeeVisaRepo;
......
package com.nisum.mytime.controller;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Shift;
import com.nisum.mytime.service.impl.ShiftService;
@RestController
public class ShiftController {
@Autowired
ShiftService shiftService;
// @RequestMapping(value = "/getAllShifts", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/employees/shifts/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getAllShifts() throws MyTimeException {
List<String> shifts = shiftService.getAllShifts().stream().filter(e -> "Y".equalsIgnoreCase(e.getActiveStatus()))
.map(Shift::getShiftName).sorted().collect(Collectors.toList());
return new ResponseEntity<>(shifts, HttpStatus.OK);
}
}
package com.nisum.mytime.controller;
import java.util.List;
import java.util.stream.Collectors;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.HttpStatus;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Skill;
import com.nisum.mytime.service.impl.SkillService;
@RestController
public class SkillController {
@Autowired
SkillService skillService;
// @RequestMapping(value = "/getSkills", method = RequestMethod.GET,
// produces = MediaType.APPLICATION_JSON_VALUE)
@RequestMapping(value = "/employees/skills/", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<String>> getTechnologies() throws MyTimeException {
List<String> technologies = skillService.getTechnologies().stream()
.filter(e -> "Y".equalsIgnoreCase(e.getActiveStatus())).map(Skill::getSkillName).sorted()
.collect(Collectors.toList());
return new ResponseEntity<>(technologies, HttpStatus.OK);
}
}
......@@ -15,14 +15,14 @@ import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.TravelRequest;
import com.nisum.mytime.model.Visa;
import com.nisum.mytime.service.VisaService;
import com.nisum.mytime.service.IVisaService;
@RestController
@RequestMapping("/visa")
public class VisaController {
@Autowired
private VisaService visaService;
private IVisaService visaService;
@RequestMapping(value = "/getAllVisas", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
public ResponseEntity<List<Visa>> getAllVisas() throws MyTimeException {
......
......@@ -23,7 +23,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Accounts")
@Document(collection = "accounts")
public class Account implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -17,7 +17,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Designations")
@Document(collection = "designations")
public class Designation implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -22,7 +22,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Domains")
@Document(collection = "domains")
public class Domain implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -19,7 +19,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "EmployeeDetails")
@Document(collection = "employees")
public class Employee implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -17,7 +17,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "MasterData")
@Document(collection = "masterData")
public class MasterData implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -21,7 +21,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Teams")
@Document(collection = "projects")
public class Project extends AuditFields implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -17,8 +17,8 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Role")
public class RoleInfo implements Serializable {
@Document(collection = "roles")
public class Role implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -17,7 +17,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Shifts")
@Document(collection = "shifts")
public class Shift implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -17,7 +17,7 @@ import lombok.ToString;
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Document(collection = "Skills")
@Document(collection = "skills")
public class Skill implements Serializable {
private static final long serialVersionUID = 1L;
......
......@@ -7,7 +7,7 @@ import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Employee;
public interface EmployeeRolesRepo
public interface EmployeeRepo
extends MongoRepository<Employee, String> {
Employee findByEmailId(String emailId);
......
......@@ -2,11 +2,11 @@ package com.nisum.mytime.repository;
import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.RoleInfo;
import com.nisum.mytime.model.Role;
public interface RoleInfoRepo extends MongoRepository<RoleInfo, String> {
public interface RoleInfoRepo extends MongoRepository<Role, String> {
RoleInfo findByRoleName(String roleName);
Role findByRoleName(String roleName);
RoleInfo findByRoleId(String roleId);
Role findByRoleId(String roleId);
}
\ No newline at end of file
......@@ -5,6 +5,6 @@ import org.springframework.data.mongodb.repository.MongoRepository;
import com.nisum.mytime.model.Skill;
public interface TechnologyRepo extends MongoRepository<Skill, String> {
public interface SkillRepo extends MongoRepository<Skill, String> {
}
\ No newline at end of file
......@@ -8,7 +8,7 @@ import org.quartz.JobExecutionContext;
import org.springframework.beans.factory.annotation.Autowired;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.service.EmployeeDataService;
import com.nisum.mytime.service.impl.EmployeeDataService;
import com.nisum.mytime.utils.MyTimeLogger;
@DisallowConcurrentExecution
......
......@@ -11,8 +11,6 @@ import com.nisum.mytime.model.Account;
@Service
public interface IAccountService {
Account createAccount(Account account) throws MyTimeException;
Account updateAccount(Account account) throws MyTimeException;
......
......@@ -8,7 +8,7 @@ import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.AttendenceData;
import com.nisum.mytime.model.EmpLoginData;
public interface AttendanceService {
public interface IAttendanceService {
List<AttendenceData> getAttendanciesReport(String reportDate,String shift) throws MyTimeException, SQLException;
......
package com.nisum.mytime.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Designation;
@Service
public interface IDesignationService {
List<Designation> getAllDesignations() throws MyTimeException;
}
......@@ -30,4 +30,6 @@ public interface IDomainService {
List<Domain> getDomainsList() throws MyTimeException;
Set<String> accountsAssignedToDeliveryLead(String empId) throws MyTimeException;
List<Domain> getDomainsUnderAccount(String accountId)throws MyTimeException;
}
package com.nisum.mytime.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.nisum.mytime.model.Employee;
import com.nisum.mytime.model.EmployeeLocationDetails;
@Service
public interface IEmployeeLocationService {
public void saveEmployeeLocationDetails(Employee employee) ;
public List<EmployeeLocationDetails> getEmployeeLocationDetails(String empId);
}
......@@ -4,6 +4,8 @@ import java.text.ParseException;
import java.util.HashMap;
import java.util.List;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;
import org.springframework.web.multipart.MultipartFile;
import com.nisum.mytime.exception.handler.MyTimeException;
......@@ -19,7 +21,10 @@ import com.nisum.mytime.model.MasterData;
import com.nisum.mytime.model.Shift;
import com.nisum.mytime.model.Skill;
public interface UserService {
@Service
public interface IEmployeeService {
List<Employee> getManagers()throws MyTimeException;
Boolean fetchEmployeesData(String perticularDate, boolean resynchFlag)
throws MyTimeException;
......@@ -27,9 +32,9 @@ public interface UserService {
List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate,
String toDate) throws MyTimeException;
List<Employee> getEmployeeRoles() throws MyTimeException;
List<Employee> getActiveEmployees() throws MyTimeException;
Employee assigingEmployeeRole(Employee employeeRoles, String empId)
Employee createEmployee(Employee employeeRoles, String empId)
throws MyTimeException;
List generatePdfReport(long id, String fromDate, String toDate)
......@@ -38,7 +43,7 @@ public interface UserService {
List generatePdfReport(long id, String fromDate, String toDate,String fromTime,String toTime)
throws MyTimeException, ParseException;
Employee getEmployeesRole(String emailId);
Employee getEmployeeByEmaillId(String emailId);
void deleteEmployee(String empId);
......@@ -47,31 +52,31 @@ public interface UserService {
void updateEmployeeLocationDetails(Employee employeeRoles,
boolean delete);
void saveEmployeeLocationDetails(Employee employeeRoles);
//void saveEmployeeLocationDetails(Employee employeeRoles);
Employee getEmployeesRoleData(String empId);
List<EmployeeLocationDetails> getEmployeeLocationDetails(String empId);
//List<EmployeeLocationDetails> getEmployeeLocationDetails(String empId);
List<Shift> getAllShifts() throws MyTimeException;
// List<Shift> getAllShifts() throws MyTimeException;
List<Designation> getAllDesignations() throws MyTimeException;
// List<Designation> getAllDesignations() throws MyTimeException;
List<Skill> getTechnologies() throws MyTimeException;
//List<Skill> getTechnologies() throws MyTimeException;
public Employee updateProfile(Employee employeeRoles)
throws MyTimeException;
public List<Account> getAccounts() throws MyTimeException;
List<Location> getLocations() throws MyTimeException;
//List<Location> getLocations() throws MyTimeException;
Employee getEmployeeRoleDataForSearchCriteria(String searchId,
String searchAttribute);
List<String> getEmployeeDetailsForAutocomplete();
List<MasterData> getMasterData() throws MyTimeException;
//List<MasterData> getMasterData() throws MyTimeException;
List<Employee> getEmployeesByFunctionalGrp(String functionalGrp);
......
......@@ -9,7 +9,7 @@ import com.nisum.mytime.model.EmailDomain;
* @author nisum
*
*/
public interface MailService {
public interface IMailService {
public String sendEmailWithAttachment(EmailDomain emailObj);
......
package com.nisum.mytime.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.MasterData;
@Service
public interface IMasterDataService {
List<MasterData> getMasterData() throws MyTimeException;
}
package com.nisum.mytime.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Location;
@Service
public interface IOrgLocationService {
List<Location> getLocations() throws MyTimeException;
}
......@@ -14,7 +14,10 @@ import com.nisum.mytime.model.Employee;
import com.nisum.mytime.model.Project;
import com.nisum.mytime.model.ProjectTeamMate;
public interface ProjectService {
public interface IProjectService {
public ProjectTeamMate addNewBeanchAllocation(Employee employee,String loginEmpId);
List<EmpLoginData> employeeLoginsBasedOnDate(long id, String fromDate,
String toDate) throws MyTimeException;
......
package com.nisum.mytime.service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.RoleInfo;
import com.nisum.mytime.model.Role;
public interface RoleInfoService {
public interface IRoleInfoService {
public RoleInfo addRole(RoleInfo roleInfo) throws MyTimeException;
public Role addRole(Role roleInfo) throws MyTimeException;
public String getRole(String roleName) throws MyTimeException;
}
......@@ -6,7 +6,7 @@ import java.util.Set;
import com.mongodb.WriteResult;
import com.nisum.mytime.exception.handler.MyTimeException;
public interface RoleMappingService {
public interface IRoleMappingService {
void addEmployeeRole(String employeeId, String roleId) throws MyTimeException;
......
package com.nisum.mytime.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Shift;
@Service
public interface IShiftService {
List<Shift> getAllShifts() throws MyTimeException;
}
package com.nisum.mytime.service;
import java.util.List;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Skill;
@Service
public interface ISkillService {
List<Skill> getTechnologies() throws MyTimeException;
}
......@@ -16,7 +16,7 @@ import com.nisum.mytime.model.Visa;
* @author nisum
*
*/
public interface VisaService {
public interface IVisaService {
List<Visa> getAllVisas();
......
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.util.ArrayList;
import java.util.Collections;
......@@ -21,6 +21,9 @@ import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.model.Employee;
import com.nisum.mytime.repository.AccountRepo;
import com.nisum.mytime.service.IAccountService;
import com.nisum.mytime.service.IRoleInfoService;
import com.nisum.mytime.service.IRoleMappingService;
import com.nisum.mytime.utils.CommomUtil;
import com.nisum.mytime.utils.MyTimeUtils;
......@@ -34,10 +37,10 @@ public class AccountService implements IAccountService {
private MongoTemplate mongoTemplate;
@Autowired
private RoleInfoService roleInfoService;
private IRoleInfoService roleInfoService;
@Autowired
private RoleMappingService roleMappingService;
private IRoleMappingService roleMappingService;
private static final Logger logger = LoggerFactory.getLogger(AccountService.class);
......
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.sql.Connection;
import java.sql.ResultSet;
......@@ -23,13 +23,14 @@ import com.nisum.mytime.model.AttendenceData;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.repository.ProjectTeamMatesRepo;
import com.nisum.mytime.service.IAttendanceService;
import com.nisum.mytime.utils.CommomUtil;
import com.nisum.mytime.utils.MyTimeLogger;
import com.nisum.mytime.utils.MyTimeUtils;
import com.nisum.mytime.utils.PdfReportGenerator;
@Service
public class AttendanceServiceImpl implements AttendanceService {
public class AttendanceService implements IAttendanceService {
@Autowired
private EmployeeDataService employeeDataBaseService;
......
package com.nisum.mytime.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Designation;
import com.nisum.mytime.repository.DesignationRepo;
import com.nisum.mytime.service.IDesignationService;
@Service
public class DesignationService implements IDesignationService {
@Autowired
private DesignationRepo designationRepo;
@Override
public List<Designation> getAllDesignations() throws MyTimeException {
return designationRepo.findAll();
}
}
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.util.ArrayList;
import java.util.Collections;
......@@ -21,6 +21,9 @@ import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Domain;
import com.nisum.mytime.model.Employee;
import com.nisum.mytime.repository.DomainRepo;
import com.nisum.mytime.service.IDomainService;
import com.nisum.mytime.service.IRoleInfoService;
import com.nisum.mytime.service.IRoleMappingService;
import com.nisum.mytime.utils.CommomUtil;
import com.nisum.mytime.utils.MyTimeUtils;
......@@ -38,10 +41,10 @@ public class DomainService implements IDomainService {
private MongoTemplate mongoTemplate;
@Autowired
private RoleInfoService roleInfoService;
private IRoleInfoService roleInfoService;
@Autowired
private RoleMappingService roleMappingService;
private IRoleMappingService roleMappingService;
private static final Logger logger = LoggerFactory.getLogger(DomainService.class);
......@@ -96,7 +99,7 @@ public class DomainService implements IDomainService {
private void updateRoleIdsForDMs(Domain domainReq, String roleId) throws MyTimeException {
Domain domainDAO = getDomainById(domainReq.getDomainId());
Domain domainDAO = getDomainByStatusActive(domainReq.getDomainId());
List dmssListDAO = domainDAO.getDeliveryManagers();
List dmsListReq = domainReq.getDeliveryManagers();
List<String> managersAddedByUser = managersAddedByUser = CommomUtil.getAddedManagersListForDM(dmssListDAO,
......@@ -108,7 +111,7 @@ public class DomainService implements IDomainService {
private void deleteRoleIdsForDMs(Domain domainUpdating, String roleId) throws MyTimeException {
Map<String, Integer> managersDomainCount = new HashMap<String, Integer>();
Domain domainDAO = getDomainById(domainUpdating.getDomainId());
Domain domainDAO = getDomainByStatusActive(domainUpdating.getDomainId());
List dmsListDAO = domainDAO.getDeliveryManagers();
List dmsListReq = domainUpdating.getDeliveryManagers();
......@@ -191,7 +194,7 @@ public class DomainService implements IDomainService {
}
// Custom methods
private Domain getDomainById(String domainId) {
private Domain getDomainByStatusActive(String domainId) {
Query selectedDomainQuery = new Query(
Criteria.where(MyTimeUtils.DOMAIN_ID).in(domainId).and(MyTimeUtils.STATUS).in(MyTimeUtils.ACTIVE));
List<Domain> selectedDomain = mongoTemplate.find(selectedDomainQuery, Domain.class);
......@@ -200,6 +203,7 @@ public class DomainService implements IDomainService {
return null;
}
private boolean duplicateCheck(String domainName, String accountId, List<String> fromDB, List fromUser) {
boolean check = false;
int count = 0;
......@@ -227,4 +231,22 @@ public class DomainService implements IDomainService {
return accIdsSet;
}
public Domain getDomainById(String domainId) {
Domain domain = null;
if (domainId != null && domainId.length() > 0) {
domain = domainRepo.findByDomainId(domainId);
}
return domain;
}
@Override
public List<Domain> getDomainsUnderAccount(String accountId) throws MyTimeException {
List<Domain> domains = domainRepo.findByAccountId(accountId);
return domains;
}
}
\ No newline at end of file
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.sql.Connection;
import java.sql.ResultSet;
......@@ -20,6 +20,7 @@ import org.springframework.stereotype.Component;
import com.nisum.mytime.configuration.DbConnection;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.service.IEmployeeDataService;
import com.nisum.mytime.utils.CommomUtil;
import com.nisum.mytime.utils.MyTimeLogger;
import com.nisum.mytime.utils.MyTimeUtils;
......
package com.nisum.mytime.service.impl;
import java.util.Date;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nisum.mytime.model.Employee;
import com.nisum.mytime.model.EmployeeLocationDetails;
import com.nisum.mytime.repository.EmployeeLocationDetailsRepo;
import com.nisum.mytime.service.IEmployeeLocationService;
@Service
public class EmployeeLocationService implements IEmployeeLocationService{
@Autowired
private EmployeeLocationDetailsRepo employeeLocationDetailsRepo;
@Override
public void saveEmployeeLocationDetails(Employee employee) {
EmployeeLocationDetails employeeLocationDetails = new EmployeeLocationDetails();
employeeLocationDetails.setActive(employee.getEmpStatus().equalsIgnoreCase("Active"));
employeeLocationDetails.setEmployeeId(employee.getEmployeeId());
employeeLocationDetails.setEmployeeName(employee.getEmployeeName());
employeeLocationDetails.setCreateDate(new Date());
employeeLocationDetails.setEndDate(new Date());
employeeLocationDetails.setUpdatedDate(new Date());
employeeLocationDetails.setStartDate(new Date());
employeeLocationDetails.setEmpLocation(employee.getEmpLocation());
employeeLocationDetailsRepo.save(employeeLocationDetails);
}
@Override
public List<EmployeeLocationDetails> getEmployeeLocationDetails(String empId) {
return employeeLocationDetailsRepo.findByEmployeeId(empId);
}
}
/**
*
*/
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.io.File;
import java.io.IOException;
......@@ -20,15 +20,16 @@ import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Service;
import com.nisum.mytime.model.EmailDomain;
import com.nisum.mytime.service.IMailService;
/**
* @author nisum
*
*/
@Service
public class MailServiceImpl implements MailService {
public class MailService implements IMailService {
private static final Logger logger = LoggerFactory.getLogger(MailServiceImpl.class);
private static final Logger logger = LoggerFactory.getLogger(MailService.class);
@Autowired
JavaMailSender emailSender;
......
package com.nisum.mytime.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.MasterData;
import com.nisum.mytime.repository.MasterDataRepo;
import com.nisum.mytime.service.IMasterDataService;
public class MasterDataService implements IMasterDataService {
@Autowired
private MasterDataRepo masterDataRepo;
@Override
public List<MasterData> getMasterData() throws MyTimeException {
return masterDataRepo.findAll();
}
}
package com.nisum.mytime.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Location;
import com.nisum.mytime.repository.LocationRepo;
import com.nisum.mytime.service.IOrgLocationService;
@Service
public class OrgLocationService implements IOrgLocationService {
@Autowired
private LocationRepo locationRepo;
@Override
public List<Location> getLocations() throws MyTimeException {
return locationRepo.findAll();
}
}
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.util.ArrayList;
import java.util.Arrays;
......@@ -39,19 +39,23 @@ import com.nisum.mytime.model.ProjectTeamMate;
import com.nisum.mytime.repository.AccountRepo;
import com.nisum.mytime.repository.DomainRepo;
import com.nisum.mytime.repository.EmpShiftDetailsRepo;
import com.nisum.mytime.repository.EmployeeRolesRepo;
import com.nisum.mytime.repository.EmployeeRepo;
import com.nisum.mytime.repository.ProjectRepo;
import com.nisum.mytime.repository.ProjectTeamMatesRepo;
import com.nisum.mytime.repository.TeamMatesBillingRepo;
import com.nisum.mytime.service.IDomainService;
import com.nisum.mytime.service.IProjectService;
import com.nisum.mytime.service.IRoleInfoService;
import com.nisum.mytime.service.IRoleMappingService;
import com.nisum.mytime.utils.MyTeamResultDTO;
import com.nisum.mytime.utils.MyTimeUtils;
import com.nisum.mytime.utils.PdfReportGenerator;
@Service("projectService")
public class ProjectServiceImpl implements ProjectService {
public class ProjectService implements IProjectService {
@Autowired
private EmployeeRolesRepo employeeRolesRepo;
private EmployeeRepo employeeRolesRepo;
@Autowired
private ProjectRepo projectRepo;
......@@ -78,10 +82,10 @@ public class ProjectServiceImpl implements ProjectService {
private DomainController domainController;
@Autowired
private RoleInfoService roleInfoService;
private IRoleInfoService roleInfoService;
@Autowired
private RoleMappingService roleMappingService;
private IRoleMappingService roleMappingService;
@Autowired
private AccountRepo accountRepo;
......@@ -92,6 +96,48 @@ public class ProjectServiceImpl implements ProjectService {
@Autowired
private IDomainService domainService;
public ProjectTeamMate addNewBeanchAllocation(Employee employee,String loginEmpId)
{
ProjectTeamMate teamatePersisted=null;
ProjectTeamMate newBenchAllocation = new ProjectTeamMate();
newBenchAllocation.setAccount(MyTimeUtils.BENCH_ACCOUNT);
newBenchAllocation.setBillableStatus(MyTimeUtils.BENCH_BILLABILITY_STATUS);
newBenchAllocation.setDesignation(employee.getDesignation());
newBenchAllocation.setEmailId(employee.getEmailId());
newBenchAllocation.setEmployeeId(employee.getEmployeeId());
newBenchAllocation.setMobileNumber(employee.getMobileNumber());
newBenchAllocation.setEmployeeName(employee.getEmployeeName());
newBenchAllocation.setProjectId(MyTimeUtils.BENCH_PROJECT_ID);
newBenchAllocation.setStartDate(employee.getDateOfJoining() != null ? employee.getDateOfJoining() : new Date());
Project p = projectRepo.findByProjectId(MyTimeUtils.BENCH_PROJECT_ID);
newBenchAllocation.setProjectName(p.getProjectName());
newBenchAllocation.setAccountId(p.getAccountId());
newBenchAllocation.setDomainId(p.getDomainId());
newBenchAllocation.setShift(employee.getShift());
newBenchAllocation.setRole(employee.getRole());
if ( null != employee.getEmpStatus() && employee.getEmpStatus().trim().equalsIgnoreCase(MyTimeUtils.IN_ACTIVE_SPACE)) {
newBenchAllocation.setEndDate(employee.getEndDate());
newBenchAllocation.setActive(false);
} else {
employee.setEmpStatus(MyTimeUtils.ACTIVE);
newBenchAllocation.setEndDate(p.getProjectEndDate());
newBenchAllocation.setActive(true);
}
try {
teamatePersisted= addProjectTeamMate(newBenchAllocation, loginEmpId);
} catch (MyTimeException e) {
e.printStackTrace();
}
return teamatePersisted;
}
@Override
public List<EmpLoginData> employeeLoginsBasedOnDate(long id,
String fromDate, String toDate) throws MyTimeException {
......
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.RoleInfo;
import com.nisum.mytime.model.Role;
import com.nisum.mytime.repository.RoleInfoRepo;
import com.nisum.mytime.service.IRoleInfoService;
@Service
public class RoleInfoServiceImpl implements RoleInfoService {
public class RoleInfoService implements IRoleInfoService {
@Autowired
RoleInfoRepo roleInfoRepo;
@Override
public RoleInfo addRole(RoleInfo roleInfo) throws MyTimeException {
public Role addRole(Role roleInfo) throws MyTimeException {
return roleInfoRepo.save(roleInfo);
}
......
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.util.HashSet;
import java.util.LinkedHashMap;
......@@ -19,10 +19,11 @@ import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.RoleMappingInfo;
import com.nisum.mytime.repository.RoleInfoRepo;
import com.nisum.mytime.repository.RoleMappingInfoRepo;
import com.nisum.mytime.service.IRoleMappingService;
import com.nisum.mytime.utils.MyTimeUtils;
@Service
public class RoleMappingServiceImpl implements RoleMappingService {
public class RoleMappingService implements IRoleMappingService {
@Autowired
private RoleMappingInfoRepo roleMappingInfoRepo;
......@@ -69,21 +70,20 @@ public class RoleMappingServiceImpl implements RoleMappingService {
@Override
public String getEmployeeRole(String employeeId) {
Map<Integer, String> roleInfoMap = new LinkedHashMap<Integer, String>();
String roleName = null;
List<RoleMappingInfo> listOfEmployeeRoles = roleMappingInfoRepo.findByEmployeeId(employeeId);
List<RoleMappingInfo> listOfEmployeeRoles = roleMappingInfoRepo.findByEmployeeId(employeeId).stream()
.filter(e -> ("N".equalsIgnoreCase(e.getIsActive()))).collect(Collectors.toList());
if (listOfEmployeeRoles != null && listOfEmployeeRoles.size() > 0) {
for (RoleMappingInfo employee : listOfEmployeeRoles) {
roleInfoMap.put((roleInfoRepo.findByRoleId(employee.getRoleId())).getPriority(), employee.getRoleId());
}
roleInfoMap = roleInfoMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors
.toMap(Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new));
String roleName = null;
roleInfoMap = roleInfoMap.entrySet().stream().sorted(Map.Entry.comparingByKey()).collect(Collectors.toMap(
Map.Entry::getKey, Map.Entry::getValue, (oldValue, newValue) -> oldValue, LinkedHashMap::new));
if (!roleInfoMap.isEmpty()) {
Map.Entry<Integer, String> entry = roleInfoMap.entrySet().iterator().next();
roleName = roleInfoRepo.findByRoleId(entry.getValue()).getRoleName();
} else {
roleName = null;
}
}
return roleName;
}
......@@ -92,7 +92,8 @@ public class RoleMappingServiceImpl implements RoleMappingService {
@Override
public Set<String> empRolesMapInfoByEmpId(String employeeId) {
Set<String> roleSet = new HashSet<String>();
List<RoleMappingInfo> listOfEmployeeRoles = roleMappingInfoRepo.findByEmployeeId(employeeId);
List<RoleMappingInfo> listOfEmployeeRoles = roleMappingInfoRepo.findByEmployeeId(employeeId).stream().filter(e->(
"N".equalsIgnoreCase(e.getIsActive()))).collect(Collectors.toList());
if(null != listOfEmployeeRoles && !listOfEmployeeRoles.isEmpty() && MyTimeUtils.INT_ZERO < listOfEmployeeRoles.size()) {
for(RoleMappingInfo obj : listOfEmployeeRoles) {
......
package com.nisum.mytime.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Shift;
import com.nisum.mytime.repository.ShiftRepo;
import com.nisum.mytime.service.IShiftService;
@Service
public class ShiftService implements IShiftService{
@Autowired
private ShiftRepo shiftRepo;
// @Override
public List<Shift> getAllShifts() throws MyTimeException {
return shiftRepo.findAll();
}
}
package com.nisum.mytime.service.impl;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.Skill;
import com.nisum.mytime.repository.SkillRepo;
import com.nisum.mytime.service.ISkillService;
@Service
public class SkillService implements ISkillService {
@Autowired
private SkillRepo technologyRepo;
@Override
public List<Skill> getTechnologies() throws MyTimeException {
return technologyRepo.findAll();
}
}
/**
*
*/
package com.nisum.mytime.service;
package com.nisum.mytime.service.impl;
import java.util.List;
......@@ -11,17 +11,19 @@ import org.springframework.stereotype.Service;
import com.nisum.mytime.model.EmployeeVisa;
import com.nisum.mytime.model.TravelRequest;
import com.nisum.mytime.model.Visa;
import com.nisum.mytime.repository.EmployeeRolesRepo;
import com.nisum.mytime.repository.EmployeeRepo;
import com.nisum.mytime.repository.EmployeeVisaRepo;
import com.nisum.mytime.repository.TravelRepo;
import com.nisum.mytime.repository.VisaRepo;
import com.nisum.mytime.service.IEmployeeService;
import com.nisum.mytime.service.IVisaService;
/**
* @author nisum
*
*/
@Service
public class VisaServiceImpl implements VisaService {
public class VisaService implements IVisaService {
@Autowired
private VisaRepo visaRepo;
......@@ -32,10 +34,10 @@ public class VisaServiceImpl implements VisaService {
private EmployeeVisaRepo employeeVisaRepo;
@Autowired
private UserService userService;
private IEmployeeService userService;
@Autowired
private EmployeeRolesRepo employeeRolesRepo;
private EmployeeRepo employeeRolesRepo;
@Override
......
......@@ -25,8 +25,8 @@ import com.itextpdf.text.pdf.PdfPTable;
import com.itextpdf.text.pdf.PdfWriter;
import com.nisum.mytime.exception.handler.MyTimeException;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.service.AttendanceService;
import com.nisum.mytime.service.EmployeeDataService;
import com.nisum.mytime.service.IAttendanceService;
import com.nisum.mytime.service.impl.EmployeeDataService;
@Component
public class PdfReportGenerator {
......@@ -38,7 +38,7 @@ public class PdfReportGenerator {
private EmployeeDataService employeeDataBaseService;
@Autowired
private AttendanceService attendanceService;
private IAttendanceService attendanceService;
public List generateEmployeeReport(long employeeId, String startDate, String endDate) throws MyTimeException {
String fileName = employeeId + "_" + startDate + "_" + endDate + ".pdf";
......
......@@ -48,7 +48,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
$scope.getAccountDetails = function(){
$http({
method : "GET",
url : appConfig.appUri + "account/accounts"
url : appConfig.appUri + "accounts"
}).then(function mySuccess(response) {
if(response.data.length > 10){
$scope.gridOptions.enablePaginationControls = true;
......@@ -112,7 +112,7 @@ myApp.controller("assignAccountsController",function($scope, myFactory, $mdDialo
function deleteAccountRole(accountId){
var req = {
method : 'DELETE',
url : appConfig.appUri+ "account/accounts?accountId="+accountId
url : appConfig.appUri+ "accounts?accountId="+accountId
}
$http(req).then(function mySuccess(response) {
$scope.result = "Success";
......
......@@ -28,7 +28,7 @@ import com.fasterxml.jackson.databind.ObjectMapper;
import com.nisum.mytime.controller.AccountController;
import com.nisum.mytime.model.Account;
import com.nisum.mytime.service.IAccountService;
import com.nisum.mytime.service.AccountService;
import com.nisum.mytime.service.impl.AccountService;
public class AccountControllerTest {
......
......@@ -20,16 +20,16 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import com.nisum.mytime.controller.AttendanceController;
import com.nisum.mytime.model.AttendenceData;
import com.nisum.mytime.model.EmpLoginData;
import com.nisum.mytime.service.AttendanceService;
import com.nisum.mytime.service.UserService;
import com.nisum.mytime.service.IAttendanceService;
import com.nisum.mytime.service.IEmployeeService;
public class AttendanceControllerTest {
@Mock
UserService userService;
IEmployeeService userService;
@Mock
AttendanceService attendanceService;
IAttendanceService attendanceService;
@InjectMocks
AttendanceController attendanceController;
......
......@@ -17,12 +17,12 @@ import org.springframework.test.web.servlet.setup.MockMvcBuilders;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.nisum.mytime.controller.EmailController;
import com.nisum.mytime.model.EmailDomain;
import com.nisum.mytime.service.MailService;
import com.nisum.mytime.service.IMailService;
public class EmailControllerTest {
@Mock
MailService mailService;
IMailService mailService;
@InjectMocks
EmailController emailController;
......
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