本文整理汇总了Java中slender.services.core.tasks.TasksService类的典型用法代码示例。如果您正苦于以下问题:Java TasksService类的具体用法?Java TasksService怎么用?Java TasksService使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
TasksService类属于slender.services.core.tasks包,在下文中一共展示了TasksService类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getTask
import slender.services.core.tasks.TasksService; //导入依赖的package包/类
@POST
@Path("getTask")
@Override
public Response getTask(@FormParam("id") Integer id) {
TasksService service = new TasksServiceImpl();
TasksProgressService progressService = new TasksProgressServiceImpl();
Task task = service.getTask(id);
int progress = progressService.getProgress(id);
return Response.ok(new TaskResponse(task, progress)).build();
}
示例2: addTask
import slender.services.core.tasks.TasksService; //导入依赖的package包/类
@POST
@Path("addTask")
@Override
public Response addTask(
@FormParam("projectId") int projectId,
@FormParam("taskName") String taskName,
@FormParam("taskDesc") String taskDesc,
@FormParam("plannedStartDate") String plannedStartDate,
@FormParam("plannedEndDate") String plannedEndDate,
@FormParam("timeAllocation") int timeAllocation,
@FormParam("priorityId") int priorityId) {
TaskFactory factory = new TaskFactory();
Task task = factory.getTask(projectId, taskName, taskDesc, DateParam.valueOf(plannedStartDate).getDate(), DateParam.valueOf(plannedEndDate).getDate(), null, null, timeAllocation, priorityId);
try {
TasksService service = new TasksServiceImpl();
service.addTask(task);
return Response.ok(new SuccessResponse(true, "Success")).build();
}
catch(Exception e) {
e.printStackTrace();
}
return Response.ok(new SuccessResponse(false, "Failed")).build();
}
示例3: testGetTask
import slender.services.core.tasks.TasksService; //导入依赖的package包/类
@Test
public void testGetTask() {
TasksService service = new TasksServiceImpl();
Task task = service.getTask(TestVal.taskID);
Assert.assertEquals(task.getTaskName(), TestVal.fString, "getTask");
}