Java+Springboot+Mybatis+Mysql+Bootstrap+Maven实现网上商城系统(下)

本文涉及的产品
云数据库 RDS MySQL,集群系列 2核4GB
推荐场景:
搭建个人博客
RDS MySQL Serverless 基础系列,0.5-2RCU 50GB
RDS MySQL Serverless 高可用系列,价值2615元额度,1个月
简介: Java+Springboot+Mybatis+Mysql+Bootstrap+Maven实现网上商城系统

IndexController

package priv.jesse.mall.web.user;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import javax.servlet.http.HttpServletRequest;
@Controller
public class IndexController {
    /**
     * 打开首页
     * @return
     */
    @RequestMapping("/index.html")
    public String toIndex() {
        return "mall/index";
    }
    /**
     * 访问根目录转发到首页
     * @return
     */
    @RequestMapping("/")
    public String index(){
        return "forward:/index.html";
    }
}

OrderController

package priv.jesse.mall.web.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import priv.jesse.mall.entity.Order;
import priv.jesse.mall.entity.OrderItem;
import priv.jesse.mall.entity.pojo.ResultBean;
import priv.jesse.mall.service.OrderService;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@Controller
@RequestMapping("/order")
public class OrderController {
    @Autowired
    private OrderService orderService;
    /**
     * 打开订单列表页面
     *
     * @return
     */
    @RequestMapping("/toList.html")
    public String toOrderList() {
        return "mall/order/list";
    }
    /**
     * 查询用户订单列表
     *
     * @param request
     * @return
     */
    @RequestMapping("/list.do")
    @ResponseBody
    public ResultBean<List<Order>> listData(HttpServletRequest request) {
        List<Order> orders = orderService.findUserOrder(request);
        return new ResultBean<>(orders);
    }
    /**
     * 查询订单详情
     *
     * @param orderId
     * @return
     */
    @RequestMapping("/getDetail.do")
    @ResponseBody
    public ResultBean<List<OrderItem>> getDetail(int orderId) {
        List<OrderItem> orderItems = orderService.findItems(orderId);
        return new ResultBean<>(orderItems);
    }
    /**
     * 提交订单
     *
     * @param name
     * @param phone
     * @param addr
     * @param request
     * @param response
     */
    @RequestMapping("/submit.do")
    public void submit(String name,
                       String phone,
                       String addr,
                       HttpServletRequest request,
                       HttpServletResponse response) throws Exception {
        orderService.submit(name, phone, addr, request, response);
    }
    /**
     * 支付方法
     *
     * @param orderId
     */
    @RequestMapping("pay.do")
    @ResponseBody
    public ResultBean<Boolean> pay(int orderId, HttpServletResponse response) throws IOException {
        orderService.pay(orderId);
        return new ResultBean<>(true);
    }
    /**
     * 确认收货
     * @param orderId
     * @param response
     * @return
     * @throws IOException
     */
    @RequestMapping("receive.do")
    @ResponseBody
    public ResultBean<Boolean> receive(int orderId, HttpServletResponse response) throws IOException {
        orderService.receive(orderId);
        return new ResultBean<>(true);
    }
}

ProductController

package priv.jesse.mall.web.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import priv.jesse.mall.entity.Classification;
import priv.jesse.mall.entity.OrderItem;
import priv.jesse.mall.entity.Product;
import priv.jesse.mall.entity.pojo.ResultBean;
import priv.jesse.mall.service.ClassificationService;
import priv.jesse.mall.service.ProductService;
import priv.jesse.mall.service.ShopCartService;
import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Map;
@Controller
@RequestMapping("/product")
public class ProductController {
    @Autowired
    private ProductService productService;
    @Autowired
    private ClassificationService classificationService;
    @Autowired
    private ShopCartService shopCartService;
    /**
     * 获取商品信息
     *
     * @param id
     * @return
     */
    @RequestMapping("/get.do")
    public ResultBean<Product> getProduct(int id) {
        Product product = productService.findById(id);
        return new ResultBean<>(product);
    }
    /**
     * 打开商品详情页面
     *
     * @param id
     * @param map
     * @return
     */
    @RequestMapping("/get.html")
    public String toProductPage(int id, Map<String, Object> map) {
        Product product = productService.findById(id);
        map.put("product", product);
        return "mall/product/info";
    }
    /**
     * 查找热门商品
     *
     * @return
     */
    @ResponseBody
    @RequestMapping("/hot.do")
    public ResultBean<List<Product>> getHotProduct() {
        List<Product> products = productService.findHotProduct();
        return new ResultBean<>(products);
    }
    /**
     * 查找最新商品
     *
     * @param pageNo
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("/new.do")
    public ResultBean<List<Product>> getNewProduct(int pageNo, int pageSize) {
        Pageable pageable = new PageRequest(pageNo, pageSize);
        List<Product> products = productService.findNewProduct(pageable);
        return new ResultBean<>(products);
    }
    /**
     * 打开分类查看商品页面
     *
     * @return
     */
    @RequestMapping("/category.html")
    public String toCatePage(int cid, Map<String, Object> map) {
        Classification classification = classificationService.findById(cid);
        map.put("category", classification);
        return "mall/product/category";
    }
    @RequestMapping("/toCart.html")
    public String toCart(){
        return "mall/product/cart";
    }
    /**
     * 按一级分类查找商品
     *
     * @param cid
     * @param pageNo
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("/category.do")
    public ResultBean<List<Product>> getCategoryProduct(int cid, int pageNo, int pageSize) {
        Pageable pageable = new PageRequest(pageNo, pageSize);
        List<Product> products = productService.findByCid(cid, pageable);
        return new ResultBean<>(products);
    }
    /**
     * 按二级分类查找商品
     *
     * @param csId
     * @param pageNo
     * @param pageSize
     * @return
     */
    @ResponseBody
    @RequestMapping("/categorySec.do")
    public ResultBean<List<Product>> getCategorySecProduct(int csId, int pageNo, int pageSize) {
        Pageable pageable = new PageRequest(pageNo, pageSize);
        List<Product> products = productService.findByCsid(csId, pageable);
        return new ResultBean<>(products);
    }
    /**
     * 根据一级分类查询它所有的二级分类
     * @param cid
     * @return
     */
    @ResponseBody
    @RequestMapping("/getCategorySec.do")
    public ResultBean<List<Classification>> getCategorySec(int cid){
        List<Classification> list = classificationService.findByParentId(cid);
        return new ResultBean<>(list);
    }
    /**
     * 加购物车
     *
     * @param productId
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/addCart.do")
    public ResultBean<Boolean> addToCart(int productId, HttpServletRequest request) throws Exception {
        shopCartService.addCart(productId, request);
        return new ResultBean<>(true);
    }
    /**
     * 移除购物车
     *
     * @param productId
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/delCart.do")
    public ResultBean<Boolean> delToCart(int productId, HttpServletRequest request) throws Exception {
        shopCartService.remove(productId, request);
        return new ResultBean<>(true);
    }
    /**
     * 查看购物车商品
     * @param request
     * @return
     */
    @ResponseBody
    @RequestMapping("/listCart.do")
    public ResultBean<List<OrderItem>> listCart(HttpServletRequest request) throws Exception {
        List<OrderItem> orderItems = shopCartService.listCart(request);
        return new ResultBean<>(orderItems);
    }
}

