基于微信小程序的自习室预约系统设计与实现-计算机毕业设计源码+LW文档

                           小程序开发说明

开发语言: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();
    }

 

 

 

 

  • 2
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值