首页>代码>基于SSM开发校园在线点餐系统,包括前后台>/基于SSM-校园在线点餐系统/源码/school-order/src/main/java/com/cxs/biyesheji/controller/CustomerController.java
package com.cxs.biyesheji.controller; import com.cxs.biyesheji.pojo.Customer; import com.cxs.biyesheji.service.CustomerService; import com.cxs.biyesheji.util.Page; import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageInfo; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; import org.springframework.ui.Model; import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.ResponseBody; import java.util.List; /** * 用户模块controller */ @Controller @RequestMapping("/customer") public class CustomerController { @Autowired private CustomerService customerService; @RequestMapping("/list") public String list(Model model, Page page){ PageHelper.offsetPage(page.getStart(),page.getCount());//分页查询 List<Customer> list= customerService.list(); int total = (int) new PageInfo<>(list).getTotal();//总条数 page.setTotal(total); model.addAttribute("list",list); model.addAttribute("totals",total); return "cstpage/cst-list"; } /** * 设置会员 * @param id * @return */ @RequestMapping("/shezhihuiyuan") @ResponseBody public String shezhihuiyuan(int id){ customerService.shezhihuiyuan(id); return "success"; } @RequestMapping("/del") public String del(int id){ customerService.del(id); return "redirect:list"; } }
最近下载更多
qtingchh LV3
5月3日
微信网友_6927932988952576 LV12
3月30日
SZEPEZS LV8
3月15日
廖业贵 LV18
2月24日
admin_z LV22
2月5日
打烊1234 LV2
1月26日
全栈小陈 LV4
1月21日
一勺枣糕 LV3
1月11日
全栈小白 LV34
2023年12月21日
2775645521 LV5
2023年10月12日
最近浏览更多
qtingchh LV3
5月3日
微信网友_6507988172591104 LV1
5月1日
kenhomeliu LV29
4月30日
2821484071 LV1
4月26日
玖零定制问题修复 LV34
4月4日
微信网友_6927932988952576 LV12
3月30日
wanglinddad LV54
3月28日
xiaozhi丶 LV14
3月24日
vluobo LV1
3月19日
SZEPEZS LV8
3月15日