UserController

package priv.jesse.mall.web.user;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import priv.jesse.mall.entity.User;
import priv.jesse.mall.entity.pojo.ResultBean;
import priv.jesse.mall.service.UserService;
import priv.jesse.mall.service.exception.LoginException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;
@Controller
@RequestMapping("/user")
public class UserController {
    @Autowired
    private UserService userService;
    /**
     * 打开注册页面
     *
     * @return
     */
    @RequestMapping("/toRegister.html")
    public String toRegister() {
        return "mall/user/register";
    }
    /**
     * 打开登录页面
     *
     * @return
     */
    @RequestMapping("/toLogin.html")
    public String toLogin() {
        return "mall/user/login";
    }
    /**
     * 登录
     *
     * @param username
     * @param password
     */
    @RequestMapping("/login.do")
    public void login(String username,
                      String password,
                      HttpServletRequest request,
                      HttpServletResponse response) throws IOException {
        User user = userService.checkLogin(username, password);
        if (user != null) {
            //登录成功 重定向到首页
            request.getSession().setAttribute("user", user);
            response.sendRedirect("/mall/index.html");
        } else {
            throw new LoginException("登录失败! 用户名或者密码错误");
        }
    }
    /**
     * 注册
     */
    @RequestMapping("/register.do")
    public void register(String username,
                         String password,
                         String name,
                         String phone,
                         String email,
                         String addr,
                         HttpServletResponse response) throws IOException {
        User user = new User();
        user.setUsername(username);
        user.setPhone(phone);
        user.setPassword(password);
        user.setName(name);
        user.setEmail(email);
        user.setAddr(addr);
        userService.create(user);
        // 注册完成后重定向到登录页面
        response.sendRedirect("/mall/user/toLogin.html");
    }
    /**
     * 登出
     */
    @RequestMapping("/logout.do")
    public void logout(HttpServletRequest request, HttpServletResponse response) throws IOException {
        request.getSession().removeAttribute("user");
        response.sendRedirect("/mall/index.html");
    }
    /**
     * 验证用户名是否唯一
     * @param username
     * @return
     */
    @ResponseBody
    @RequestMapping("/checkUsername.do")
    public ResultBean<Boolean> checkUsername(String username){
        List<User> users = userService.findByUsername(username);
        if (users==null||users.isEmpty()){
            return new ResultBean<>(true);
        }
        return new ResultBean<>(false);
    }
    /**
     * 如发生错误 转发到这页面
     *
     * @param response
     * @param request
     * @return
     */
    @RequestMapping("/error.html")
    public String error(HttpServletResponse response, HttpServletRequest request) {
        return "error";
    }
}

login.html

<!DOCTYPE html>
<html lang='cn' xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>欢迎登录商城后台管理</title>
    <meta content="width=device-width, initial-scale=1.0" name="viewport"/>
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <script>
        if (window != top)
            top.location.href = location.href;
    </script>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/bootstrap-responsive.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style-metro.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style-responsive.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/default.css}" rel="stylesheet" type="text/css" id="style_color"/>
    <link th:href="@{/css/uniform.default.css}" rel="stylesheet" type="text/css"/>
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL STYLES -->
    <link th:href="@{/css/login.css}" rel="stylesheet" type="text/css"/>
    <!-- END PAGE LEVEL STYLES -->
    <link rel="shortcut icon" th:href="@{/image/favicon.ico}"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="login">
<div class="logo">
    <img th:src="@{/image/logo-big.png}" alt=""/>
