首页>代码>SSM+bootstrap+jquery+maven编写的进存销后台管理系统>/HBtest/src/main/java/org/shop/controller/RuKuController.java
package org.shop.controller;
import java.util.List;
import org.shop.pojo.RuKu;
import org.shop.service.RuKuService;
import org.shop.utils.Msg;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
@Controller
@RequestMapping("/ruku")
public class RuKuController {
@Autowired
RuKuService rukuService;
@RequestMapping("/main.do")
public String main() {
return "ruku/main";
}
@ResponseBody
@RequestMapping("/insert.do")
public Msg insert(RuKu ruku) {
int deptId = rukuService.selectByIdKey(ruku);
if(deptId!=0) {
return Msg.idCFfile();
}
int dept = rukuService.insert(ruku);
if(dept==1) {
return Msg.success();
}else {
return Msg.file();
}
}
@ResponseBody
@RequestMapping("/select.do")
public Msg select(int pn) {
PageHelper.startPage(pn, 5);
List<RuKu> list = rukuService.select();
PageInfo pageInfo = new PageInfo(list,5);
return Msg.success().add("pageInfo",pageInfo);
}
@ResponseBody
@RequestMapping("/selectByKey.do")
public Msg selectByKey(RuKu ruku) {
System.out.println("--------------------->:"+ruku);
PageHelper.startPage(1, 5);
List<RuKu> list = rukuService.selectByKey(ruku);
PageInfo pageInfo = new PageInfo(list,5);
return Msg.success().add("pageInfo", pageInfo);
}
}
最近下载更多
奋斗的小蚂蚁 LV14
前天
飞翔的面包片 LV13
2023年2月15日
184445428 LV6
2022年11月29日
微信网友_6164511365238784 LV7
2022年10月10日
wuying8208 LV15
2022年6月7日
* LV4
2022年5月17日
wanglinddad LV55
2022年3月9日
暖茶1234 LV8
2021年9月14日
2105175744 LV1
2021年7月16日
862960632 LV14
2021年6月16日
最近浏览更多
sunlea LV20
2024年3月21日
black8angel LV4
2023年12月22日
shuangfu LV25
2023年12月2日
uni-code_0123 LV1
2023年11月27日
阳光男孩阿葵
2023年7月14日
暂无贡献等级
c469893928 LV2
2023年6月10日
刘春涛 LV2
2023年6月2日
哇塞塞哈哈哈 LV8
2023年5月5日
cuberbread LV6
2023年3月23日
飞翔的面包片 LV13
2023年2月15日

