资源简介
简单利用SSM+Mysql的做了一个程序,主要实现了注册、查询、修改、注销、取款、存款以及转账等功能,类似于一个小型的功能特别简单的ATM机。
代码片段和文件信息
package com.evloution.datas.controller;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import org.apache.ibatis.annotations.Param;
import org.apache.log4j.Logger;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import com.evloution.datas.domain.Account;
import com.evloution.datas.service.AccountService;
@Controller
@RequestMapping(“/accountBank“)
public class AccountController {
private Logger logger = Logger.getLogger(AccountController.class);
@Autowired
private AccountService accountService;
// 首页,用来测试的
@RequestMapping(value = “/accountList“ method = RequestMethod.GET)
public String accountListController() {
return “accountList“;
}
// 用户登录
@RequestMapping(value = “/accountLogin“ method = RequestMethod.GET)
public String accountLoginController(String userAccount String userPassword Model model HttpSession session
HttpServletRequest request) {
String zhanghao = request.getParameter(“userAccount“);
String password = request.getParameter(“userPassword“);
logger.info(“输入的账号:“ + zhanghao + “\t“ + “输入的密码:“ + password);
Account account = accountService.accountLoginService(userAccount userPassword);
logger.info(“登录时的account------>“ + account);
if (account != null) {
session.setAttribute(“account“ account);
// mv.setViewName(“accountList“);
// mv.setView(new RedirectView(“accountList“));
logger.info(“登录成功!“);
return “redirect:accountList“;
}
// mv.addobject(“message“ “登录名或者密码错误,请重新输入“);
// mv.setViewName(“accountLogin“); // 重新设置view视图页面
model.addAttribute(“message“ “账号或密码错误,请重新输入!“);
logger.info(“登录失败!“);
return “accountLogin“;
}
// 跳转到用户注册
@RequestMapping(value = “/toAccountInsert“ method = RequestMethod.GET)
public String toAccountInsertController() {
logger.info(“跳转节点,利用get方式请求到添加用户页面,方法是(toAccountInsertController)“);
return “accountInsert“;
}
// 用户注册
@RequestMapping(value = “/accountInsert“ method = RequestMethod.GET)
public String accountInsertController(Account account) {
accountService.insertUserAccount(account);
logger.info(“用户添加完成用get方式请求到登录页面“);
return “redirect:accountLogin“;
}
// 跳转到用户存款
@RequestMapping(value = “/toAccountSave“ method = RequestMethod.GET)
public String toAccountSaveController(@Param(“userAccount“) String userAccount) {
logger.info(“跳转节点,利用get方式请求到存款页面,方法是(toAccountSaveController)“);
logger.info(“存款时的账号是:“ + userAccount);
accountService.selectUserAccountBalanceService(userAccount);
return “accountSave“;
}
// 用户存款
@RequestMapping(value = “/accountSave“ method = RequestMethod.GET)
public String accountSaveController(String userAccount Float transactionMoney F
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
目录 0 2018-04-27 14:29 BankCloudServices\
文件 1561 2018-03-21 15:18 BankCloudServices\.classpath
文件 917 2017-12-20 16:00 BankCloudServices\.project
目录 0 2018-03-21 15:17 BankCloudServices\.settings\
文件 567 2017-12-20 16:00 BankCloudServices\.settings\.jsdtscope
文件 159 2017-12-22 15:39 BankCloudServices\.settings\org.eclipse.core.resources.prefs
文件 364 2017-12-20 16:00 BankCloudServices\.settings\org.eclipse.jdt.core.prefs
文件 580 2017-12-20 16:05 BankCloudServices\.settings\org.eclipse.wst.common.component
文件 345 2017-12-20 16:00 BankCloudServices\.settings\org.eclipse.wst.common.project.facet.core.xm
文件 49 2017-12-20 16:00 BankCloudServices\.settings\org.eclipse.wst.jsdt.ui.superType.container
文件 6 2017-12-20 16:00 BankCloudServices\.settings\org.eclipse.wst.jsdt.ui.superType.name
文件 654 2018-04-27 14:29 BankCloudServices\account_record_table.sql
目录 0 2018-03-21 15:17 BankCloudServices\build\
目录 0 2018-03-21 15:24 BankCloudServices\build\classes\
文件 4475 2018-02-26 15:47 BankCloudServices\build\classes\applicationContext.xm
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\controller\
文件 8629 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\controller\AccountController.class
文件 2460 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\controller\LoginInterceptor.class
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\dao\
文件 1566 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\dao\AccountDao.class
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\domain\
文件 3537 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\domain\Account.class
文件 2819 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\domain\AccountRecord.class
目录 0 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\service\
文件 1023 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\service\AccountService.class
文件 5999 2018-03-21 15:18 BankCloudServices\build\classes\com\evloution\datas\service\AccountServiceImpl.class
文件 1692 2018-03-21 15:23 BankCloudServices\build\classes\jdbc.properties
文件 1983 2018-03-21 15:24 BankCloudServices\build\classes\log4j.properties
............此处省略72个文件信息
- 上一篇:ssh开发电影管理系统
- 下一篇:完整的汽车租赁系统代码和文档
评论
共有 条评论