</div>
<!-- BEGIN LOGIN -->
<div class="content">
    <!-- BEGIN LOGIN FORM -->
    <form class="form-vertical login-form" action="login.do" method="post">
        <h3 class="form-title"> 请登录</h3>
        <div class="control-group">
            <!--ie8, ie9 does not support html5 placeholder, so we just show field title for that-->
            <label class="control-label visible-ie8 visible-ie9">用户名</label>
            <div class="controls">
                <div class="input-icon left">
                    <i class="icon-user"></i>
                    <input class="m-wrap placeholder-no-fix" type="text" placeholder="用户名" name="username"/>
                </div>
            </div>
        </div>
        <div class="control-group">
            <label class="control-label visible-ie8 visible-ie9">密码</label>
            <div class="controls">
                <div class="input-icon left">
                    <i class="icon-lock"></i>
                    <input class="m-wrap placeholder-no-fix" type="password" placeholder="密码" name="password"/>
                </div>
            </div>
        </div>
        <div class="form-actions">
            <button type="reset" class="btn red ">
                重置
            </button>
            <button id='login' type="submit" class="btn green pull-right">
                登录
            </button>
        </div>
    </form>
    <!-- END LOGIN FORM -->
</div>
<!-- END LOGIN -->
<!-- BEGIN COPYRIGHT -->
<div class="copyright">
    2021-2021
</div>
<!-- END COPYRIGHT -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<script th:src="@{/js/jquery-1.10.1.min.js}" type="text/javascript"></script>
<script th:src="@{/js/bootstrap.min.js}" type="text/javascript"></script>
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script th:src="@{/js/app.js}" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
    jQuery(document).ready(function () {
        App.init();
        //$("#login").click(login);
    });
    function login() {
        var username = $("[name='username']").val();
        var password = $("[name='password']").val();
        if (!username || !password) {
            alert("用户名密码不能为空!");
            return;
        }
        $.ajax({
            type: "post",
            url: "login.do",
            data: {"username": username, "pwd": password},
            success: function (data) {
                console.log(data);
                if (data.state == 0) {
                    window.location.href = "toIndex.html";
                } else {
                    alert(data.message);
                }
            }
        });
    }
</script>
<!-- END JAVASCRIPTS -->
<!-- END BODY -->
</body>
</html>

index.html

<!DOCTYPE html>
<html lang='cn' xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="utf-8"/>
    <title>商城后台管理</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport"/>
    <meta content="" name="description"/>
    <meta content="" name="author"/>
    <!-- BEGIN GLOBAL MANDATORY STYLES -->
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/bootstrap-responsive.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style-metro.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/style-responsive.css}" rel="stylesheet" type="text/css"/>
    <link th:href="@{/css/default.css}" rel="stylesheet" type="text/css" id="style_color"/>
    <link th:href="@{/css/uniform.default.css}" rel="stylesheet" type="text/css"/>
    <!-- END GLOBAL MANDATORY STYLES -->
    <!-- BEGIN PAGE LEVEL STYLES -->
    <style type="text/css">
        body {
            background-color: #3d3d3d !important;
        }
    </style>
    <!-- END PAGE LEVEL STYLES -->
    <link rel="shortcut icon" th:href="@{/image/favicon.ico}"/>
</head>
<!-- END HEAD -->
<!-- BEGIN BODY -->
<body class="page-header-fixed page-footer-fixed page-sidebar-fixed">
<!-- BEGIN HEADER -->
<div class="header navbar navbar-inverse navbar-fixed-top">
    <!-- BEGIN TOP NAVIGATION BAR -->
    <div class="navbar-inner">
        <div class="container-fluid">
            <!-- BEGIN LOGO -->
            <a class="brand" href="/mall/" title="回到首页" style="margin-left: 10px;">
                <!--<img src="media/image/logo.png" class="" alt="logo"/>-->
                <i class="fa fa-cubes"></i>
                <b>商城后台管理系统</b>
            </a>
            <!-- END LOGO -->
            <!-- BEGIN RESPONSIVE MENU TOGGLER -->
            <a href="javascript:;" class="btn-navbar collapsed" data-toggle="collapse" data-target=".nav-collapse">
                <img th:src="@{/image/menu-toggler.png}" alt=""/>
            </a>
            <!-- END RESPONSIVE MENU TOGGLER -->
            <!-- BEGIN TOP NAVIGATION MENU -->
            <ul class="nav pull-right">
                <!-- BEGIN USER LOGIN DROPDOWN -->
                <li class="dropdown user ">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="fa fa-user-circle"></i>
                        <span th:text="${session.login_user.username}"></span>
                        <i class="fa fa-caret-down"></i>
                    </a>
                    <ul class="dropdown-menu ">
                        <!--
                            <li class="divider"></li>
                        -->
                        <li><a href="javascript:logout();"><i class="fa fa-key"></i>注销</a></li>
                    </ul>
                </li>
                <!-- END USER LOGIN DROPDOWN -->
            </ul>
            <!-- END TOP NAVIGATION MENU -->
        </div>
    </div>
    <!-- END TOP NAVIGATION BAR -->
