| | |
| | | import com.lf.server.annotation.SysLog; |
| | | import com.lf.server.controller.all.BaseController; |
| | | import com.lf.server.entity.all.ResponseMsg; |
| | | import com.lf.server.entity.ctrl.PubEntity; |
| | | import com.lf.server.entity.data.TaskEntity; |
| | | import com.lf.server.entity.sys.UserEntity; |
| | | import com.lf.server.helper.WebHelper; |
| | | import com.lf.server.service.data.PublishService; |
| | | import com.lf.server.service.data.TaskService; |
| | | import com.lf.server.service.sys.TokenService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | |
| | | @RestController |
| | | @RequestMapping("/task") |
| | | public class TaskController extends BaseController { |
| | | @Autowired |
| | | @Resource |
| | | TaskService taskService; |
| | | |
| | | @Autowired |
| | | @Resource |
| | | TokenService tokenService; |
| | | |
| | | @Resource |
| | | PublishService publishService; |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "查询记录数") |
| | |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "删除任务") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "id", value = "ID", dataType = "Integer", paramType = "query", example = "1") |
| | | }) |
| | | @GetMapping(value = "/deleteTask") |
| | | public ResponseMsg<Object> deleteTask(int id, HttpServletRequest req) { |
| | | try { |
| | | TaskEntity task = taskService.selectById(id); |
| | | if (null == task) { |
| | | return fail("任务不存在", -1); |
| | | } |
| | | |
| | | List<Integer> ids = new ArrayList<>(); |
| | | ids.add(id); |
| | | |
| | | PubEntity entity = new PubEntity(); |
| | | entity.setIds(ids); |
| | | entity.setDircode("00"); |
| | | entity.setToken(WebHelper.getToken(req)); |
| | | |
| | | long rows = publishService.postForPub(entity, "/Convert/DeleteTask"); |
| | | |
| | | return success(rows); |
| | | } catch (Exception ex) { |
| | | return fail(ex, -1); |
| | | } |
| | | } |
| | | |
| | | @SysLog() |
| | | @ApiOperation(value = "更新一条") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(name = "entity", value = "实体类", dataType = "TaskEntity", paramType = "body") |