当前位置: 首页>>代码示例>>Java>>正文


Java UsersServiceImpl类代码示例

本文整理汇总了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();
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:22,代码来源:UsersRestImpl.java

示例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();
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:24,代码来源:UsersRestImpl.java

示例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) {};
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:13,代码来源:CommentResponse.java

示例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();
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:29,代码来源:ProjectsRestImpl.java

示例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();
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:10,代码来源:UsersRestImpl.java

示例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();
 }
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:13,代码来源:UsersRestImpl.java

示例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();
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:13,代码来源:UsersRestImpl.java

示例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);
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:14,代码来源:PersistServicesTest.java

示例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");
}
 
开发者ID:Slenderware,项目名称:SlenderRestAPI-Maven,代码行数:8,代码来源:UsersServiceTest.java


注:本文中的slender.services.core.users.impl.UsersServiceImpl类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。