</div>
<!-- END HEADER -->
<!-- BEGIN CONTAINER -->
<div class="page-container">
    <!-- BEGIN SIDEBAR -->
    <div class="page-sidebar nav-collapse collapse">
        <!-- BEGIN SIDEBAR MENU -->
        <ul class="page-sidebar-menu">
            <li>
                <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
                <div class="sidebar-toggler hidden-phone" style="color: #FFFFFF;text-align: center;background: #3d3d3d;">
                    <i class="fa fa-2x fa-bars"></i>
                </div>
                <!-- BEGIN SIDEBAR TOGGLER BUTTON -->
            </li>
            <li>
                <!-- BEGIN RESPONSIVE QUICK SEARCH FORM -->
                <form class="sidebar-search">
                    <div class="input-box">
                        <a href="javascript:;" class="remove"></a>
                        <input type="text" placeholder="搜索..."/>
                        <input type="button" class="submit" value=" "/>
                    </div>
                </form>
                <!-- END RESPONSIVE QUICK SEARCH FORM -->
            </li>
            <li class="start active " id="user">
                <a href="javascript:changePage('user');">
                    <i class="fa fa-user-circle"></i>
                    <span class="title">用户管理</span>
                    <span class="selected"></span>
                </a>
            </li>
            <li class="" id="category">
                <a href="#">
                    <i class="fa fa-object-group"></i>
                    <span class="title">分类管理</span>
                    <span class="arrow "></span>
                </a>
                <ul class="sub-menu">
                    <li id="category_1">
                        <a href="javascript:changePage('category');">
                            <i class="fa fa-list"></i>
                            一级分类
                        </a>
                    </li>
                    <li id="categorysec">
                        <a href="javascript:changePage('categorySec');">
                            <i class="fa fa-list"></i>
                            二级分类
                        </a>
                    </li>
                </ul>
            </li>
            <li class="" id="order">
                <a href="javascript:changePage('order');">
                    <i class="fa fa-file-text"></i>
                    <span class="title">订单管理</span>
                </a>
            </li>
            <li class="last" id="product">
                <a href="javascript:changePage('product');">
                    <i class="fa fa-shopping-bag"></i>
                    <span class="title">商品管理</span>
                </a>
            </li>
        </ul>
        <!-- END SIDEBAR MENU -->
    </div>
    <!-- END SIDEBAR -->
    <!-- BEGIN PAGE -->
    <div id="content" class="page-content">
        <iframe id="mainFrame" frameborder="0" src=""></iframe>
    </div>
    <!-- END PAGE -->
</div>
<!-- END CONTAINER -->
<!-- BEGIN FOOTER -->
<div class="footer">
    <div class="footer-inner" style="width: 100%;text-align: center;">
        2017 &copy; Jesse
        <div class="footer-tools">
        <span class="go-top" title="回到顶部">
        <i class="fa fa-chevron-up"></i>
        </span>
        </div>
    </div>
</div>
<!-- END FOOTER -->
<!-- BEGIN JAVASCRIPTS(Load javascripts at bottom, this will reduce page load time) -->
<!-- BEGIN CORE PLUGINS -->
<script th:src="@{/js/jquery-1.10.1.min.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery-migrate-1.2.1.min.js}" type="text/javascript"></script>
<!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
<script th:src="@{/js/jquery-ui-1.10.1.custom.min.js}" type="text/javascript"></script>
<script th:src="@{/js/bootstrap.min.js}" type="text/javascript"></script>
<!--[if lt IE 9]>
<script th:src="media/js/excanvas.min.js}"></script>
<script th:src="media/js/respond.min.js}"></script>
<![endif]-->
<script th:src="@{/js/jquery.slimscroll.min.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery.blockui.min.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery.cookie.min.js}" type="text/javascript"></script>
<script th:src="@{/js/jquery.uniform.min.js}" type="text/javascript"></script>
<!-- END CORE PLUGINS -->
<!-- BEGIN PAGE LEVEL PLUGINS -->
<!--<script th:src="media/js/jquery.vmap.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.vmap.russia.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.vmap.world.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.vmap.europe.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.vmap.germany.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.vmap.usa.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.vmap.sampledata.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.flot.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.flot.resize.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.pulsate.min.js" type="text/javascript"></script>
<script th:src="@{/js/date.js" type="text/javascript"></script>
<script th:src="@{/js/daterangepicker.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.gritter.js" type="text/javascript"></script>
<script th:src="@{/js/fullcalendar.min.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.easy-pie-chart.js" type="text/javascript"></script>
<script th:src="@{/js/jquery.sparkline.min.js" type="text/javascript"></script>  -->
<!-- END PAGE LEVEL PLUGINS -->
<!-- BEGIN PAGE LEVEL SCRIPTS -->
<script th:src="@{/js/app.js}" type="text/javascript"></script>
<script th:src="@{/js/index.js}" type="text/javascript"></script>
<!-- END PAGE LEVEL SCRIPTS -->
<script>
    jQuery(document).ready(function () {
        App.init(); // initlayout and core plugins
//       Index.init();
//
//       Index.initJQVMAP(); // init index page's custom scripts
//
//       Index.initCalendar(); // init index page's custom scripts
//
//       Index.initCharts(); // init index page's custom scripts
//
//       Index.initChat();
//
//       Index.initMiniCharts();
//
//       Index.initDashboardDaterange();
//
//       Index.initIntro();
    });
    function changePage(page) {
        $(".page-sidebar-menu li").removeClass("active");
        if ('categorySec' == page) {
            $("#category").addClass("active").find("a").eq(0).append($('<span class="selected"></span>'));
            $("#categorysec").addClass("active");
            $("#mainFrame").attr("src", "classification/toList.html?type=2");
            return;
        } else if ('category' == page) {
            $("#category").addClass("active").find("a").eq(0).append($('<span class="selected"></span>'));
            $("#category_1").addClass("active");
            $("#mainFrame").attr("src", "classification/toList.html?type=1");
            return;
        } else {
            $("#" + page).addClass("active").find("a").eq(0).append($('<span class="selected"></span>'));
        }
        $("#mainFrame").attr("src", page + "/toList.html");
    }
    changePage("user");
    function logout() {
        if (confirm("确定退出登录?")) {
            window.location.href = "logout.do";
        }
    }
