本文整理匯總了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");
}