@GetMapping("/api/jiaofei") public ResBody jiaofei(@RequestParamint id){ ResBody resBody = new ResBody(); int i = service.jiaofei(id); if (i == 1){ resBody.setCode(200); resBody.setMsg("成功"); }else { resBody.setCode(500); resBody.setMsg("失败"); } return resBody; }
@GetMapping("/api/remind") public ResBody remind(@RequestParamint id){ ResBody resBody = new ResBody(); int i = service.remind(id); if (i == 1){ resBody.setCode(200); resBody.setMsg("催缴成功"); }else { resBody.setCode(500); resBody.setMsg("催缴失败"); } return resBody; }
@GetMapping("/api/delUserPayment") public ResBody delUserPayment(@RequestParamint id){ ResBody resBody = new ResBody(); int i = service.delPayment(id); if (i == 1){ resBody.setCode(200); resBody.setMsg("删除成功"); }else{ resBody.setCode(500); resBody.setMsg("删除失败"); } return resBody; } }
public ResBody getUsers(@RequestParamint page, @RequestParamint limit){ ResBody resBody = new ResBody(); int count = service.getCount(); List<User> list= service.getUsers(page, limit); resBody.setCount(count); resBody.setData(list); resBody.setCode(0); return resBody; }
@PostMapping("/api/addUser") public ResBody addUser(@RequestBody User user){ ResBody resBody = new ResBody(); int i = service.addUser(user); if (i == 1){ resBody.setCode(200); resBody.setMsg("添加成功"); }else{ resBody.setCode(500); resBody.setMsg("添加失败"); } return resBody; }
@PostMapping("/api/updateUser") public ResBody updateUser(@RequestBody User user, HttpSession session, HttpServletResponse response)throws IOException { ResBody resBody = new ResBody();
int i = service.updateUser(user); if (i == 1){ session.setAttribute("user",user); resBody.setCode(200); resBody.setMsg("修改成功"); }else{ resBody.setCode(500); resBody.setMsg("修改失败"); } return resBody; }
@GetMapping("/api/stopUser") public ResBody delBuilding(@RequestParamint id, @RequestParamint status){ ResBody resBody = new ResBody(); int i = service.stopUser(status, id); if (i == 1){ if (status == 1) { resBody.setMsg("启用成功"); }else { resBody.setMsg("停用成功"); } resBody.setCode(200);
@GetMapping("/api/getAllDanyuans") public ResBody getAllDanyuans(@RequestParamint page, @RequestParamint limit){ ResBody resBody = new ResBody(); int count = service.getCount(); List<Danyuan> list= service.getAllDanyuans(page, limit); resBody.setCount(count); resBody.setData(list); resBody.setCode(0); return resBody; }
@PostMapping("/api/addDanyuan") public ResBody addDanyuan(@RequestBody Danyuan danyuan){ ResBody resBody = new ResBody(); int i = service.addDanyuan(danyuan); if (i == 1){ resBody.setCode(200); resBody.setMsg("添加成功"); }else{ resBody.setCode(500); resBody.setMsg("添加失败"); } return resBody; }
@PostMapping("/api/updateDanyuan") public ResBody updateDanyuan(@RequestBody Danyuan danyuan){ ResBody resBody = new ResBody(); int i = service.updateDanyuan(danyuan); if (i == 1){ resBody.setCode(200); resBody.setMsg("修改成功");