package com.hxzk.controller;
|
|
import com.github.pagehelper.PageInfo;
|
import com.hxzk.pojo.TbFence;
|
import com.hxzk.pojo.TbNewtask;
|
import com.hxzk.pojo.TbTag;
|
import com.hxzk.service.FenceService;
|
import com.hxzk.service.NewTaskService;
|
import com.hxzk.util.result;
|
import com.hxzk.util.resultutil;
|
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.PostMapping;
|
import org.springframework.web.bind.annotation.RequestMapping;
|
import org.springframework.web.bind.annotation.RestController;
|
|
import javax.servlet.http.HttpServletResponse;
|
import java.io.IOException;
|
import java.util.List;
|
|
@RestController
|
@RequestMapping("/")
|
public class NewTaskController {
|
@Autowired
|
NewTaskService newTaskService;
|
@Autowired
|
FenceService fenceService;
|
|
@GetMapping("findNewTask")
|
result<List<TbTag>> findTag(Integer page, Integer limit){
|
PageInfo<TbTag> cz= newTaskService.findAll(page, limit);
|
return resultutil.returnSuccess(cz.getTotal(), cz.getList());
|
}
|
|
@PostMapping("addXunJianTask")
|
public void addXunJianTask(TbNewtask tbNewtask, HttpServletResponse response) throws IOException {
|
newTaskService.addXunJianTask(tbNewtask);
|
response.sendRedirect("/hxzkuwb/HouTai/XunJian/XunJianTask.jsp");
|
}
|
|
@PostMapping("updateXunJianTask")
|
public void updateXunJianTask(TbNewtask tbNewtask, HttpServletResponse response) throws IOException {
|
newTaskService.updateXunJianTask(tbNewtask);
|
response.sendRedirect("/hxzkuwb/HouTai/XunJian/XunJianTask.jsp");
|
}
|
|
@PostMapping("XunJianFindFence")
|
public List<TbFence> XunJianFindFence(){
|
return fenceService.XunJianFindFence();
|
}
|
@PostMapping("XunJianDelete")
|
public Integer XunJianDelete(String id){
|
return newTaskService.XunJianDelete(id);
|
}
|
|
@PostMapping("XunJianFindId")
|
public TbNewtask XunJianFindId(String id){
|
return newTaskService.XunJianFindId(id);
|
}
|
}
|