基于Nodejs+vue开发实现酒店管理系统

news2025/2/23 23:01:36

作者简介:Java、前端、Pythone开发多年,做过高程,项目经理,架构师

主要内容:Java项目开发、毕业设计开发、面试技术整理、最新技术分享

项目编号:BS-QD-KS-002

一,项目简介

本项目使用纯前端技术开发实现一个酒店管理系统,前端采用VUE开发实现,后台通过NODEJS作为服务器开发实现,主要实现了酒店管理系统中的:房型管理、房间管理、顾客管理、订单管理等,用户可以注册并登陆后进行相应的管理操作。主要说明

  1. 前后端分离技术
  2. 前端使用vuejs,ElementUI,axios前后端通信,图标使用了ElementUI自带的图标还有font-awesome.css的图标库, 阿里的iconfont图标库也不错,这里没用。
  3. 后端使用了nodejs,nodejs采用了Express框架,orm采用的是Sequelize操作数据库(效率极高),restful风格的Api, 跨域是由后端解决的,采用的是nodejs的cors模块(比较方便)。
  4. 数据库采用了mysql5.2(建议大家换成最新的mysql版本)
  5. 使用jsonwebtoken验证用户调用api的权限,增加接口的安全性,防止恶意攻击接口,串改数据。
  6. 主要界面里面的图片主要使用的是网上的图片,免费而且美观。

二,环境介绍

语言环境:nodejs

数据库: mysql5.7

应用服务器:nodejs

开发工具:IDEA或vscode

开发技术:nodejs+vue+elementUI

三,系统展示

用户注册

用户登陆

房间管理

房型管理

订单管理

订单管理

四,核心代码展示

const { Op } = require('sequelize')//nodejs的sequelize模块
const express = require('express')//express框架
const admin = require('../crud/table/admin.js')//引入管理员信息表
const token = require('../comment/token.js')//引入token模块
const adminRouter = express.Router()//express路由

adminRouter.post('/register',(req,res) =>{//管理员注册
    const { adminId, adminName, adminPassword } = req.body;
    admin.findOne({
        where:{
            adminId:adminId
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                msg:'该用户已经注册',
                success:false
            })
            return new Promise(() =>{})
        }else{
            return admin.create({
                adminId, adminName, adminPassword
            })
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'管理员注册成功!',
            admin:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器错误!'
        })
    })

})

adminRouter.get('/login',(req,res) =>{//登录
    const { adminId, adminPassword } = req.query;
    let adminInfo;
    admin.findOne({
        where:{
            adminId
        }
    })
    .then(data =>{
        if(data){
            if(data.get().adminPassword==adminPassword){
                adminInfo = data.get();
                return token.setToken(data.get())
            }else{
                res.status(200).json({
                    success:false,
                    msg:'用户密码错误!'
                });  
                return new Promise(() =>{})
            }
        }else{
           res.status(200).json({
               success:false,
               msg:'该用户还未注册!'
           })
           return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            admin:adminInfo,
            token:data,
            msg:'登录成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器出错!'
        })
    })
})

