@GetMapping("/api/getAllPayments") public ResBody getAllPayments(@RequestParamint page, @RequestParamint limit){ ResBody resBody = new ResBody(); int count = service.getCount(); List<Payment> list= service.getAllPayments(page, limit); resBody.setCount(count); resBody.setData(list); resBody.setCode(0); return resBody; }
@PostMapping("/api/addPayment") public ResBody addBuilding(@RequestBody Payment payment){ ResBody resBody = new ResBody(); int i = service.addPayment(payment); if (i == 1){ resBody.setCode(200); resBody.setMsg("添加成功"); }else{ resBody.setCode(500); resBody.setMsg("添加失败"); } return resBody; }
@PostMapping("/api/updatePayment") public ResBody updatePayment(@RequestBody Payment payment){ ResBody resBody = new ResBody(); int i = service.updatePayment(payment); if (i == 1){
@GetMapping("/api/delPayment") public ResBody delPayment(@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; }
@GetMapping("/api/findPayment") public ResBody findPayment(@RequestParamint page, @RequestParamint limit, @RequestParam String name){ ResBody resBody = new ResBody(); int count = service.getCount(name); List<Payment> list= service.findPayment(page, limit,name); resBody.setCount(count); resBody.setData(list); resBody.setCode(0); return resBody; }
@GetMapping("/ajax/getAllPayments") public ResBody getAllPayments(){ ResBody resBody = new ResBody(); List<Payment> list= service.getAllPayments(); resBody.setData(list); resBody.setCode(0); return resBody; } } package com.example.demo.controller;
gonggao.setUpdateBy(admin.getId()); int i = service.updateGonggao(gonggao); if (i == 1){ resBody.setCode(200); resBody.setMsg("修改成功"); }else{ resBody.setCode(500); resBody.setMsg("修改失败"); } return resBody; }
@GetMapping("/api/delGonggao") public ResBody delBuilding(@RequestParamint id){ ResBody resBody = new ResBody(); int i = service.delGonggao(id); if (i == 1){ resBody.setCode(200); resBody.setMsg("删除成功"); }else{ resBody.setCode(500); resBody.setMsg("删除失败"); } return resBody; }
@GetMapping("/tousu") public String tousu(){ return"page/template/tousu"; }
@GetMapping("/payment") public String payment(){ return"page/template/payment"; }
@GetMapping("/car") public String car(){ return"page/template/car"; }
@GetMapping("/user") public String user(){ return"page/template/user"; }
@GetMapping("/user/login") public String userlogin(){ return"page/system/login"; }
@GetMapping("/user/index") public String userindex(){ return"page/system/index"; }
@GetMapping("/user/console") public String userconsole(Model model,HttpSession session){ User user = (User) session.getAttribute("user"); Gonggao gonggao = gonggaoService.getGonggao(); int repairCount = repairService.getCount(); int tousuCount = tousuService.getCount(); int paymentCount = user_paymentService.getCount(); int userRepair = repairService.getCountByUserId(user.getId()); int userTousu = tousuService.getCountByUserId(user.getId());