本文整理汇总了Java中slender.services.core.users.impl.UsersServiceImpl类的典型用法代码示例。如果您正苦于以下问题:Java UsersServiceImpl类的具体用法?Java UsersServiceImpl怎么用?Java UsersServiceImpl使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
UsersServiceImpl类属于slender.services.core.users.impl包,在下文中一共展示了UsersServiceImpl类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: addUser
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@POST
@Path("addUser")
@Override
public Response addUser(
@FormParam("firstName") String firstName,
@FormParam("lastName") String lastName,
@FormParam("username") String username,
@FormParam("email") String email,
@FormParam("password") String password,
@FormParam("roleId") Integer roleId,
@FormParam("companyId") Integer companyId) {
UsersFactory fact = new UsersFactory();
Users user = fact.getUsers(firstName, lastName, username, email, password, roleId, companyId);
user.setLastSeen(new Date());
UsersService service = new UsersServiceImpl();
Users newUser = service.addUser(user);
return Response.ok(new UserResponse(newUser)).build();
}
示例2: addAdminUser
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@POST
@Path("addAdminUser")
@Override
public Response addAdminUser(
@FormParam("firstName") String firstName,
@FormParam("lastName") String lastName,
@FormParam("username") String username,
@FormParam("email") String email,
@FormParam("password") String password,
@FormParam("roleId") Integer roleId,
@FormParam("companyId") Integer companyId) {
UsersFactory fact = new UsersFactory();
Users user = fact.getUsers(firstName, lastName, username, email, password, roleId, companyId);
user.setLastSeen(new Date());
UsersService service = new UsersServiceImpl();
Users newUser = service.addAdminUser(user);
String sessionId = UserSessions.getNewSessions(newUser.getUsername());
return Response.ok(new SessionResponse(true, "Success", sessionId)).build();
}
示例3: getResponseEntity
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
public static GenericEntity<List<CommentResponse>> getResponseEntity(List<Comment> comments) {
List<CommentResponse> responses = new ArrayList<CommentResponse>();
UsersService service = new UsersServiceImpl();
Users user;
for(Comment c : comments) {
user = service.getUser(c.getUserId());
responses.add(new CommentResponse(c, user.getUsername()));
}
return new GenericEntity<List<CommentResponse>>(responses) {};
}
示例4: addProject
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@POST
@Path("addProject")
@Override
public Response addProject(
@FormParam("projectCreator")Integer creator,
@FormParam("projectManager")Integer manager,
@FormParam("projectName")String name,
@FormParam("projectDescription")String desc,
@FormParam("startDate")String startDate,
@FormParam("endDate")String endDate) {
ProjectFactory factory = new ProjectFactory();
Project project = factory.getProject(creator, manager, name, desc, DateParam.valueOf(startDate).getDate(), DateParam.valueOf(endDate).getDate());
try {
ProjectsService service = new ProjectsServiceImpl();
Project rtrn = service.addProject(project);
UsersService userService = new UsersServiceImpl();
userService.addUserToProject(creator, rtrn.getId());
return Response.ok(new SuccessResponse(true, "Successful")).build();
}
catch(Exception e) {
e.printStackTrace();
}
return Response.ok(new SuccessResponse(false, "Failed")).build();
}
示例5: getUserBySession
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@POST
@Path("getUserBySession")
@Override
public Response getUserBySession(@FormParam("sessionId") String sessionId) {
UsersService service = new UsersServiceImpl();
Users user = service.getUserBySession(sessionId);
return Response.ok(new UserResponse(user)).build();
}
示例6: addUserToProject
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@POST
@Path("assignUserToProject")
@Override
public Response addUserToProject(@FormParam("userId") Integer userId, @FormParam("projectId") Integer projId) {
UsersService service = new UsersServiceImpl();
boolean rtrn = service.addUserToProject(userId, projId);
if(rtrn)
return Response.ok(new SuccessResponse(true, "Successfull")).build();
return Response.ok(new SuccessResponse(false, "User does not exist")).build();
}
示例7: addUserToTask
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@POST
@Path("assignUserToTask")
@Override
public Response addUserToTask(@FormParam("userId") Integer userId, @FormParam("taskId") Integer taskId) {
UsersService service = new UsersServiceImpl();
boolean rtrn = service.addUserToTask(userId, taskId);
if(rtrn)
return Response.ok(new SuccessResponse(true, "Successfull")).build();
return Response.ok(new SuccessResponse(false, "User does not exist")).build();
}
示例8: addAdditional
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@Test(dependsOnMethods = {"addMainEntities"})
public void addAdditional() {
TasksProgressService service = new TasksProgressServiceImpl();
service.addProgress(TestVal.taskID, TestVal.user1ID, 4);
service.addProgress(TestVal.taskID, TestVal.user2ID, 2);
UsersService userService = new UsersServiceImpl();
userService.addUserToProject(TestVal.user1ID, TestVal.projectID);
userService.addUserToProject(TestVal.user2ID, TestVal.projectID);
userService.addUserToTask(TestVal.user1ID, TestVal.taskID);
userService.addUserToTask(TestVal.user2ID, TestVal.taskID);
}
示例9: testUserBySession
import slender.services.core.users.impl.UsersServiceImpl; //导入依赖的package包/类
@Test
public void testUserBySession() {
UsersService service = new UsersServiceImpl();
Users user = service.getUserBySession(session);
Assert.assertEquals(user.getUsername().contains(TestVal.fString), true, "getUserBySession");
}