• 【SSM】我的第一个SSM整合项目


    1.准备工作:导包,连接数据库。

    <dependencies>
            
            <dependency>
                <groupId>junitgroupId>
                <artifactId>junitartifactId>
                <version>4.13.2version>
                <scope>testscope>
            dependency>
            
            <dependency>
                <groupId>mysqlgroupId>
                <artifactId>mysql-connector-javaartifactId>
                <version>8.0.29version>
            dependency>
            
            <dependency>
                <groupId>com.mchangegroupId>
                <artifactId>c3p0artifactId>
                <version>0.9.5.2version>
            dependency>
            
            <dependency>
                <groupId>javax.servletgroupId>
                <artifactId>servlet-apiartifactId>
                <version>2.5version>
            dependency>
            <dependency>
                <groupId>javax.servlet.jspgroupId>
                <artifactId>jsp-apiartifactId>
                <version>2.2version>
            dependency>
            <dependency>
                <groupId>javax.servletgroupId>
                <artifactId>jstlartifactId>
                <version>1.2version>
            dependency>
            
            <dependency>
                <groupId>org.mybatisgroupId>
                <artifactId>mybatisartifactId>
                <version>3.5.9version>
            dependency>
            <dependency>
                <groupId>org.mybatisgroupId>
                <artifactId>mybatis-springartifactId>
                <version>2.0.7version>
            dependency>
            
            <dependency>
                <groupId>org.springframeworkgroupId>
                <artifactId>spring-jdbcartifactId>
                <version>5.3.22version>
            dependency>
            <dependency>
                <groupId>org.springframeworkgroupId>
                <artifactId>spring-webmvcartifactId>
                <version>5.3.1version>
            dependency>
            <dependency>
                <groupId>org.projectlombokgroupId>
                <artifactId>lombokartifactId>
                <version>1.18.24version>
            dependency>
            
            <dependency>
                <groupId>ch.qos.logbackgroupId>
                <artifactId>logback-classicartifactId>
                <version>1.2.3version>
            dependency>
        dependencies>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70

    数据库创建表

    CREATE DATABASE `ssmbuild`;
    USE `ssmbuild`;
    DROP TABLE IF EXISTS `books `;
    CREATE TABLE `books`(
    `bookID` INT (10) NOT NULL AUTO_INCREMENT COMMENT '书id',
    `bookName ` VARCHAR (100)NOT NULL COMMENT'书名',
    `bookCounts` INT (11) NOT NULL COMMENT '数量',
    `detail` VARCHAR(200) NOT NULI COMMENT '描述',
    KEY`bookID`( `bookID`)
    )ENGINE=INNODB DEFAULT CHARSET=utf8
    INSERT INTO `books` ( `bookID`,`bookName `,`bookCounts`, `detail` ) VALUES
    (1, 'Java' ,1,'从入门到放弃'),
    (2,'MysQL',10,'从册车到跑路'),
    ( 3,'Linux',5,'从进门到进牢');
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    2.配置大于约定:配置

    
    DOCTYPE configuration
            PUBLIC "-//mybatis.org//DTD Config 3.0//EN"
            "http://mybatis.org/dtd/mybatis-3-config.dtd">
    <configuration>
        <settings>
            <setting name="logImpl" value="STDOUT_LOGGING"/>
        settings>
    configuration>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    m y b a t i s − c o n f i g . x m l mybatis-config.xml mybatisconfig.xml

    mybatis核心配置文件能做的事情,都移交了spring做了,因此能留下来的不多,这里保留了一个日志的设置。

    
    <beans xmlns="http://www.springframework.org/schema/beans"
          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xmlns:context="http://www.springframework.org/schema/context"
          xsi:schemaLocation="http://www.springframework.org/schema/beans
           http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
       
       <context:property-placeholder location="classpath:db.properties"/>
       <bean id="dataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource">
           <property name="url" value="${jdbc.url}"/>
           <property name="driverClassName" value="${jdbc.driver}"/>
           <property name="username" value="${jdbc.username}"/>
           <property name="password" value="${jdbc.password}"/>
       bean>
    
       
       <bean id="sqlSessionFactory" class="org.mybatis.spring.SqlSessionFactoryBean">
           <property name="dataSource" ref="dataSource"/>
           
           <property name="configLocation" value="classpath:mybatis-config.xml"/>
           
           <property name="mapperLocations" value="classpath:com/kxy/mapper/*.xml"/>
       bean>
       
       <bean id="sqlSession" class="org.mybatis.spring.SqlSessionTemplate">
           <constructor-arg index="0" ref="sqlSessionFactory" />
       bean>
    
    beans>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29

    s p r i n g − d a o . x m l spring-dao.xml springdao.xml

    
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/context https://www.springframework.org/schema/context/spring-context.xsd">
         
        <context:component-scan base-package="com.kxy.service"/>
        
        <bean id="bookServiceImp" class="com.kxy.service.BookServiceImp">
            <property name="sqlSessionTemplate" ref="sqlSession"/>
        bean>
        
        <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager">
            <constructor-arg ref="dataSource" />
        bean>
        
    beans>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18

    s p r i n g − s e r v i c e . x m l spring-service.xml springservice.xml

    这里的事务声明配置,其实可以不用配,只是为了满足ACID原则,使我们的项目更加完美,当然不配置事务不会影响这个项目的运行。

    
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xmlns:context="http://www.springframework.org/schema/context"
           xmlns:mvc="http://www.springframework.org/schema/mvc"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd
            http://www.springframework.org/schema/context
            https://www.springframework.org/schema/context/spring-context.xsd
            http://www.springframework.org/schema/mvc
            http://www.springframework.org/schema/mvc/spring-mvc.xsd">
        
        <context:component-scan base-package="com.kxy.controller"/>
        
        <mvc:annotation-driven/>
        
        <mvc:default-servlet-handler/>
        
        <bean class="org.springframework.web.servlet.view.InternalResourceViewResolver" id="internalResourceViewResolver">
            <property name="prefix" value="/WEB-INF/jsp/"/>
            <property name="suffix" value=".jsp"/>
        bean>
    beans>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23

    s p r i n g − m v c . x m l spring-mvc.xml springmvc.xml

    
    <beans xmlns="http://www.springframework.org/schema/beans"
           xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
           xsi:schemaLocation="http://www.springframework.org/schema/beans
            http://www.springframework.org/schema/beans/spring-beans.xsd">
        <import resource="spring-dao.xml"/>
        <import resource="spring-service.xml"/>
        <import resource="spring-mvc.xml"/>
    beans>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9

    a p p l i c a t i o n C o n t e x t . x m l applicationContext.xml applicationContext.xml

    3.后端业务

    1.mapper接口

    public interface BookMapper {
        //增
        int addBook(Books books);
        //删
        int delBookById(@Param("bookID")int id);
        //改
        int updateBook(Books books);
        //查
        Books queryBookById(@Param("bookID")int id);
    
        List<Books> queryAllBooks();
    
        List<Books> queryBooksByName(@Param("bookName")String bookName);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14

    2.业务sql

    
    
    DOCTYPE mapper
            PUBLIC "-//mybatis.org//DTD mapper 3.0//EN"
            "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
    <mapper namespace="com.kxy.mapper.BookMapper">
        <insert id="addBook" parameterType="com.kxy.pojo.Books">
            insert into books (bookName, bookCounts, detail)
            values (#{bookName}, #{bookCounts}, #{detail});
        insert>
        <delete id="delBookById" parameterType="int">
            delete
            from books
            where bookID = #{bookID};
        delete>
        <update id="updateBook" parameterType="com.kxy.pojo.Books">
            update books
            set bookName  = #{bookName},
                bookCounts=#{bookCounts},
                detail=#{detail}
            where bookID = #{bookID};
        update>
        <select id="queryBookById" resultType="com.kxy.pojo.Books">
            select *
            from books
            where bookID = #{bookID};
        select>
        <select id="queryAllBooks" resultType="com.kxy.pojo.Books">
            select *
            from books;
        select>
        <select id="queryBooksByName" resultType="com.kxy.pojo.Books">
            select *
            from books
            where bookName like #{bookName};
        select>
    mapper>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37

    3.业务实现类

    public interface BookService {
        //增
        int addBook(Books books);
        //删
        int delBookById(int id);
        //改
        int updateBook(Books books);
        //查
        Books queryBookById(int id);
    
        List<Books> queryAllBooks();
    
        List<Books> queryBooksByName(String bookName);
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    public class BookServiceImp extends SqlSessionDaoSupport implements BookService{
        @Override
        public int addBook(Books books) {
            return getSqlSession().getMapper(BookMapper.class).addBook(books);
        }
    
        @Override
        public int delBookById(int id) {
            return getSqlSession().getMapper(BookMapper.class).delBookById(id);
        }
    
        @Override
        public int updateBook(Books books) {
            return getSqlSession().getMapper(BookMapper.class).updateBook(books);
        }
    
        @Override
        public Books queryBookById(int id) {
            return getSqlSession().getMapper(BookMapper.class).queryBookById(id);
        }
    
        @Override
        public List<Books> queryAllBooks() {
            return  getSqlSession().getMapper(BookMapper.class).queryAllBooks();
        }
    
        @Override
        public List<Books> queryBooksByName(String bookName) {
            return getSqlSession().getMapper(BookMapper.class).queryBooksByName(bookName);
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31

    使实现类继承SqlSessionDaoSupport,spring会自动帮我们把我们在spring.dao.xml里的sqlsessionTemplate注入到实现类,于是就可以使用getSqlSession()方法去获取对应的session。

    4.controller类

    处理器映射器会映射对应的url,适配器会适配处理器并且返回modelAndView,视图解析器会解析一个视图给前端控制器。controller类(处理器)封装了所有业务的url请求和视图。

    @Controller
    @RequestMapping("/book")
    public class BookController {
        @Autowired
        @Qualifier("bookServiceImp")
        private BookService bookService;
    
        @RequestMapping("")
        public String index(){
            return "index";
        }
        @RequestMapping("/allBook")
        public String listBooks(Model model) {
            List<Books> list = bookService.queryAllBooks();
            model.addAttribute("list", list);
            return "allBook";
        }
    
        //跳转到添加书籍表单页面的请求
        @RequestMapping("/toAddBook")
        public String toAddBook() {
            return "addBook";
        }
    
        //添加书籍的请求(表单提交的请求)
        @RequestMapping("/addBook")
        public String addBook(Books books) {
            bookService.addBook(books);
            return "redirect:/book/allBook";
        }
        //删除书籍的请求
        @RequestMapping("/delBook")
        public String delBook(int id){
            bookService.delBookById(id);
            return "redirect:/book/allBook";
        }
        //跳转到更新书籍的请求
        @RequestMapping("/toUpdateBook")
        public String toUpdateBook(int id,Model model) {
            Books books = bookService.queryBookById(id);
            model.addAttribute("books",books);
            return "updateBook";
        }
        @RequestMapping("/updateBook")
        public String updateBook(Books books){
            System.out.println("Book=>"+books);
            bookService.updateBook(books);
            return "redirect:/book/allBook";
        }
        //全局搜索的请求
        @RequestMapping("/searchBook")
        public String search(@RequestParam("bookName") String name,Model model){
            List<Books> list = bookService.queryBooksByName(name);
            model.addAttribute("list",list);
            return "allBook";
        }
    }
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57

    5.前端

    <%--
      Created by IntelliJ IDEA.
      User: kxy
      Date: 2022/9/7
      Time: 18:00
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>首页title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    head>
    <body>
        <a class="form-control" href="/book/allBook">欢迎进入书籍系统!a>
    body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
    <%--
      Created by IntelliJ IDEA.
      User: kxy
      Date: 2022/9/6
      Time: 16:38
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>展示所有书籍title>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    head>
    <body>
    
    <div class="container">
        <div class="row clearfix" style="background-color: gainsboro">
            <div class="col-md-12 column">
                <div class="page-header">
                    <h1>
                        <small>书籍列表 显示所有书籍small>
                    h1>
                div>
            div>
        div>
        <br>
        <div class="row justify-content-between ">
            <div class="col-md-4 column">
                <a class="btn btn-primary" href="${pageContext.request.contextPath}/book/toAddBook">新增书籍a>
            div>
            <div class="col-md-4 column " >
                <form action="/book/searchBook" method="get"style="display: flex">
                    <input type="text" class="form-control " placeholder="请输入搜索的书籍名称" name="bookName">  
                    <input type="submit" class="btn btn-primary  " value="搜索">
                form>
            div>
    
        div>
        <br>
        <div class="row clearfix">
            <div class="col-md-12 flex-column">
                <table class="table table-hover table-striped">
                    <thead>
                    <tr>
                        <th>书籍编号th>
                        <th>书籍名称th>
                        <th>书籍数量th>
                        <th>书籍描述th>
                        <th style="text-align: center">操作th>
                    tr>
                    thead>
                    <tbody>
                    <c:forEach var="book" items="${list}">
                        <tr>
                            <td>${book.bookID}td>
                            <td>${book.bookName}td>
                            <td>${book.bookCounts}td>
                            <td>${book.detail}td>
                            <td>
                                <a href="/book/delBook?id=${book.bookID}">删除a>
                                <a href="/book/toUpdateBook?id=${book.bookID}">修改a>
                            td>
                        tr>
                    c:forEach>
                    tbody>
                table>
            div>
        div>
    div>
    body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47
    • 48
    • 49
    • 50
    • 51
    • 52
    • 53
    • 54
    • 55
    • 56
    • 57
    • 58
    • 59
    • 60
    • 61
    • 62
    • 63
    • 64
    • 65
    • 66
    • 67
    • 68
    • 69
    • 70
    • 71
    • 72

    a l l B o o k . j s p allBook.jsp allBook.jsp

    <%--
      Created by IntelliJ IDEA.
      User: kxy
      Date: 2022/9/6
      Time: 17:47
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>Titletitle>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    head>
    <body>
        <div class="container">
            <div class="row clearfix">
                <div class="col-md-12 flex-column">
                    <div class="page-header">
                        <h1>
                            <small>书籍列表 添加书籍small>
                        h1>
                    div>
                div>
            div>
    
            <form action="${pageContext.request.contextPath}/book/addBook" method="get">
                <div class="form-group">
                    <label for="bkname">书籍名称label>
                    <input type="text" class="form-control" name="bookName" id="bkname" required>
                div>
                <div class="form-group">
                    <label for="bkcounts">书籍数量label>
                    <input type="text" class="form-control" name="bookCounts" id="bkcounts" required>
                div>
                <div class="form-group">
                    <label for="bkdetail">书籍描述label>
                    <input type="text" class="form-control" name="detail" id="bkdetail" required>
                div>
                <div class="form-group">
                    <input type="submit" class="form-control" value="添加">
                div>
            form>
        div>
    body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45

    a d d B o o k . j s p addBook.jsp addBook.jsp

    <%--
      Created by IntelliJ IDEA.
      User: kxy
      Date: 2022/9/6
      Time: 19:27
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <html>
    <head>
        <title>Titletitle>
        <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">
    head>
    <body>
    <div class="container">
        <div class="row clearfix">
            <div class="col-md-12 flex-column">
                <div class="page-header">
                    <h1>
                        <small>书籍列表 更新书籍small>
                    h1>
                div>
            div>
        div>
    
        <form action="${pageContext.request.contextPath}/book/updateBook" method="get">
            <input type="hidden" class="form-control" name="bookID" id="bkID" value="${books.bookID}" readonly="readonly">
            <div class="form-group">
                <label for="bkname">书籍名称label>
                <input type="text" class="form-control" value="${books.bookName}" name="bookName" id="bkname" required>
            div>
            <div class="form-group">
                <label for="bkcounts">书籍数量label>
                <input type="text" class="form-control" value="${books.bookCounts}" name="bookCounts" id="bkcounts"
                       required>
            div>
            <div class="form-group">
                <label for="bkdetail">书籍描述label>
                <input type="text" class="form-control" value="${books.detail}" name="detail" id="bkdetail" required>
            div>
            <div class="form-group">
                <input type="submit" class="form-control" value="提交">
            div>
        form>
    div>
    body>
    html>
    
    • 1
    • 2
    • 3
    • 4
    • 5
    • 6
    • 7
    • 8
    • 9
    • 10
    • 11
    • 12
    • 13
    • 14
    • 15
    • 16
    • 17
    • 18
    • 19
    • 20
    • 21
    • 22
    • 23
    • 24
    • 25
    • 26
    • 27
    • 28
    • 29
    • 30
    • 31
    • 32
    • 33
    • 34
    • 35
    • 36
    • 37
    • 38
    • 39
    • 40
    • 41
    • 42
    • 43
    • 44
    • 45
    • 46
    • 47

    u p d a t e B o o k . j s p updateBook.jsp updateBook.jsp

  • 相关阅读:
    qml实现路径绘制且可编辑
    Dobbo微服务项目实战(详细介绍+案例源码) - 2.用户登录
    sqoop1.4.7完全支持Hadoop3.x, Hive3.x Hbase2.x
    06-JVM对象内存回收机制深度剖析
    GitHub标星34.7k,没有记不住的正则表达式
    八、【React-Router5】路由组件传参
    postgres源码解析37 表创建执行全流程梳理--1
    36.AC自动机:如何用多模式串匹配实现敏感词过滤功能
    超简单免费转换ape到flac
    TypeScrip6
  • 原文地址:https://blog.csdn.net/qq_53635765/article/details/126764658