</script>
<!-- END JAVASCRIPTS -->
</body>
<!-- END BODY -->
</html>

edit.html

<!DOCTYPE html >
<html lang='cn' xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="UTF-8"/>
    <title>用户列表</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/bootstrap-responsive.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/style-metro.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/style-responsive.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/default.css}" rel="stylesheet" type="text/css" id="style_color" />
    <link th:href="@{/css/uniform.default.css}" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" th:href="@{/image/favicon.ico}" />
  </head>
  <body>
    <div class="container-fluid">
      <div class="row-fluid">
        <h3 class="page-title"><i class="fa fa-user-circle"></i>用户管理</h3>
        <ul class="breadcrumb">
          <li>
            <a href="list.html"><i class="fa fa-home"></i>用户管理</a>
            <i class="fa fa-angle-right"></i>
          </li>
          <li>
            <a href="#">编辑用户</a>
          </li>
        </ul>
      </div>
      <div class="row-fluid">
        <div class="portlet box green">
          <div class="portlet-title">
            <div class="caption">
              <i class="fa fa-reorder"></i>
              编辑用户信息
            </div>
          </div>
          <div class="portlet-body">
            <form class="form-horizontal" >
              <div class="control-group">
                <label class="control-label">用户ID:</label>
                <div class="controls">
                  <input name="id" th:value="${user.id }" readonly="readonly" type="text" class="m-wrap media" />
                  <span class="help-inline"></span>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">用户名称:</label>
                <div class="controls">
                  <input name="username" th:value="${user.username }" type="text" class="m-wrap media" />
                  <span class="help-inline">username</span>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">真实姓名:</label>
                <div class="controls">
                  <input name="name" th:value="${user.name }" type="text" class="m-wrap media" />
                  <span class="help-inline">name</span>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">电话号码:</label>
                <div class="controls">
                  <input name="phone" th:value="${user.phone }" type="text" class="m-wrap media" />
                  <span class="help-inline">phone</span>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">密码:</label>
                <div class="controls">
                  <input name="password" th:value="${user.password }" type="text" class="m-wrap media" />
                  <span class="help-inline">password</span>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">邮箱:</label>
                <div class="controls">
                  <input name="email" th:value="${user.email }" type="text" class="m-wrap media" />
                  <span class="help-inline">email</span>
                </div>
              </div>
              <div class="control-group">
                <label class="control-label">地址:</label>
                <div class="controls">
                  <textarea name="addr" class="large m-wrap" rows="3" th:text="${user.addr }"></textarea>
                </div>
              </div>
              <div class="form-actions">
                <button type="button" onclick="update()" class="btn blue"><i class="fa fa-check"></i>确定</button>&emsp;
                <button type="reset" class="btn green"><i class="fa fa-mail-reply"></i>重置</button>&emsp;
                <button type="button" id="back" class="btn"><i class="fa fa-times"></i>返回</button>
              </div>
            </form>
          </div>
        </div>
      </div>
    </div>
    <script th:src="@{/js/jquery-1.10.1.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery-migrate-1.2.1.min.js}" type="text/javascript"></script>
    <!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script th:src="@{/js/jquery-ui-1.10.1.custom.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/bootstrap.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.slimscroll.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.blockui.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.cookie.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.uniform.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/app.js}" type="text/javascript"></script>
    <script type="text/javascript">
            //<![CDATA[
      $(function(){
        $("#back").click(function(){
          history.back();
        });
      });
      function update(){
        if(!confirm("确定更新改用户信?")){
          return;
        }
        $.ajax({
                  cache: true,
                  type: "POST",
                  url:"update.do",
                  data:$('.form-horizontal').serialize(),// 你的formid
                  async: false,
                  error: function(request) {
                      alert("Connection error");
                  },
                  success: function(result) {
                      if(result.state==0){
                        alert("修改成功!");
                      }else{
                        alert(result.message);
                      }
                  }
              });
      }
//      ]]>
    </script>
  </body>
</html>

list.html

