学期末了,选了一个酒店管理系统作为课设,记录一下这些天的成果,项目演示小型酒店管理系统(ssm)-CSDN直播
后端技术:ssm框架(spring,springmvc,mybatis)
前端技术:Qadmin模板,qadmin是一个基于前端vue框架和layui框架的东西,本身使用适合初学者和甚者没学过vue和layui的新手,可登录官方网站查看QAdmin - 轻量级后台模板解决了后端人员写不出前端漂亮界面的问题。所谓框架,就是拿写好的东西用就可以了,无非就是html,css,JavaScript这前端三剑客组合而成。
菜单栏都是可选的,在json中修改菜单栏就可以添加自己想要的功能,从前端的jsp页面找到数据入口,跳转到后端进行逻辑业务 *** 作就可以了。
admin
package com.hotel.controller;
import com.hotel.pojo.Admin;
import com.hotel.service.AdminServiceImpl;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
@Controller
@RequestMapping("/admin")
public class AdminController {
@Autowired
AdminServiceImpl adminService;
@RequestMapping("/login")
public String login(String username,String password){
username=username.trim();
password=password.trim();
Admin admin=adminService.findAdmin(username,password );
if(admin!=null){
return "index";
}else {
return "error";
}
}
@RequestMapping("/updatePwd")
public String update(Admin admin){
adminService.updatePwd(admin);
System.out.println(admin);
return "suc_a";
}
}
package com.hotel.service;
import com.hotel.dao.AdminMapper;
import com.hotel.pojo.Admin;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
@Service
public class AdminServiceImpl implements AdminService{
@Autowired
AdminMapper adminMapper;
@Override
public int updatePwd(Admin admin) {
return adminMapper.updatePwd(admin) ;
}
@Override
public Admin findAdmin(String username, String password) {
return adminMapper.findAdmin(username,password);
}
}
package com.hotel.pojo;
public class Admin {
private String username;
private String password;
public Admin(String username, String password) {
this.username = username;
this.password = password;
}
public Admin() {
}
public String getUsername() {
return username;
}
public void setUsername(String username) {
this.username = username;
}
public String getPassword() {
return password;
}
public void setPassword(String password) {
this.password = password;
}
@Override
public String toString() {
return "Admin{" +
"username='" + username + '\'' +
", password=" + password +
'}';
}
}
update admin
set password=#{password}
where username='admin';
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)