基于微信小程序的自習(xí)室預(yù)約系統(tǒng)設(shè)計與實現(xiàn)-計算機畢業(yè)設(shè)計源碼+LW文檔
? ? ? ? ? ? ? ? ? ? ? ? ? ?小程序開發(fā)說明
開發(fā)語言:Java
框架:ssm
JDK版本:JDK1.8
服務(wù)器:tomcat7
數(shù)據(jù)庫:mysql 5.7(一定要5.7版本)
數(shù)據(jù)庫工具:Navicat11
開發(fā)軟件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
瀏覽器:谷歌瀏覽器
小程序框架:uniapp
小程序開發(fā)軟件:HBuilder X
小程序運行軟件:微信開發(fā)者
代碼:
/**
?* 自習(xí)室預(yù)約
?* 后端接口
?* @author?
?* @email?
?* @date 2022-03-04 15:23:14
?*/
@RestController
@RequestMapping("/zixishiyuyue")
public class ZixishiyuyueController {
? ? @Autowired
? ? private ZixishiyuyueService zixishiyuyueService;
? ??
? ? /**
? ? ?* 后端列表
? ? ?*/
? ? @RequestMapping("/page")
? ? public R page(@RequestParam Map<String, Object> params,ZixishiyuyueEntity zixishiyuyue,?
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
zixishiyuyue.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
? ? ? ? EntityWrapper<ZixishiyuyueEntity> ew = new EntityWrapper<ZixishiyuyueEntity>();
PageUtils page = zixishiyuyueService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zixishiyuyue), params), params));
? ? ? ? return R.ok().put("data", page);
? ? }
? ??
? ? /**
? ? ?* 前端列表
? ? ?*/
? ? @RequestMapping("/list")
? ? public R list(@RequestParam Map<String, Object> params,ZixishiyuyueEntity zixishiyuyue,?
HttpServletRequest request){
String tableName = request.getSession().getAttribute("tableName").toString();
if(tableName.equals("yonghu")) {
zixishiyuyue.setYonghuzhanghao((String)request.getSession().getAttribute("username"));
}
? ? ? ? EntityWrapper<ZixishiyuyueEntity> ew = new EntityWrapper<ZixishiyuyueEntity>();
PageUtils page = zixishiyuyueService.queryPage(params, MPUtil.sort(MPUtil.between(MPUtil.likeOrEq(ew, zixishiyuyue), params), params));
? ? ? ? return R.ok().put("data", page);
? ? }
/**
? ? ?* 列表
? ? ?*/
? ? @RequestMapping("/lists")
? ? public R list( ZixishiyuyueEntity zixishiyuyue){
? ? ? ? EntityWrapper<ZixishiyuyueEntity> ew = new EntityWrapper<ZixishiyuyueEntity>();
? ? ? ew.allEq(MPUtil.allEQMapPre( zixishiyuyue, "zixishiyuyue"));?
? ? ? ? return R.ok().put("data", zixishiyuyueService.selectListView(ew));
? ? }
/**
? ? ?* 查詢
? ? ?*/
? ? @RequestMapping("/query")
? ? public R query(ZixishiyuyueEntity zixishiyuyue){
? ? ? ? EntityWrapper< ZixishiyuyueEntity> ew = new EntityWrapper< ZixishiyuyueEntity>();
? ew.allEq(MPUtil.allEQMapPre( zixishiyuyue, "zixishiyuyue"));?
ZixishiyuyueView zixishiyuyueView =? zixishiyuyueService.selectView(ew);
return R.ok("查詢自習(xí)室預(yù)約成功").put("data", zixishiyuyueView);
? ? }
? ? /**
? ? ?* 后端詳情
? ? ?*/
? ? @RequestMapping("/info/{id}")
? ? public R info(@PathVariable("id") Long id){
? ? ? ? ZixishiyuyueEntity zixishiyuyue = zixishiyuyueService.selectById(id);
? ? ? ? return R.ok().put("data", zixishiyuyue);
? ? }
? ? /**
? ? ?* 前端詳情
? ? ?*/
? ? @RequestMapping("/detail/{id}")
? ? public R detail(@PathVariable("id") Long id){
? ? ? ? ZixishiyuyueEntity zixishiyuyue = zixishiyuyueService.selectById(id);
? ? ? ? return R.ok().put("data", zixishiyuyue);
? ? }
? ??
? ? /**
? ? ?* 后端保存
? ? ?*/
? ? @RequestMapping("/save")
? ? public R save(@RequestBody ZixishiyuyueEntity zixishiyuyue, HttpServletRequest request){
? ? zixishiyuyue.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
? ? //ValidatorUtils.validateEntity(zixishiyuyue);
? ? ? ? zixishiyuyueService.insert(zixishiyuyue);
? ? ? ? return R.ok();
? ? }
? ??
? ? /**
? ? ?* 前端保存
? ? ?*/
? ? @RequestMapping("/add")
? ? public R add(@RequestBody ZixishiyuyueEntity zixishiyuyue, HttpServletRequest request){
? ? zixishiyuyue.setId(new Date().getTime()+new Double(Math.floor(Math.random()*1000)).longValue());
? ? //ValidatorUtils.validateEntity(zixishiyuyue);
? ? zixishiyuyue.setUserid((Long)request.getSession().getAttribute("userId"));
? ? ? ? zixishiyuyueService.insert(zixishiyuyue);
? ? ? ? return R.ok();
? ? }