<!DOCTYPE html>
<html lang='cn' xmlns:th="http://www.thymeleaf.org">
  <head>
    <meta charset="UTF-8"/>
    <title>用户列表</title>
    <meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" name="viewport" />
    <meta content="" name="description" />
    <meta content="" name="author" />
    <link th:href="@{/css/bootstrap.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/bootstrap-responsive.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/font-awesome.min.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/style-metro.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/style.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/style-responsive.css}" rel="stylesheet" type="text/css" />
    <link th:href="@{/css/default.css}" rel="stylesheet" type="text/css" id="style_color" />
    <link th:href="@{/css/uniform.default.css}" rel="stylesheet" type="text/css" />
        <link th:href="@{/css/pagination.css}" rel="stylesheet" type="text/css" />
    <link rel="shortcut icon" th:href="@{/image/favicon.ico}" />
  </head>
  <body>
    <div class="container-fluid">
      <div class="row-fluid">
        <h3 class="page-title"><i class="fa fa-user-circle"></i>用户管理</h3>
        <ul class="breadcrumb">
          <li>
            <a href="#"><i class="fa fa-home"></i>用户管理</a>
            <i class="fa fa-angle-right"></i>
          </li>
          <li>
            <a href="#">用户列表</a>
          </li>
        </ul>
      </div>
      <div class="row-fluid">
        <div class="portlet box blue">
          <div class="portlet-title">
            <div class="caption">
              <i class="fa fa-reorder"></i>
              用户列表
            </div>
          </div>
          <div class="portlet-body">
            <table id="userTable" class="table table-bordered table-striped">
              <thead>
                <tr>
                  <th>序号</th>
                  <th>用户名</th>
                  <th>真实姓名</th>
                  <th>操作</th>
                </tr>
              </thead>
              <tbody>
                <!-- <tr>
                  <td>001</td>
                  <td>aaa</td>
                  <td>tom</td>
                  <td>
                    <button class="btn mini green" οnclick="edit(001)"><i class="fa fa-edit"></i> 编辑</button>&emsp;
                    <button class="btn mini red" οnclick="del(002)"><i class="fa fa-trash"></i> 删除</button>
                  </td>
                </tr> -->
              </tbody>
            </table>
            <div id="Pagination" class="pagination align_right"><!-- 这里显示分页 --></div>
          </div>
        </div>
      </div>
    </div>
    <script th:src="@{/js/jquery-1.10.1.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery-migrate-1.2.1.min.js}" type="text/javascript"></script>
    <!-- IMPORTANT! Load jquery-ui-1.10.1.custom.min.js before bootstrap.min.js to fix bootstrap tooltip conflict with jquery ui tooltip -->
    <script th:src="@{/js/jquery-ui-1.10.1.custom.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/bootstrap.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.slimscroll.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.blockui.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.cookie.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/jquery.uniform.min.js}" type="text/javascript"></script>
    <script th:src="@{/js/app.js}" type="text/javascript"></script>
        <script th:src="@{/js/jquery.pagination.js}" type="text/javascript"></script>
    <script th:inline="javascript" type="text/javascript">
      //<![CDATA[
      function edit(id){
        $("#mainFrame",window.parent.document).attr("src","user/toEdit.html?id="+id);
      }
      function del(id,btn){
        if(!confirm("是否删除id为"+id+"的用户?")){
          return;
        }
        $.ajax({
          url:"del.do?id="+id,
          type:"get",
          success:function(result){
            if(result.state==0){
              if(result.data==true){
                alert("删除成功!");
                $(btn).parent().parent().fadeOut();
              }else{
                alert("删除失败!");
              }
            }else{
              alert(result.message);
            }
          }
        });
      }
      var pagetotal;
      $(function(){
        $.ajax({
          url:"getTotal.do",
          type:"get",
          success:function(result){
            if(result.state==0){
              pagetotal=result.data;
              $("#Pagination").pagination(pagetotal, {
                num_edge_entries: 1, //边缘页数
                num_display_entries: 5, //主体页数
                callback: pageselectCallback,
                items_per_page: 7, //每页显示1项
                prev_text: "前一页",
                next_text: "后一页"
              });
            }else{
              alert(result.message);
            }
          }
        });
      });
      function pageselectCallback(page_index, jq){
        $.ajax({
          type:"get",
          url:"list.do?pageindex="+page_index,
          success:function(result){
            if(result.state==0){
              showList(result.data);
            }else{
              alert(result.message);
            }
          }
        });
      }
      function showList(data){
        //清空表
        var tbody = $("#userTable tbody").eq(0);
        tbody.html("");
        for(var i=0;i<data.length;i++){
          var tr = $("<tr style='display:none;'></tr>");
          tr.append($("<td></td>").text(data[i].id));
          tr.append($("<td></td>").text(data[i].username));
          tr.append($("<td></td>").text(data[i].name));
          tr.append($("<td></td>")
              .append($('<button style="margin-right:20px;" class="btn mini green" οnclick="edit('+data[i].id+')"><i class="fa fa-edit"></i> 编辑</button>'))
              .append($('<button class="btn mini red" οnclick="del('+data[i].id+',this)"><i class="fa fa-trash"></i> 删除</button>')));
          tbody.append(tr);
          tr.fadeIn();
        }
      }
      //]]>
    </script>
  </body>
</html>

common.html

<!DOCTYPE html>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>Title</title>
</head>
<body>
<!--
    这里包含了每个页面的公共模块
-->
<!--头部 导航条模块-->
<div class="layui-header header" th:fragment="head">
    <script>
        //        <![CDATA[
        var layer;
        layui.use(["layer","element"],function () {
            layer = layui.layer;
        });
        //JavaScript代码区域
        //        ]]>
    </script>
    <div class="layui-main">
        <a class="logo" href="/mall/index.html">
            <img th:src="@{/image/logo.png}"/>
        </a>
        <!-- 头部区域(可配合layui已有的水平导航) -->
        <!--<ul class="layui-nav layui-layout-left">-->
        <!---->
        <!--</ul>-->
        <ul class="layui-nav layui-layout-right">
            <li class="layui-nav-item" style="color:#393D49;">
                <a href="javascript:;">分类</a>
                <dl class="layui-nav-child" id="category">
                </dl>
                <script>
                    //                    <![CDATA[
                    //加载分类
                    $.get("/mall/admin/classification/list.do?type=1&pageindex=-1", function (data) {
                        if (data.state == 0) {
                            var list = $("#category");
                            $(data.data).each(function (index, item) {
                                var cat = $("<dd><a href='/mall/product/category.html?cid="+item.id+"'>" + item.cname + "</a></dd>");
                                list.append(cat);
                            })
                        } else {
                            alert(data.message);
                        }
                    });
                    //                    ]]>
                </script>
            </li>
            <li class="layui-nav-item">
                <a href="javascript:;">
                    <i class="fa fa-user-circle"></i>&nbsp;
                    <span th:if="${session.user == null}">请登陆</span>
                    <span th:if="${session.user != null}" th:text="'欢迎您!&nbsp;' + ${session.user.username}">请登陆</span>
                </a>
                <dl class="layui-nav-child">
                    <dd th:if="${session.user != null}"><a href="/mall/user/logout.do"><i class="fa fa-sign-out"></i> 退出登录</a></dd>
                    <dd th:if="${session.user != null}"><a href="/mall/order/toList.html"><i class="fa fa-list"></i> 我的订单</a></dd>
                    <dd th:if="${session.user != null}"><a href="/mall/product/toCart.html"><i class="fa fa-shopping-cart"></i> 购物车</a></dd>
                    <dd th:if="${session.user == null}"><a href="/mall/user/toLogin.html"><i class="fa fa-sign-in"></i> 登录</a></dd>
                    <dd th:if="${session.user == null}"><a href="/mall/user/toRegister.html"><i class="fa fa-user-plus"></i> 注册</a></dd>
                </dl>
            </li>
            <!--<li class="layui-nav-item"><a href="">退了</a></li>-->
        </ul>
    </div>
