diff --git a/.idea/compiler.xml b/.idea/compiler.xml
new file mode 100644
index 0000000..29b4433
--- /dev/null
+++ b/.idea/compiler.xml
@@ -0,0 +1,14 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/dictionaries b/.idea/dictionaries
new file mode 100644
index 0000000..8004c1a
--- /dev/null
+++ b/.idea/dictionaries
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..65ac0a6
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/inspectionProfiles/Project_Default.xml b/.idea/inspectionProfiles/Project_Default.xml
new file mode 100644
index 0000000..27444f0
--- /dev/null
+++ b/.idea/inspectionProfiles/Project_Default.xml
@@ -0,0 +1,36 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/jsLibraryMappings.xml b/.idea/jsLibraryMappings.xml
new file mode 100644
index 0000000..26d1067
--- /dev/null
+++ b/.idea/jsLibraryMappings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..258b729
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,17 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/uiDesigner.xml b/.idea/uiDesigner.xml
new file mode 100644
index 0000000..e96534f
--- /dev/null
+++ b/.idea/uiDesigner.xml
@@ -0,0 +1,124 @@
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+ -
+
+
+
+
+ -
+
+
+ -
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..748d9fc
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,334 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1581298470446
+
+
+ 1581298470446
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..fc803b6
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,195 @@
+
+
+
+ 4.0.0
+
+ cn.ppdxzz
+ hellossm
+ 1.0-SNAPSHOT
+ war
+
+ hellossm Maven Webapp
+
+ http://www.example.com
+
+
+ UTF-8
+ 12
+ 12
+ 5.0.2.RELEASE
+ 1.6.6
+ 1.2.12
+ 8.0.17
+ 3.4.5
+
+
+
+
+
+ org.aspectj
+ aspectjweaver
+ 1.6.8
+
+
+
+ org.springframework
+ spring-aop
+ ${spring.version}
+
+
+
+ org.springframework
+ spring-context
+ ${spring.version}
+
+
+
+ org.springframework
+ spring-web
+ ${spring.version}
+
+
+
+ org.springframework
+ spring-webmvc
+ ${spring.version}
+
+
+
+ org.springframework
+ spring-test
+ ${spring.version}
+
+
+
+ org.springframework
+ spring-tx
+ ${spring.version}
+
+
+
+ mysql
+ mysql-connector-java
+ ${mysql.version}
+
+
+
+ org.springframework
+ spring-jdbc
+ ${spring.version}
+
+
+
+ junit
+ junit
+ 4.12
+ compile
+
+
+
+ javax.servlet
+ servlet-api
+ 2.5
+ provided
+
+
+
+ javax.servlet.jsp
+ jsp-api
+ 2.0
+ provided
+
+
+
+ jstl
+ jstl
+ 1.2
+
+
+
+
+ log4j
+ log4j
+ ${log4j.version}
+
+
+
+ org.slf4j
+ slf4j-api
+ ${slf4j.version}
+
+
+
+ org.slf4j
+ slf4j-log4j12
+ ${slf4j.version}
+
+
+
+
+ org.mybatis
+ mybatis
+ ${mybatis.version}
+
+
+
+ org.mybatis
+ mybatis-spring
+ 1.3.0
+
+
+
+
+ c3p0
+ c3p0
+ 0.9.1.2
+ jar
+ compile
+
+
+
+
+ com.github.pagehelper
+ pagehelper
+ 5.1.10
+
+
+
+
+ hellossm
+
+
+
+ maven-clean-plugin
+ 3.1.0
+
+
+
+ maven-resources-plugin
+ 3.0.2
+
+
+ maven-compiler-plugin
+ 3.8.0
+
+
+ maven-surefire-plugin
+ 2.22.1
+
+
+ maven-war-plugin
+ 3.2.2
+
+
+ maven-install-plugin
+ 2.5.2
+
+
+ maven-deploy-plugin
+ 2.8.2
+
+
+
+
+
diff --git a/src/main/java/cn/ppdxzz/controller/AdminController.java b/src/main/java/cn/ppdxzz/controller/AdminController.java
new file mode 100644
index 0000000..390febf
--- /dev/null
+++ b/src/main/java/cn/ppdxzz/controller/AdminController.java
@@ -0,0 +1,195 @@
+package cn.ppdxzz.controller;
+
+import cn.ppdxzz.domain.Admin;
+import cn.ppdxzz.service.AdminService;
+import cn.ppdxzz.utils.MD5Util;
+import com.github.pagehelper.PageInfo;
+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.RequestParam;
+import org.springframework.web.bind.annotation.ResponseBody;
+import org.springframework.web.servlet.ModelAndView;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+import javax.servlet.http.HttpSession;
+import java.io.IOException;
+import java.io.PrintWriter;
+import java.util.List;
+
+/**
+ * Description:
+ *
+ * @Date: 2020/2/10 15:20
+ * @Author: PeiChen
+ */
+@Controller
+public class AdminController {
+
+ private PrintWriter writer;
+ private AdminService adminService;
+ @Autowired
+ public void setAdminService(AdminService adminService) {
+ this.adminService = adminService;
+ }
+
+ /**
+ * 处理用户登录请求
+ * @param model
+ * @param admin
+ * @param session
+ * @param request
+ * @return
+ */
+ @RequestMapping(value = "/login")
+ public String login(Model model, Admin admin, HttpSession session, HttpServletRequest request) throws Exception {
+ admin.setPassword(MD5Util.MD5EncodeUtf8(admin.getPassword()));
+ Admin ad = adminService.findAdmin(admin);
+ if (ad != null) {
+ //登录信息存入session域
+ session.setAttribute("adminInfo",ad);
+ //System.out.println(ad);
+ return "main";
+ }
+ model.addAttribute("msg","用户名或密码错误,请重新输入!");
+ return "login";
+ }
+
+ /**
+ * 退出登录
+ */
+ @RequestMapping(value = "/loginOut")
+ public String loginOut(Admin admin,Model model,HttpSession session) {
+ //通过session.invalidate()方法来注销当前的session
+ session.invalidate();
+ return "login";
+
+ }
+
+ /**
+ * 分页查询所有管理员信息
+ */
+ @RequestMapping(value = "/findAllAdmin")
+ public ModelAndView findAll(@RequestParam(name = "page", required = true, defaultValue = "1") int page, @RequestParam(name = "size", required = true, defaultValue = "4") int size) throws Exception {
+ ModelAndView mv = new ModelAndView();
+ List admins = adminService.findAll(page,size);
+ //PageInfo就是一个封装了分页数据的bean
+ PageInfo pageInfo = new PageInfo(admins);
+ mv.addObject("pageInfo",pageInfo);
+ mv.setViewName("admin-list");
+ return mv;
+ }
+
+ /**
+ * 删除管理员
+ */
+ @ResponseBody
+ @RequestMapping(value = "/deleteAdmin")
+ public void deleteAdmin(HttpServletRequest request) throws Exception {
+ String id = request.getParameter("id");
+ adminService.deleteAdminById(Integer.parseInt(id));
+ }
+
+ /**
+ * 校验用户名是否存在
+ */
+ @RequestMapping(value = "/checkUserName")
+ public void checkUserName(HttpServletRequest request, HttpServletResponse response) throws Exception {
+ request.setCharacterEncoding("utf-8");
+ response.setCharacterEncoding("utf-8");
+ PrintWriter pw = response.getWriter();
+ //取值
+ String u_name = request.getParameter("u_name");
+ //调用service,用户名存在返回true,不存在则返回false
+ Boolean result = adminService.checkUserName(u_name);
+ //System.out.println(result);
+ //回调函数
+ if (result) {
+ //pw.write("用户名已存在,请重新输入!");
+ pw.write("账号可用");
+ }else {
+ pw.write("账号不存在");
+ }
+ }
+ @RequestMapping(value = "/adminAdd")
+ public String adminAdd() {
+ return "admin-add";
+ }
+
+ /**
+ * 添加管理员
+ * @param admin
+ * @param request
+ * @param response
+ * @throws Exception
+ */
+ @RequestMapping("/addAdmin")
+ public void addAdmin(Admin admin,HttpServletRequest request,HttpServletResponse response) throws Exception {
+ PrintWriter writer = response.getWriter();
+ Boolean check = adminService.checkUserName(admin.getUsername());
+ //如果用户名已存在check为true,不存在为false
+ if (check) {
+ writer.write("false");
+ return;
+ }
+ if (admin == null) {
+ writer.write("false");
+ return;
+ }else {
+ if(admin.getUsername() == null || "".trim().equals(admin.getUsername())
+ || admin.getPassword() == null ||"".trim().equals(admin.getPassword())
+ || admin.getName() == null || "".trim().equals(admin.getName())
+ || admin.getPhone() == null || "".trim().equals(admin.getPhone())
+ || admin.getDescription() == null || "".trim().equals(admin.getDescription())) {
+ writer.write("false");
+ return;
+ }
+ }
+ admin.setPassword(MD5Util.MD5EncodeUtf8(admin.getPassword()));
+ adminService.addAdmin(admin);
+ writer.write("true");
+ }
+ //跳转管理员信息编辑页面,并回显信息
+ @RequestMapping("/adminEdit")
+ public ModelAndView editAdmin(HttpServletRequest request) throws Exception {
+ ModelAndView mv = new ModelAndView();
+ String id = request.getParameter("id");
+ Admin ad = adminService.findAdminById(Integer.parseInt(id));
+ mv.addObject("ad",ad);
+ //mv.addObject("id",id);
+ mv.setViewName("admin-edit");
+ return mv;
+ }
+ //修改管理员信息
+ @RequestMapping("/editAdmin")
+ public void editAdmin(Admin admin,HttpServletResponse response) throws Exception {
+ writer = response.getWriter();
+ if (admin == null) {
+ writer.write("false");
+ return;
+ }else {
+ if(admin.getUsername() == null || "".trim().equals(admin.getUsername())
+ || admin.getPassword() == null ||"".trim().equals(admin.getPassword())
+ || admin.getName() == null || "".trim().equals(admin.getName())
+ || admin.getPhone() == null || "".trim().equals(admin.getPhone())
+ || admin.getDescription() == null || "".trim().equals(admin.getDescription())) {
+ writer.write("false");
+ return;
+ }
+ }
+ admin.setPassword(MD5Util.MD5EncodeUtf8(admin.getPassword()));
+ adminService.updateAdmin(admin);
+ //更新成功进行提示信息回显
+ writer.write("true");
+ }
+
+
+
+
+
+
+
+
+}
diff --git a/src/main/java/cn/ppdxzz/dao/AdminDao.java b/src/main/java/cn/ppdxzz/dao/AdminDao.java
new file mode 100644
index 0000000..8f9227b
--- /dev/null
+++ b/src/main/java/cn/ppdxzz/dao/AdminDao.java
@@ -0,0 +1,81 @@
+package cn.ppdxzz.dao;
+
+import cn.ppdxzz.domain.Admin;
+import org.apache.ibatis.annotations.Delete;
+import org.apache.ibatis.annotations.Insert;
+import org.apache.ibatis.annotations.Select;
+import org.apache.ibatis.annotations.Update;
+import org.springframework.stereotype.Repository;
+
+import java.util.List;
+
+/**
+ * Description:持久层
+ *
+ * @Date: 2020/2/10 15:33
+ * @Author: PeiChen
+ */
+@Repository
+public interface AdminDao {
+
+ /**
+ * 通过用户名密码查询用户信息
+ * @param admin
+ * @return
+ * @throws Exception
+ */
+ @Select("select * from admins where username = #{username} and password = #{password}")
+ Admin findAdmin(Admin admin) throws Exception;
+
+ /**
+ * 通过id查询用户信息
+ */
+ @Select("select * from admins where id = #{id}")
+ Admin findAdminById(Integer id) throws Exception;
+
+ /**
+ * 查询所有管理员信息
+ */
+ @Select("select * from admins")
+ List findAll() throws Exception;
+
+ /**
+ * 根据id删除管理员信息
+ * @param id
+ * @throws Exception
+ */
+ @Delete("delete from admins where id = #{id}")
+ void deleteAdminById(Integer id) throws Exception;
+
+ /**
+ * 修改管理员信息
+ * @param admin
+ * @throws Exception
+ */
+ @Update("update admins set username= #{username},password = #{password},name = #{name}, phone = #{phone}, power = #{power}, description = #{description} where id = #{id}")
+ void updateAdmin(Admin admin) throws Exception;
+
+ /**
+ * 添加管理员信息
+ * @param admin
+ * @throws Exception
+ */
+ @Insert("insert into admins(username,password,name,phone,power,description) values (#{username},#{password},#{name},#{phone},#{power},#{description})")
+ void addAdmin(Admin admin) throws Exception;
+
+ /**
+ * 校验用户名是否存在
+ */
+ @Select("select * from admins where username = #{u_name}")
+ Boolean checkUserName(String u_name) throws Exception;
+
+ /**
+ * 重置密码
+ * @param password
+ * @param id
+ * @throws Exception
+ */
+ @Update("update admins set password = #{password} where id = #{id}")
+ void updatePassword(String password,Integer id) throws Exception;
+
+}
diff --git a/src/main/java/cn/ppdxzz/domain/Admin.java b/src/main/java/cn/ppdxzz/domain/Admin.java
new file mode 100644
index 0000000..51b4d66
--- /dev/null
+++ b/src/main/java/cn/ppdxzz/domain/Admin.java
@@ -0,0 +1,101 @@
+package cn.ppdxzz.domain;
+
+import java.io.Serializable;
+
+/**
+ * Description:管理员实体类
+ *
+ * @Date: 2020/2/10 15:13
+ * @Author: PeiChen
+ */
+public class Admin implements Serializable {
+ private Integer id; //id 主键自增
+ private String username; //用户名
+ private String password; //密码
+ private String name; //姓名
+ private String phone; //手机号
+ private int power; //是否开启权限
+ private String description; //描述
+
+ public Admin() {
+ }
+
+ public Admin(Integer id, String username, String password, String name, String phone, int power, String description) {
+ this.id = id;
+ this.username = username;
+ this.password = password;
+ this.name = name;
+ this.phone = phone;
+ this.power = power;
+ this.description = description;
+ }
+
+ public Integer getId() {
+ return id;
+ }
+
+ public void setId(Integer id) {
+ this.id = id;
+ }
+
+ 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;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public void setName(String name) {
+ this.name = name;
+ }
+
+ public String getPhone() {
+ return phone;
+ }
+
+ public void setPhone(String phone) {
+ this.phone = phone;
+ }
+
+ public int getPower() {
+ return power;
+ }
+
+ public void setPower(int power) {
+ this.power = power;
+ }
+
+ public String getDescription() {
+ return description;
+ }
+
+ public void setDescription(String description) {
+ this.description = description;
+ }
+
+ @Override
+ public String toString() {
+ return "Admin{" +
+ "id=" + id +
+ ", username='" + username + '\'' +
+ ", password='" + password + '\'' +
+ ", name='" + name + '\'' +
+ ", phone='" + phone + '\'' +
+ ", power=" + power +
+ ", description='" + description + '\'' +
+ '}';
+ }
+}
diff --git a/src/main/java/cn/ppdxzz/service/AdminService.java b/src/main/java/cn/ppdxzz/service/AdminService.java
new file mode 100644
index 0000000..9e5bc1a
--- /dev/null
+++ b/src/main/java/cn/ppdxzz/service/AdminService.java
@@ -0,0 +1,30 @@
+package cn.ppdxzz.service;
+
+import cn.ppdxzz.domain.Admin;
+
+import java.util.List;
+
+/**
+ * Description:
+ *
+ * @Date: 2020/2/10 15:27
+ * @Author: PeiChen
+ */
+public interface AdminService {
+ /**
+ * 校验用户名密码是否正确
+ */
+ Admin findAdmin(Admin admin) throws Exception;
+ //通过id查询管理员信息
+ Admin findAdminById(Integer id) throws Exception;
+
+ List findAll(int page,int size) throws Exception;
+
+ void deleteAdminById(Integer id) throws Exception;
+
+ void updateAdmin(Admin admin) throws Exception;
+
+ void addAdmin(Admin admin) throws Exception;
+
+ Boolean checkUserName(String u_name) throws Exception;
+}
diff --git a/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java b/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java
new file mode 100644
index 0000000..ab9cc44
--- /dev/null
+++ b/src/main/java/cn/ppdxzz/service/impl/AdminServiceImpl.java
@@ -0,0 +1,101 @@
+package cn.ppdxzz.service.impl;
+
+import cn.ppdxzz.dao.AdminDao;
+import cn.ppdxzz.domain.Admin;
+import cn.ppdxzz.service.AdminService;
+import com.github.pagehelper.PageHelper;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+/**
+ * Description:
+ *
+ * @Date: 2020/2/10 15:30
+ * @Author: PeiChen
+ */
+@Service("adminService")
+public class AdminServiceImpl implements AdminService {
+
+ private AdminDao adminDao;
+ @Autowired
+ public void setAdminDao(AdminDao adminDao) {
+ this.adminDao = adminDao;
+ }
+
+ /**
+ * 调用持久层中的findAdmin()方法校验用户名密码是否正确
+ * @param admin
+ * @return
+ * @throws Exception
+ */
+ @Override
+ public Admin findAdmin(Admin admin) throws Exception {
+ return adminDao.findAdmin(admin);
+ }
+
+ /**
+ * 通过id查询管理员信息
+ * @param id
+ * @return Admin
+ * @throws Exception
+ */
+ @Override
+ public Admin findAdminById(Integer id) throws Exception {
+ return adminDao.findAdminById(id);
+ }
+
+ /**
+ * 查询所有管理员信息
+ * @return
+ * @throws Exception
+ */
+ @Override
+ public List findAll(int page,int size) throws Exception {
+ PageHelper.startPage(page,size);
+ return adminDao.findAll();
+ }
+
+ /**
+ * 通过id删除管理员
+ * @param id
+ * @throws Exception
+ */
+ @Override
+ public void deleteAdminById(Integer id) throws Exception {
+ adminDao.deleteAdminById(id);
+ }
+
+ /**
+ * 更新管理员信息
+ * @param admin
+ * @throws Exception
+ */
+ @Override
+ public void updateAdmin(Admin admin) throws Exception {
+ adminDao.updateAdmin(admin);
+ }
+
+ /**
+ * 添加管理员信息
+ * @param admin
+ * @throws Exception
+ */
+ @Transactional
+ @Override
+ public void addAdmin(Admin admin) throws Exception {
+ adminDao.addAdmin(admin);
+ }
+
+ @Override
+ public Boolean checkUserName(String u_name) throws Exception {
+ //System.out.println(adminDao.checkUserName(u_name));
+ //用户名不存在则返回空,直接false
+ if (adminDao.checkUserName(u_name) != null) {
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/src/main/java/cn/ppdxzz/utils/MD5Util.java b/src/main/java/cn/ppdxzz/utils/MD5Util.java
new file mode 100644
index 0000000..34fffce
--- /dev/null
+++ b/src/main/java/cn/ppdxzz/utils/MD5Util.java
@@ -0,0 +1,62 @@
+package cn.ppdxzz.utils;
+
+import java.security.MessageDigest;
+
+/**
+ * MD5加密算法
+ */
+
+public class MD5Util {
+
+ private static String byteArrayToHexString(byte b[]) {
+ StringBuffer resultSb = new StringBuffer();
+ for (int i = 0; i < b.length; i++)
+ resultSb.append(byteToHexString(b[i]));
+
+ return resultSb.toString();
+ }
+
+ private static String byteToHexString(byte b) {
+ int n = b;
+ if (n < 0)
+ n += 256;
+ int d1 = n / 16;
+ int d2 = n % 16;
+ return hexDigits[d1] + hexDigits[d2];
+ }
+
+ /**
+ * 返回大写MD5
+ */
+ private static String MD5Encode(String origin, String charsetname) {
+ String resultString = null;
+ try {
+ resultString = new String(origin);
+ MessageDigest md = MessageDigest.getInstance("MD5");
+ if (charsetname == null || "".equals(charsetname))
+ resultString = byteArrayToHexString(md.digest(resultString.getBytes()));
+ else
+ resultString = byteArrayToHexString(md.digest(resultString.getBytes(charsetname)));
+ } catch (Exception exception) {
+ }
+ return resultString.toUpperCase();
+ }
+
+ public static String MD5EncodeUtf8(String origin) {
+
+ //盐值Salt加密
+ //origin = origin + PropertiesUtil.getProperty("password.salt", "");
+ return MD5Encode(origin, "utf-8");
+ }
+
+
+ private static final String hexDigits[] = {"0", "1", "2", "3", "4", "5",
+ "6", "7", "8", "9", "a", "b", "c", "d", "e", "f"};
+
+ public static void main(String[] args) {
+ MD5Util md = new MD5Util();
+ String psd = md.MD5EncodeUtf8("123456");
+ System.out.println(psd);
+ }
+}
+
diff --git a/src/main/resources/applicationContext.xml b/src/main/resources/applicationContext.xml
new file mode 100644
index 0000000..3d5451a
--- /dev/null
+++ b/src/main/resources/applicationContext.xml
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ mysql
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/resources/db.properties b/src/main/resources/db.properties
new file mode 100644
index 0000000..045d7aa
--- /dev/null
+++ b/src/main/resources/db.properties
@@ -0,0 +1,4 @@
+jdbc.driver=com.mysql.cj.jdbc.Driver
+jdbc.url=jdbc:mysql://localhost:3306/hello_ssm?serverTimezone=UTC&characterEncoding=utf-8
+jdbc.username=root
+jdbc.password=root
\ No newline at end of file
diff --git a/src/main/resources/log4j.properties b/src/main/resources/log4j.properties
new file mode 100644
index 0000000..a797bae
--- /dev/null
+++ b/src/main/resources/log4j.properties
@@ -0,0 +1,19 @@
+# Set root category priority to INFO and its only appender to CONSOLE.
+#log4j.rootCategory=INFO, CONSOLE debug info warn error fatal
+log4j.rootCategory=info, CONSOLE, LOGFILE
+
+# Set the enterprise logger category to FATAL and its only appender to CONSOLE.
+log4j.logger.org.apache.axis.enterprise=FATAL, CONSOLE
+
+# CONSOLE is set to be a ConsoleAppender using a PatternLayout.
+log4j.appender.CONSOLE=org.apache.log4j.ConsoleAppender
+log4j.appender.CONSOLE.layout=org.apache.log4j.PatternLayout
+log4j.appender.CONSOLE.layout.ConversionPattern=%d{ISO8601} %-6r [%15.15t] %-5p %30.30c %x - %m\n
+
+# LOGFILE is set to be a File appender using a PatternLayout.
+log4j.appender.LOGFILE=org.apache.log4j.FileAppender
+log4j.appender.LOGFILE.File=d:\\log4j.log
+log4j.appender.LOGFILE.Append=true
+log4j.appender.LOGFILE.layout=org.apache.log4j.PatternLayout
+log4j.appender.LOGFILE.layout.ConversionPattern=%d{ISO8601} %-6r [%15.15t] %-5p %30.30c %x - %m\n
+
diff --git a/src/main/resources/spring-mvc.xml b/src/main/resources/spring-mvc.xml
new file mode 100644
index 0000000..048c5fa
--- /dev/null
+++ b/src/main/resources/spring-mvc.xml
@@ -0,0 +1,43 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/main/webapp/WEB-INF/jsp/admin-add.jsp b/src/main/webapp/WEB-INF/jsp/admin-add.jsp
new file mode 100644
index 0000000..7fcdc0b
--- /dev/null
+++ b/src/main/webapp/WEB-INF/jsp/admin-add.jsp
@@ -0,0 +1,142 @@
+<%--
+ Created by IntelliJ IDEA.
+ User: user
+ Date: 2020/2/12
+ Time: 13:06
+ To change this template use File | Settings | File Templates.
+--%>
+<%@ page contentType="text/html;charset=UTF-8" language="java" %>
+
+
+ Title
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+