adminRouter.put('/update',(req,res) =>{//修改管理员信息
    const { adminId, adminName, adminPassword, adminSex, adminAge } = req.body;
    admin.findOne({
        where:{
            adminId,adminPassword
        }
    })
    .then(data =>{
        if(data){
           return admin.update({
                    adminName,adminSex,adminAge
                },{
                    where:{
                        adminId,adminPassword
                    }
                })
        }else{
            res.status(200).json({
                success:false,
                msg:'管理员账号或者密码错误!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return admin.findOne({
            where:{
                adminId,adminPassword
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'管理员信息修改成功!',
            admin:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

adminRouter.delete('/del',(req,res) =>{
    const { adminId } = req.body || req.query;
    admin.destroy({
        where:{
            adminId
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'删除失败!'
        })
    })
})

module.exports = adminRouter;

const { Op } = require('sequelize')//nodejs的sequelize模块
const express = require('express')//express框架
const customer = require('../crud/table/customer.js')//引入用户表

const customerRouter = express.Router()//express路由

customerRouter.post('/add',(req,res) =>{//用户注册
    const { customerIdCard, customerName, customerSex, customerPhoneNumber } = req.body;
    customer.findOne({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:false,
                msg:'该用户已经注册!'
            })
            return new Promise(() =>{})
        }else{
            return customer.create({
                customerIdCard, customerName, customerSex, customerPhoneNumber
            })
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户信息录入成功!',
            customer:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器错误!'
        })
    })
})

// customerRouter.get('/login',(req,res) =>{//用户登录
//     const { customerIdCard, cust}
// })

customerRouter.put('/update',(req,res) =>{//用户基本信息修改
    const { customerIdCard, customerName, customerSex, customerPhoneNumber } = req.body;
    customer.findOne({
        where:{
            customerIdCard:{
                [Op.eq]:customerIdCard
            }
        }
    })
    .then(data =>{
        if(data){
            return customer.update({
                customerName, customerSex, customerPhoneNumber
            },{
               where:{
                    customerIdCard:{
                        [Op.eq]:customerIdCard
                    }
               }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户还未注册!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户信息修改成功!',
            customer:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    }) 
}) 

customerRouter.delete('/del',(req,res) =>{//删除用户
    const { customerIdCard } = req.body;
    customer.destroy({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

customerRouter.put('/updatevip',(req,res) =>{//购买会员
    const { customerIdCard, level } = req.body;
    customer.findOne({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        if(data){
            return customer.update({
                level
            },{
                where:{
                    customerIdCard
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户未注册!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return customer.findOne({
            where:{
                customerIdCard
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'vip更改成功!',
            customer:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })

})


customerRouter.put('/updatemoney',(req,res) =>{//修改用户总消费金额
    const { customerIdCard, money} = req.body;
    customer.findOne({
        where:{
            customerIdCard
        }
    })
    .then(data =>{
        if(data){
            let oldMoney = data.get().totalAmount;
            let newMoney = oldMoney + money;
            return customer.update({
                totalAmount: newMoney
            },{
                where:{
                    customerIdCard
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户为注册!'
            })
        }
    })
    .then(data =>{
        return customer.findOne({
            where:{
                customerIdCard
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'用户消费金额修改成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })

})

customerRouter.get('/getAllCustomer',(req,res) =>{//查询所有顾客
    customer.findAndCountAll()
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'顾客信息查询成功!',
            customerList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    })
})

customerRouter.get('/queryCustomer',(req,res) =>{//模糊查询顾客信息
    const { queryName } = req.query;
    customer.findAndCountAll({
        where:{
            customerName:{
                [Op.like]:'%'+queryName+'%'
            }
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'顾客信息查询成功!',
            customerList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .then(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    })
})

module.exports = customerRouter;
const express = require('express')//express框架
const { Op } = require('sequelize')//nodejs的sequelize模块
const order = require('../crud/table/myorder.js')//引入订单信息表
const customer = require('../crud/table/customer.js')//引入顾客信息表
const room = require('../crud/table/room.js')//引入房间信息表

order.hasOne(customer,{ sourceKey:'customerIdCard', foreignKey:'customerIdCard' })
order.hasOne(room,{ sourceKey:'roomNumber', foreignKey:'roomNumber' })

const orderRouter = express.Router()

orderRouter.post('/add',(req,res) =>{//创建订单
    console.log(req.body)
    const { orderNumber, orderStatus,customerIdCard,roomNumber,
            checkInTime,checkOutTime,totalMoney,remarks
        } = req.body;
    order.findOne({
        where:{
            orderNumber
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:false,
                msg:'该订单已经存在!'
            })
            return new Promise(() =>{})
        }else{
            return customer.findOne({
                where:{
                    customerIdCard
                }
            })
        }
    })
    .then(data =>{
        if(data){
            return room.update({
                    roomStatus:'已入住'
            },{
                where:{
                        roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该用户还未注册!'
            });
            return new Promise(() =>{});
        }
       
    })
    .then(data =>{
        return order.create({
            orderNumber, orderStatus,customerIdCard,roomNumber,
            checkInTime,checkOutTime,totalMoney,remarks
        })
    })
    .then(data =>{
        res.status(200).json({
            success:'true',
            msg:'订单创建成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'内部服务器出错!'
        })
    })
})

orderRouter.delete('/del',(req,res) =>{//删除订单
    const { orderNumber } = req.body;
    order.findOne({
        where:{
            orderNumber
        }
    })
    .then(data =>{
        if(data){
            return order.destroy({
                where:{
                    orderNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该订单不存在!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

orderRouter.put('/update',(req,res) =>{//修改订单状态
    const { orderStatus, orderNumber,totalMoney,roomNumber } = req.body;
    order.findOne({
        where:{
            orderNumber
        }
    })
    .then(data =>{
        if(data){
            return room.update({
                roomStatus:'未入住'
            },{
                where:{
                    roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该订单不存在!'                
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return order.update({
            orderStatus,totalMoney
        },{
            where:{
                orderNumber
            }
        })
       
    })
    .then(data =>{
        return order.findOne({
            where:{
                orderNumber
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'订单修改成功!',
            order:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })

})

orderRouter.get('/getAllOrder',(req,res) =>{//查询所有订单
    const { pageSize, offset } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type','remarks']
            }
        ]
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'所有订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

orderRouter.get('/getAllNotPayOrder',(req,res) =>{//查询所有未支付的订单
    const { pageSize, offset } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            orderStatus:{
                [Op.eq]:'未支付'
            }
        },
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type']
            }
        ]
    })
    .then(data  =>{
        res.status(200).json({
            success:true,
            msg:'未支付订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count,
            pageSize:pageSize,
            offset:offset
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

orderRouter.get('/getAllPayOrder',(req,res) =>{//查询所有已支付的订单
    const { pageSize, offset } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            orderStatus:{
                [Op.eq]:'已支付'
            }
        },
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type']
            }
        ]
    })
    .then(data  =>{
        res.status(200).json({
            success:true,
            msg:'未支付订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count,
            pageSize:pageSize,
            offset:offset
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

orderRouter.get('/getStatusOrder',(req,res) =>{//查询所有该状态的订单
    const { pageSize, offset, orderStatus } = req.query;
    order.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            orderStatus:{
                [Op.eq]:orderStatus
            }
        },
        include:[
            {
                model:customer,
                foreignKey:'customerIdCard',
                attributes:['customerName','customerSex','customerVipLevel','customerPhoneNumber','totalAmount']
            },
            {
                model:room,
                foreignKey:'roomNumber',
                attributes:['type']
            }
        ]
    })
    .then(data  =>{
        res.status(200).json({
            success:true,
            msg:'状态订单查询成功!',
            orderList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count,
            pageSize:pageSize,
            offset:offset
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})
module.exports = orderRouter;
const express = require('express')//express框架
const { Op } = require('sequelize')//nodejs的sequelize模块
const room = require('../crud/table/room.js')//引入放假信息表
const roomType = require('../crud/table/roomType.js')//引入所有房间类型表

room.hasOne(roomType,{ sourceKey:'type',foreignKey:'type'})//每个房间都有一个房间类型

const roomRouter = express.Router()

roomRouter.post('/add',(req,res) =>{//添加房间
    const { roomNumber, type, roomStatus, remarks } = req.body;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:false,
                msg:'该房间已经存在!'
            })
            return new Promise(() =>{})
        }else{
            return room.create({
                roomNumber, type, roomStatus, remarks
            })
        }
    })
    .then(data =>{
        return room.findOne({
            where:{
                roomNumber
            },
            include:[{
                model:roomType,
                foreignKey:'type',
                attributes:['price','url']
            }]
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房间添加成功!',
            room:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.delete('/del',(req,res) =>{
    const { roomNumber } = req.body;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            return room.destroy({
                where:{
                    roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'房间删除失败!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'该房间删除成功!'
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.put('/update',(req,res) =>{//修改房间信息
    const { roomNumber, type, roomStatus,remarks } = req.body;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            return room.update({
                type, roomStatus,remarks
            },{
                where:{
                    roomNumber
                }
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'该房间不存在!'
            })
            return new Promise(() =>{})
        }
    })
    .then(data =>{
        return room.findOne({
            where:{
                roomNumber
            }
        })
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房间信息修改成功!',
            room:data.get()
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误'
        })
    })
})

roomRouter.get('/getAllRoom',(req,res) =>{//获取所有房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset
    })
    .then(data =>{
        let roomList = data.rows.map(item =>{
            return item.get()
        })
        res.status(200).json({
            success:true,
            msg:'房间信息查询成功!',
            roomList:roomList,
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.get('/getOneRoom',(req,res) =>{//获取某个房间号的房间信息
    const { roomNumber } = req.query;
    room.findOne({
        where:{
            roomNumber
        }
    })
    .then(data =>{
        if(data){
            res.status(200).json({
                success:true,
                msg:'房间查询成功!',
                room:data.get()
            })
        }else{
            res.status(200).json({
                success:false,
                msg:'未查询到该房间信息'
            })
        }
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.get('/getNotInRoom',(req,res) =>{//获取未入住房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'未入住'
            }
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'未入住房间查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.get('/getInRoom',(req,res) =>{//查询已入住房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'已入住'
            }
        }
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'已入住房间查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.get('/getAllRoomPrice',(req,res) =>{//查询所有的房间以及价格
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房间信息查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器内部错误!'
        })
    })
})

roomRouter.get('/getAllNotINRoomPrice',(req,res) =>{//获取所有未入住的房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'未入住'
            }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
       res.status(200).json({
           success:true,
           msg:'房间信息查询成功!',
           roomList:data.rows.map(item =>{
               return item.get()
           }),
           count:data.count
       })
    })
})

roomRouter.get('/getAllINRoomPrice',(req,res) =>{//获取所有已入住的房间信息
    const { pageSize, offset } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:'已入住'
            }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
       res.status(200).json({
           success:true,
           msg:'房间信息查询成功!',
           roomList:data.rows.map(item =>{
               return item.get()
           }),
           count:data.count
       })
    })
})

roomRouter.get('/getAllRoomTypePrice',(req,res) =>{
    const { pageSize, offset, type } = req.query;
    room.findAndCountAll({
        where:{
           type:{
               [Op.eq]:type
           }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
        res.status(200).json({
            success:true,
            msg:'房型查询成功!',
            roomList:data.rows.map(item =>{
                return item.get()
            }),
            count:data.count
        })
    })
    .catch(err =>{
        res.status(200).json({
            success:false,
            msg:'服务器出错!'
        })
    })
})

roomRouter.get('/getAllStatusRoom',(req,res) =>{//获取所有该状态的房间信息
    const { pageSize, offset, roomStatus } = req.query;
    room.findAndCountAll({
        limit:pageSize,
        offset:offset,
        where:{
            roomStatus:{
                [Op.eq]:roomStatus
            }
        },
        include:[{
            model:roomType,
            foreignKey:'type',
            attributes:['price','url']
        }]
    })
    .then(data =>{
       res.status(200).json({
           success:true,
           msg:'房间信息查询成功!',
           roomList:data.rows.map(item =>{
               return item.get()
           }),
           count:data.count
       })
    })
})


module.exports = roomRouter

五,项目总结

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2802.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

mysql约束

文章目录mysql约束非空约束唯一性约束主键约束使用自增列:AUTO_INCREMENTFOREIGN KEY约束CHECK约束mysql约束 为什么需要约束?为了保证数据的完整性什么叫约束?对表中字段的限制约束的分类: 角度1:约束的字段个数&…

吴峰光杀进 Linux 内核

【编者按】吴峰光,Linux 内核守护者,学生时代被同学戏称为“老神仙”,两耳不闻窗外事,一心只搞 Linux。吴峰光的 Linux 内核之路,是天赋、兴趣、耐心、坚持的综合,这从一个补丁前后迭代了 16 个版本后还进行…

【初识Netty使用Netty实现简单的客户端与服务端的通信操作Netty框架中一些重要的类以及方法的解析】

一.Netty是什么? Netty 由 Trustin Lee(韩国,Line 公司)2004 年开发 本质:网络应用程序框架 实现:异步、事件驱动 特性:高性能、可维护、快速开发 用途:开发服务器和客户端 Netty的性能很高&#xff0…

字符串匹配算法(BF、KMP)

目录 1、暴力匹配(BF)算法 2、KMP算法 1、暴力匹配(BF)算法 BF算法,即暴力(Brute Force)算法,是普通的模式匹配算法,BF算法的思想就是将目标串S的第一个字符与模式串T 的第一个字符进行匹配&a…

【树莓派不吃灰】配置samba,文件夹目录配置在闲置U盘,实现局域网文件共享

目录1. 前言2. 安装 Samba2.1 安装samba 和 samba-common-bin2.2 配置/etc/samba/smb.conf文件2.3 配置登录账号和密码2.4 重启 samba 服务2.5 回到windows,就可以在网络当中发现共享的文件夹3. 在Windows上挂载smb的共享目录3.1 打开windows的smb功能3.2 添加网络映…

Java --- springMVC实现RESTFul案例

一、使用springMVC实现RESTFul小案例 1.1、项目目录图&#xff1a; 1.2、代码实现&#xff1a; pom.xml文件&#xff1a; <packaging>war</packaging><!--添加依赖--><dependencies><!--SpringMVC--><dependency><groupId>org.spr…

黑马C++ 03 提高4 —— STL常用容器_string容器/vector容器/deque容器

文章目录一、string容器1. string基本概念2. string构造函数3. string赋值操作4. string字符串拼接5. string查找和替换6. string字符串比较7. string字符存取8. string字符串的插入和删除9. string子串二、vector容器(尾插尾删)1. vector基本概念2. vector构造函数3. vector赋…

【目标检测】基于yolov3的血细胞检测(无bug教程+附代码+数据集)

多的不说,少的不唠,先看检测效果图: 共检测三类:红细胞RBC、白细胞WBC、血小板Platelets Hello,大家好,我是augustqi。今天给大家带来的保姆级教程是:基于yolov3的血细胞检测(无bug教程+附代码+数据集) 1.项目背景 在上一期的教程中,我们基于yolov3训练了一个红细…

韩顺平linux(1-11小节)

运维工程师 服务器的规划、调试优化、日常监控、故障处理 物联网linux Linux主要指的是内核 ubuntu&#xff08;python偏爱&#xff09;&#xff0c;centos 发行版本 内核进行包装 1.4服务器领域 linux在服务器领域的应用是最强的。 linux免费、稳定、高效等特点在这里得到了很…

2019 Sichuan Province Programming Contest J. Jump on Axis

题目链接&#xff1a;https://codeforces.com/gym/102821/problem/J 题意&#xff1a;给你一个坐标k&#xff0c;每次从0开始走 每次有三个选择&#xff1a;选择1走一步&#xff0c;选择2走两步&#xff0c;选择3走三步 每次选第i个选择的时候&#xff0c;如果他没有被选过&…

MySQL是如何保证数据不丢失的

一.什么是两阶段提交 1.SQL语句&#xff08;update user set name‘李四’ where id3&#xff09;的执行流程是怎样的呢&#xff1f; 1.执行器先找引擎取 ID3这一行。ID 是主键&#xff0c;引擎直接用树搜索找到这一行。 2.如果 ID3 这一行所在的数据页本来就在内存中&#x…

力扣算法入门刷题

1、回文数 判断输入的整数是否是回文 我的一般思路&#xff1a; 将输入的整数转成字符串&#xff0c;再将这个字符串转成字符数组c&#xff0c;对字符数组进行遍历&#xff0c;如果第i个元素与第 c.length - i - 1 元素不相等&#xff0c;也就是通过比较首尾元素是否相同来判断…

自动化早已不是那个自动化了,谈一谈自动化测试现状和自我感受……

前言 从2017年6月开始接触自动化至今&#xff0c;已经有好几年了&#xff0c;从17年接触UI自动化&#xff08;unittestselenium&#xff09;到18年接触接口自动化&#xff08;unittestrequests&#xff09;再到18年自己编写自动化平台&#xff08;后台使用python的flask&#…

风、光、柴油机、蓄电池、电网交互微电网经济调度优化问题研究附Matlab代码

✅作者简介&#xff1a;热爱科研的Matlab仿真开发者&#xff0c;修心和技术同步精进&#xff0c;matlab项目合作可私信。 &#x1f34e;个人主页&#xff1a;Matlab科研工作室 &#x1f34a;个人信条&#xff1a;格物致知。 更多Matlab仿真内容点击&#x1f447; 智能优化算法 …

爆破校园网的宽带

前提&#xff1a;学校的手机号前7位相同&#xff0c;宽带密码都是手机号后六位。仅供学习。 准备工作&#xff1a;电脑一台&#xff0c;把校园网的宽带水晶头插在电脑上&#xff0c; 步骤&#xff1a; winR输入Rasphone点击新建&#xff0c;宽带&#xff0c;输入宽带名称&am…

Vue复刻华为官网 (一)

1 分析 根据华为网页的布局&#xff0c;我们大体上可以将其划分为7个盒子&#xff0c;如下&#xff0c;由于写一个这样的网页再加上部分动态效果&#xff0c;需要的时间很长&#xff0c;本篇博客只记录了div1、div2、div3的静态效果轮播图的实现。 2 顶部盒子的实现 想要实现的…

【C++AVL树】4种旋转详讲

目录 引子&#xff1a;AVL树是因为什么出现的&#xff1f; 1.AVl树的的特性 2.AVl树的框架 3.AVL树的插入 3.1四种旋转&#xff08;左单旋、右单旋、左右双旋、右左双旋&#xff09; 3.1.1左单旋 3.1.2右单旋 3.1.3左右双旋 3.1.4右左双旋 总结 引子&#xff1a;AVL树是因…

【单片机】单片机的核心思想

&#x1f4ac;推荐一款模拟面试、刷题神器 、从基础到大厂面试题&#xff1a;&#x1f449;点击跳转刷题网站进行注册学习 目录 一、单片机的核心思想 二、单片机核心图 三、上拉电路及应用 排阻的优势 四、单片机的输入输出模式 1、接收外部电压信号 2、向外输出电压信…

0089 时间复杂度,冒泡排序

/* * 排序也称排序算法&#xff08;Sort Algorithm&#xff09; * 排序是将一组数据&#xff0c;依指定的顺序进行排列的过程。 * * 排序分类 * 1.内部排序&#xff1a;将需要处理的所有数据都加载到内存存储器中进行排序&#xff08;使用内存&#xff09; * 插…

彻底搞懂WeakMap和Map

一 、Map Map是一种叫做字典的数据结构&#xff0c;Map 对象保存不重复键值对&#xff0c;并且能够记住键的原始插入顺序 Map的属性和方法* 属性&#xff1a; size&#xff1a; 返回所包含的键值对长度* 操作方法&#xff1a;* set(key,val): 添加新键值对* get(key): 通过传…