小程序开发说明
开发语言:Java
框架:ssm
JDK版本:JDK1.8
服务器:tomcat7
数据库:mysql 5.7(一定要5.7版本)
数据库工具:Navicat11
开发软件:eclipse/myeclipse/idea
Maven包:Maven3.3.9
浏览器:谷歌浏览器
小程序框架:uniapp
小程序开发软件:HBuilder X
小程序运行软件:微信开发者
代码:
/**
* 自习室预约
* 后端接口
* @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("查询自习室预约成功").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();
}
文章来源:https://www.toymoban.com/news/detail-497945.html
文章来源地址https://www.toymoban.com/news/detail-497945.html
到了这里,关于基于微信小程序的自习室预约系统设计与实现-计算机毕业设计源码+LW文档的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!