</div>
<!--底部模块-->
<div class="footer footer-index" th:fragment="foot">
    <hr style="color: #c2c2c2;" />
    <!-- 底部固定区域 -->
    ©2021-2021
    <a href="/mall/admin/toLogin.html">后台管理系统</a>
</div>
</body>
</html>

pom.xml

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
  <modelVersion>4.0.0</modelVersion>
  <groupId>priv.jesse</groupId>
  <artifactId>mall</artifactId>
  <version>1.0</version>
  <packaging>jar</packaging>
  <name>mall</name>
  <description>shopping mall project</description>
  <parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>1.5.8.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
  </parent>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
    <java.version>1.8</java.version>
  </properties>
  <dependencies>
        <!--mysql-->
    <dependency>
      <groupId>mysql</groupId>
      <artifactId>mysql-connector-java</artifactId>
      <version>8.0.13</version>
            <scope>runtime</scope>
    </dependency>
        <!--H2-->
        <dependency>
            <groupId>com.h2database</groupId>
            <artifactId>h2</artifactId>
            <scope>runtime</scope>
        </dependency>
        <!--spring data jpa 数据持久化组件-->
        <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-data-jpa</artifactId>
        </dependency>
    <!--druid连接池 mybatis-->
    <dependency>
      <groupId>com.alibaba</groupId>
      <artifactId>druid-spring-boot-starter</artifactId>
      <version>1.1.3</version>
    </dependency>
        <!--aop 切面-->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-aop</artifactId>
    </dependency>
        <!--web -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-web</artifactId>
    </dependency>
    <!--html模板引擎 类似jsp-->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-starter-thymeleaf</artifactId>
    </dependency>
        <dependency>
            <groupId>commons-lang</groupId>
            <artifactId>commons-lang</artifactId>
            <version>2.6</version>
        </dependency>
        <!--热加载代码方便调试用 -->
    <dependency>
      <groupId>org.springframework.boot</groupId>
      <artifactId>spring-boot-devtools</artifactId>
      <scope>runtime</scope>
      <optional>true</optional>
    </dependency>
        <!--测试框架-->
    <dependency>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-starter-test</artifactId>
            <scope>test</scope>
        </dependency>
  </dependencies>
  <build>
    <plugins>
            <!--打包插件-->
      <plugin>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-maven-plugin</artifactId>
      </plugin>
            <plugin>
                <groupId>com.spotify</groupId>
                <artifactId>dockerfile-maven-plugin</artifactId>
                <version>1.4.9</version>
                <executions>
                    <execution>
                        <id>default</id>
                        <goals>
                            <goal>build</goal>
                            <goal>push</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <repository>skywa1ker/mall</repository>
                    <tag>${project.version}</tag>
                    <buildArgs>
                        <JAR_FILE>mall-1.0.jar</JAR_FILE>
                        <NAME>mall</NAME>
                        <VERSION>1.0</VERSION>
                    </buildArgs>
                </configuration>
            </plugin>
    </plugins>
  </build>
</project>


四、其他


1.其他系统实现


JavaWeb系统系列实现

Java+JSP实现图书管理系统

Java+JSP实现学生信息管理系统

Java+Servlet+JSP实现学生成绩管理系统

Java+Servlet+JSP实现宠物诊所管理系统

Java+SSM+Easyui实现网上考试系统

Java+Springboot+H-ui实现营销管理系统

Java+Springboot+Mybatis+Bootstrap实现网上商城系统


JavaSwing系统系列实现

Java+Swing实现斗地主游戏

Java+Swing实现图书管理系统

Java+Swing实现医院管理系统

Java+Swing实现仓库管理系统

Java+Swing实现考试管理系统

Java+Swing实现通讯录管理系统

Java+Swing实现学生信息管理系统

Java+Swing实现学生宿舍管理系统

Java+Swing实现学生选课管理系统

Java+Swing实现学生成绩管理系统

Java+Swing实现学校教材管理系统

Java+Swing实现学校教务管理系统

Java+Swing实现企业人事管理系统

Java+Swing实现电子相册管理系统

Java+Swing实现自助取款机(ATM)系统

Java+Swing实现超市管理系统-TXT存储信息

Java+Swing实现宠物商店管理系统-TXT存储信息


相关实践学习
如何在云端创建MySQL数据库
开始实验后,系统会自动创建一台自建MySQL的 源数据库 ECS 实例和一台 目标数据库 RDS。
全面了解阿里云能为你做什么
阿里云在全球各地部署高效节能的绿色数据中心,利用清洁计算为万物互联的新世界提供源源不断的能源动力,目前开服的区域包括中国(华北、华东、华南、香港)、新加坡、美国(美东、美西)、欧洲、中东、澳大利亚、日本。目前阿里云的产品涵盖弹性计算、数据库、存储与CDN、分析与搜索、云通信、网络、管理与监控、应用服务、互联网中间件、移动服务、视频服务等。通过本课程,来了解阿里云能够为你的业务带来哪些帮助 &nbsp; &nbsp; 相关的阿里云产品:云服务器ECS 云服务器 ECS(Elastic Compute Service)是一种弹性可伸缩的计算服务,助您降低 IT 成本,提升运维效率,使您更专注于核心业务创新。产品详情: https://www.aliyun.com/product/ecs
相关文章
|
11天前
|
NoSQL Java 关系型数据库
Liunx部署java项目Tomcat、Redis、Mysql教程
本文详细介绍了如何在 Linux 服务器上安装和配置 Tomcat、MySQL 和 Redis,并部署 Java 项目。通过这些步骤,您可以搭建一个高效稳定的 Java 应用运行环境。希望本文能为您在实际操作中提供有价值的参考。
72 26
|
7天前
|
存储 JavaScript 前端开发
基于 SpringBoot 和 Vue 开发校园点餐订餐外卖跑腿Java源码
一个非常实用的校园外卖系统,基于 SpringBoot 和 Vue 的开发。这一系统源于黑马的外卖案例项目 经过站长的进一步改进和优化,提供了更丰富的功能和更高的可用性。 这个项目的架构设计非常有趣。虽然它采用了SpringBoot和Vue的组合,但并不是一个完全分离的项目。 前端视图通过JS的方式引入了Vue和Element UI,既能利用Vue的快速开发优势,
52 13
|
15天前
|
JavaScript 安全 Java
java版药品不良反应智能监测系统源码,采用SpringBoot、Vue、MySQL技术开发
基于B/S架构,采用Java、SpringBoot、Vue、MySQL等技术自主研发的ADR智能监测系统,适用于三甲医院,支持二次开发。该系统能自动监测全院患者药物不良反应,通过移动端和PC端实时反馈,提升用药安全。系统涵盖规则管理、监测报告、系统管理三大模块,确保精准、高效地处理ADR事件。
|
20天前
|
缓存 Java 数据库连接
深入探讨:Spring与MyBatis中的连接池与缓存机制
Spring 与 MyBatis 提供了强大的连接池和缓存机制,通过合理配置和使用这些机制,可以显著提升应用的性能和可扩展性。连接池通过复用数据库连接减少了连接创建和销毁的开销,而 MyBatis 的一级缓存和二级缓存则通过缓存查询结果减少了数据库访问次数。在实际应用中,结合具体的业务需求和系统架构,优化连接池和缓存的配置,是提升系统性能的重要手段。
35 4
|
20天前
|
SQL Java 数据库连接
spring和Mybatis的各种查询
Spring 和 MyBatis 的结合使得数据访问层的开发变得更加简洁和高效。通过以上各种查询操作的详细讲解,我们可以看到 MyBatis 在处理简单查询、条件查询、分页查询、联合查询和动态 SQL 查询方面的强大功能。熟练掌握这些操作,可以极大提升开发效率和代码质量。
31 3
|
25天前
|
Java 数据库连接 数据库
spring和Mybatis的逆向工程
通过本文的介绍,我们了解了如何使用Spring和MyBatis进行逆向工程,包括环境配置、MyBatis Generator配置、Spring和MyBatis整合以及业务逻辑的编写。逆向工程极大地提高了开发效率,减少了重复劳动,保证了代码的一致性和可维护性。希望这篇文章能帮助你在项目中高效地使用Spring和MyBatis。
15 1
|
25天前
|
关系型数据库 MySQL Java
MySQL索引优化与Java应用实践
【11月更文挑战第25天】在大数据量和高并发的业务场景下,MySQL数据库的索引优化是提升查询性能的关键。本文将深入探讨MySQL索引的多种类型、优化策略及其在Java应用中的实践,通过历史背景、业务场景、底层原理的介绍,并结合Java示例代码,帮助Java架构师更好地理解并应用这些技术。
25 2
|
1月前
|
监控 前端开发 Java
【技术开发】接口管理平台要用什么技术栈?推荐:Java+Vue3+Docker+MySQL
该文档介绍了基于Java后端和Vue3前端构建的管理系统的技术栈及功能模块,涵盖管理后台的访问、登录、首页概览、API接口管理、接口权限设置、接口监控、计费管理、账号管理、应用管理、数据库配置、站点配置及管理员个人设置等内容,并提供了访问地址及操作指南。
|
1月前
|
分布式计算 关系型数据库 MySQL
SpringBoot项目中mysql字段映射使用JSONObject和JSONArray类型
SpringBoot项目中mysql字段映射使用JSONObject和JSONArray类型 图像处理 光通信 分布式计算 算法语言 信息技术 计算机应用
54 8
|
1月前
|
XML Java 数据库连接
SpringBoot集成Flowable:打造强大的工作流管理系统
在企业级应用开发中,工作流管理是一个核心组件,它能够帮助我们定义、执行和管理业务流程。Flowable是一个开源的工作流和业务流程管理(BPM)平台,它提供了强大的工作流引擎和建模工具。结合SpringBoot,我们可以快速构建一个高效、灵活的工作流管理系统。本文将探讨如何将Flowable集成到SpringBoot应用中,并展示其强大的功能。
187 1

推荐镜像

更多
下一篇
DataWorks