Springboot的CRUD接口开发操作

首先,创建实体类,自己在com.jtl.rebirth目录下创建的entity下创建

UserCollection.java

package com.jtl.rebirth.entity;

import java.util.List;

/**
 * 用户端---我的收藏接口
 * @param id 商品id
 * @param shopName  商品名称
 * @param shopImages  商品图片
 * @param shopPrice  售价
 */
public class UserCollection {
  private Integer id;
  private String shopName;
  private String shopImages;
  private String shopPrice;
  public UserCollection(){}
    public UserCollection(Integer id, String shopName, String shopImages, String shopPrice, List<UserVoucher> userVouchers) {
        this.id = id;
        this.shopName = shopName;
        this.shopImages = shopImages;
        this.shopPrice = shopPrice;

    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id ;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName  == null ? null : shopName.trim();
    }

    public String getShopImages() {
        return shopImages;
    }

    public void setShopImages(String shopImages) {
        this.shopImages = shopImages  == null ? null : shopImages.trim();
    }

    public String getShopPrice() {
        return shopPrice;
    }

    public void setShopPrice(String shopPrice) {
        this.shopPrice = shopPrice  == null ? null : shopPrice.trim();
    }



    @Override
    public String toString() {
        return "UserCollection{" +
                "id=" + id +
                ", shopName='" + shopName + '\'' +
                ", shopImages='" + shopImages + '\'' +
                ", shopPrice='" + shopPrice + '\'' +
                '}';
    }
}

第二步,创建dao层,自己在com.jtl.rebirth目录下创建的dao下创建

UserBrowseMapper.java

package com.jtl.rebirth.dao;


import com.jtl.rebirth.entity.UserBrowse;
import com.jtl.rebirth.entity.UserCollection;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * 用户数据接口
 */
@Mapper
public interface UserCollectionMapper {
    /**
     * 用户的新增
     */
    @Insert("insert into u_collection (id,shopName,shopImages,shopPrice ) values (#{id},#{shopName},#{shopImages},#{shopPrice})")
    void addUser(UserCollection userCollection);

    /**
     * 用户信息的修改
     */
    @Update("update u_collection set id=#{id},shopName=#{shopName},shopPrice=#{shopPrice} where id=#{id}")
    void updateUser(UserCollection userCollection);

    /**
     * 用户数据删除
     */
    @Delete("delete from u_collection where id=#{id}")
    void deleteUser(Integer id);

    /**
     * 根据用户名称查询用户信息
     *
     */
    @Select("SELECT id,shopName,shopImages,shopPrice FROM u_collection where shopName=#{shopName}")
    UserBrowse findByName(@Param("userName") String userName);

    /**
     * 查询所有
     */
    @Select("SELECT id,shopName,shopImages,shopPrice FROM u_collection")
    List<UserCollection> findAll();


}

第三步,创建service层,自己在com.jtl.rebirth目录下创建的service下创建

UserCollectionService.java

package com.jtl.rebirth.service;

import com.jtl.rebirth.entity.UserBrowse;
import com.jtl.rebirth.entity.UserCollection;

import java.util.List;

/**
 * 用户接口
 */
public interface UserCollectionService {
    /**
     * 新增用户
     * @param userCollection
     * @return
     */
    boolean addUser(UserCollection userCollection);

    /**
     * 修改用户
     * @param userCollection
     * @return
     */
    boolean updateUser(UserCollection userCollection);


    /**
     * 删除用户
     * @param id
     * @return
     */
    boolean deleteUser(int id);

    /**
     * 根据用户名字查询用户信息
     * @param userName
     */
    UserBrowse findUserByName(String userName);



    /**
     * 查询所有
     * @return
     */
    List<UserCollection> findAll();

}

第四步,创建serviceimpl层,自己在com.jtl.rebirth目录下创建的serviceimpl下创建

UserCollectionServiceImpl.java

package com.jtl.rebirth.serviceImpl;
import com.jtl.rebirth.dao.UserCollectionMapper;
import com.jtl.rebirth.entity.UserBrowse;
import com.jtl.rebirth.entity.UserCollection;
import com.jtl.rebirth.service.UserCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
 * 用户操作实现类
 */
import java.util.List;
@Service
public class UserCollectionServiceImpl implements UserCollectionService {
    @Autowired
    private UserCollectionMapper userCollectionMapper;

    @Override
    public boolean addUser(UserCollection userCollection) {
        boolean flag=false;
        try{
            userCollectionMapper.addUser(userCollection);
            flag=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public boolean updateUser(UserCollection userCollection) {
        boolean flag=false;
        try{
            userCollectionMapper.addUser(userCollection);
            flag=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public boolean deleteUser(int id) {
        boolean flag=false;
        try{
            userCollectionMapper.deleteUser(id);
            flag=true;
        }catch(Exception e){
            e.printStackTrace();
        }
        return flag;
    }

    @Override
    public UserBrowse findUserByName(String userName) {
        return userCollectionMapper.findByName(userName);
    }

    @Override
    public List<UserCollection> findAll() {
        return userCollectionMapper.findAll();
    }
}

第五步,创建controller层,自己在com.jtl.rebirth目录下创建的controller下创建

UserCollectionController.java

package com.jtl.rebirth.controller;

import com.jtl.rebirth.entity.UserBrowse;
import com.jtl.rebirth.entity.UserCollection;
import com.jtl.rebirth.service.UserCollectionService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

/**
 * 用户控制层
 */
@RestController
@RequestMapping("/api/usercollection")
public class UserCollectionController {
    @Autowired
    private UserCollectionService userCollectionService;

    @RequestMapping(value = "/usercollection", method = RequestMethod.POST)
    public boolean addUser( @RequestBody UserCollection userCollection) {
        System.out.println("开始新增...");
        return userCollectionService.addUser(userCollection);
    }

    @RequestMapping(value = "/usercollection", method = RequestMethod.PUT)
    public boolean updateUser( @RequestBody UserCollection userCollection) {
        System.out.println("开始更新...");
        return userCollectionService.updateUser(userCollection);
    }

    @RequestMapping(value = "/usercollection", method = RequestMethod.DELETE)
    public boolean delete(@RequestParam(value = "userName", required = true) Integer Id) {
        System.out.println("开始删除...");
        return userCollectionService.deleteUser(Id);
    }


    @RequestMapping(value = "/usercollection", method = RequestMethod.GET)
    public UserBrowse findByUserName(@RequestParam(value = "userName", required = true) String userName) {
        System.out.println("开始查询...");
        return userCollectionService.findUserByName(userName);
    }


    @RequestMapping(value = "/userAll", method = RequestMethod.GET)
    public List<UserCollection> findByUserAge() {
        System.out.println("开始查询所有数据...");
        return userCollectionService.findAll();
    }



}

在src\main\resources\mapper文件,创建

UserCollectionMapper.xml

<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" >
<mapper namespace="com.jtl.rebirth.dao.UserCollectionMapper">
    <resultMap id="BaseResultMap" type="com.jtl.rebirth.entity.UserBrowse" >
        <result column="id" property="id" />
        <result column="shopName" property="shopName" />
        <result column="shopImages" property="shopImages" />
        <result column="shopPrice" property="shopPrice" />
    </resultMap>
    <sql id="Base_Column_List" >
id,shopName,shopImages,shopPrice
  </sql>

    <select id="selectByShopIdanddId" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
        select
        <include refid="Base_Column_List" />
        from u_collection
        <where>
            <if test="id!=null and id!= ''">
                or id= #{id}
            </if>

        </where>

    </select>

    <select id="selectByPrimaryKey" resultMap="BaseResultMap" parameterType="java.lang.Integer" >
        select
        <include refid="Base_Column_List" />
        from u_collection
        where id = #{id,jdbcType=INTEGER}
    </select>

    <delete id="deleteByPrimaryKey" parameterType="java.lang.Integer" >
    delete from u_collection
    where id = #{id,jdbcType=INTEGER}
  </delete>

    <insert id="insert" parameterType="com.jtl.rebirth.entity.UserCollection" useGeneratedKeys="true" keyProperty="id" keyColumn="id">
        insert into u_collection
        <trim prefix="(" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                id,
            </if>
            <if test="shopName != null" >
                shopName,
            </if>
            <if test="shopImages != null" >
                shopImages,
            </if>
            <if test="shopPrice != null" >
                shopPrice,
            </if>


        </trim>
        <trim prefix="values (" suffix=")" suffixOverrides="," >
            <if test="id != null" >
                #{id,jdbcType=INTEGER},
            </if>
            <if test="shopName != null" >
                #{shopName,jdbcType=INTEGER},
            </if>
            <if test="shopImages != null" >
                #{shopImages,jdbcType=VARCHAR},
            </if>
            <if test="shopPrice != null" >
                #{shopPrice,jdbcType=VARCHAR},
            </if>


        </trim>
    </insert>



    <update id="updateByPrimaryKeySelective" parameterType="com.jtl.rebirth.entity.UserCollection" >
        update u_collection
        <set >
            <if test="id != null" >
                id= #{id,jdbcType=INTEGER},
            </if>
            <if test="shopName != null" >
                shopName = #{shopName,jdbcType=VARCHAR},
            </if>
            <if test="shopImages != null" >
                shopImages = #{shopImages,jdbcType=VARCHAR},
            </if>
            <if test="shopPrice != null" >
                shopPrice = #{shopPrice,jdbcType=VARCHAR},
            </if>


        </set>
        where id= #{id,jdbcType=INTEGER}
    </update>

</mapper>



在全局配置:

application.yml

server:
  port: 8080

spring:

  datasource:
    name: test
    url: jdbc:mysql://127.0.0.1:3306/yhd?characterEncoding=utf8
    username: root
    password: root
    driver-class-name: com.mysql.jdbc.Driver

    devtools:
      restart:
        enabled: true
      freemarker:
        cache: false


mybatis:
  mapper-locations: classpath:mapper/*.xml
  type-aliases-package: com.jtl.rebirth.entity


pagehelper:
  helperDialect: mysql
  reasonable: true
  supportMethodsArguments: true
  params: count=countSql


logging:
  level:
    com.jtl.rebirth.dao: debug


启动类:
RebirthApplication.java

package com.jtl.rebirth;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.util.ResourceUtils;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;

@SpringBootApplication
@MapperScan("com.jtl.rebirth.dao")
public class RebirthApplication extends WebMvcConfigurationSupport {

    public static void main(String[] args) {
        SpringApplication.run(RebirthApplication.class, args);
    }

    //这里配置静态资源文件的路径导包都是默认的直接导入就可以
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/static/**").addResourceLocations(ResourceUtils.CLASSPATH_URL_PREFIX + "/static/");


        //上传的图片在E盘下的img目录下,访问路径如:http://localhost:8081/img/d3cf0281-bb7f-40e0-ab77-406db95ccf2c.jpg
        //        //其中img表示访问的前缀。"file:D:/OTA/"是文件真实的存储路径
        //http://localhost:8080/img/20190930/113932.jpg
        registry.addResourceHandler("/img/**").addResourceLocations("file:///img/");


        super.addResourceHandlers(registry);


    }

}

控制台打印的日志文件

"D:\17、Program Files\Java\jdk1.8.0_181\bin\java.exe" -Dvisualvm.id=1047655218244455 "-javaagent:D:\28.   IDEA (JAVA)\2019.2\path-class\IntelliJ IDEA 2019.2\lib\idea_rt.jar=65318:D:\28.   IDEA (JAVA)\2019.2\path-class\IntelliJ IDEA 2019.2\bin" -Dfile.encoding=UTF-8 -classpath "D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\charsets.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\deploy.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\access-bridge-64.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\cldrdata.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\dnsns.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\jaccess.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\jfxrt.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\localedata.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\nashorn.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunec.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunjce_provider.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunmscapi.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\sunpkcs11.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\ext\zipfs.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\javaws.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\jce.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\jfr.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\jfxswt.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\jsse.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\management-agent.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\plugin.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\resources.jar;D:\17、Program Files\Java\jdk1.8.0_181\jre\lib\rt.jar;D:\rebirth\target\classes;C:\Users\HP\.m2\repository\org\slf4j\jcl-over-slf4j\1.7.26\jcl-over-slf4j-1.7.26.jar;C:\Users\HP\.m2\repository\org\slf4j\slf4j-api\1.7.26\slf4j-api-1.7.26.jar;C:\Users\HP\.m2\repository\com\aliyun\aliyun-java-sdk-core\3.7.0\aliyun-java-sdk-core-3.7.0.jar;C:\Users\HP\.m2\repository\org\json\json\20170516\json-20170516.jar;C:\Users\HP\.m2\repository\com\aliyun\aliyun-java-sdk-ecs\4.11.0\aliyun-java-sdk-ecs-4.11.0.jar;C:\Users\HP\.m2\repository\commons-lang\commons-lang\2.6\commons-lang-2.6.jar;C:\Users\HP\.m2\repository\commons-fileupload\commons-fileupload\1.3.3\commons-fileupload-1.3.3.jar;C:\Users\HP\.m2\repository\commons-io\commons-io\2.2\commons-io-2.2.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-devtools\2.1.7.RELEASE\spring-boot-devtools-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot\2.1.7.RELEASE\spring-boot-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-context\5.1.9.RELEASE\spring-context-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-autoconfigure\2.1.7.RELEASE\spring-boot-autoconfigure-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\mysql\mysql-connector-java\5.1.21\mysql-connector-java-5.1.21.jar;C:\Users\HP\.m2\repository\com\alibaba\druid\1.1.10\druid-1.1.10.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-web\2.1.7.RELEASE\spring-boot-starter-web-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter\2.1.7.RELEASE\spring-boot-starter-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-logging\2.1.7.RELEASE\spring-boot-starter-logging-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\ch\qos\logback\logback-classic\1.2.3\logback-classic-1.2.3.jar;C:\Users\HP\.m2\repository\ch\qos\logback\logback-core\1.2.3\logback-core-1.2.3.jar;C:\Users\HP\.m2\repository\org\apache\logging\log4j\log4j-to-slf4j\2.11.2\log4j-to-slf4j-2.11.2.jar;C:\Users\HP\.m2\repository\org\apache\logging\log4j\log4j-api\2.11.2\log4j-api-2.11.2.jar;C:\Users\HP\.m2\repository\org\slf4j\jul-to-slf4j\1.7.26\jul-to-slf4j-1.7.26.jar;C:\Users\HP\.m2\repository\javax\annotation\javax.annotation-api\1.3.2\javax.annotation-api-1.3.2.jar;C:\Users\HP\.m2\repository\org\yaml\snakeyaml\1.23\snakeyaml-1.23.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-json\2.1.7.RELEASE\spring-boot-starter-json-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\core\jackson-databind\2.9.9\jackson-databind-2.9.9.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\core\jackson-annotations\2.9.0\jackson-annotations-2.9.0.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\core\jackson-core\2.9.9\jackson-core-2.9.9.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jdk8\2.9.9\jackson-datatype-jdk8-2.9.9.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\datatype\jackson-datatype-jsr310\2.9.9\jackson-datatype-jsr310-2.9.9.jar;C:\Users\HP\.m2\repository\com\fasterxml\jackson\module\jackson-module-parameter-names\2.9.9\jackson-module-parameter-names-2.9.9.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-tomcat\2.1.7.RELEASE\spring-boot-starter-tomcat-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\apache\tomcat\embed\tomcat-embed-core\9.0.22\tomcat-embed-core-9.0.22.jar;C:\Users\HP\.m2\repository\org\apache\tomcat\embed\tomcat-embed-el\9.0.22\tomcat-embed-el-9.0.22.jar;C:\Users\HP\.m2\repository\org\apache\tomcat\embed\tomcat-embed-websocket\9.0.22\tomcat-embed-websocket-9.0.22.jar;C:\Users\HP\.m2\repository\org\hibernate\validator\hibernate-validator\6.0.17.Final\hibernate-validator-6.0.17.Final.jar;C:\Users\HP\.m2\repository\javax\validation\validation-api\2.0.1.Final\validation-api-2.0.1.Final.jar;C:\Users\HP\.m2\repository\org\jboss\logging\jboss-logging\3.3.2.Final\jboss-logging-3.3.2.Final.jar;C:\Users\HP\.m2\repository\com\fasterxml\classmate\1.4.0\classmate-1.4.0.jar;C:\Users\HP\.m2\repository\org\springframework\spring-web\5.1.9.RELEASE\spring-web-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-beans\5.1.9.RELEASE\spring-beans-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-webmvc\5.1.9.RELEASE\spring-webmvc-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-aop\5.1.9.RELEASE\spring-aop-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-expression\5.1.9.RELEASE\spring-expression-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-jdbc\2.1.7.RELEASE\spring-boot-starter-jdbc-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\com\zaxxer\HikariCP\3.2.0\HikariCP-3.2.0.jar;C:\Users\HP\.m2\repository\org\springframework\spring-jdbc\5.1.9.RELEASE\spring-jdbc-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-tx\5.1.9.RELEASE\spring-tx-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-thymeleaf\2.1.7.RELEASE\spring-boot-starter-thymeleaf-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\thymeleaf\thymeleaf-spring5\3.0.11.RELEASE\thymeleaf-spring5-3.0.11.RELEASE.jar;C:\Users\HP\.m2\repository\org\thymeleaf\thymeleaf\3.0.11.RELEASE\thymeleaf-3.0.11.RELEASE.jar;C:\Users\HP\.m2\repository\org\attoparser\attoparser\2.0.5.RELEASE\attoparser-2.0.5.RELEASE.jar;C:\Users\HP\.m2\repository\org\unbescape\unbescape\1.1.6.RELEASE\unbescape-1.1.6.RELEASE.jar;C:\Users\HP\.m2\repository\org\thymeleaf\extras\thymeleaf-extras-java8time\3.0.4.RELEASE\thymeleaf-extras-java8time-3.0.4.RELEASE.jar;C:\Users\HP\.m2\repository\org\mybatis\spring\boot\mybatis-spring-boot-starter\2.1.0\mybatis-spring-boot-starter-2.1.0.jar;C:\Users\HP\.m2\repository\org\mybatis\spring\boot\mybatis-spring-boot-autoconfigure\2.1.0\mybatis-spring-boot-autoconfigure-2.1.0.jar;C:\Users\HP\.m2\repository\org\mybatis\mybatis\3.5.2\mybatis-3.5.2.jar;C:\Users\HP\.m2\repository\org\mybatis\mybatis-spring\2.0.2\mybatis-spring-2.0.2.jar;C:\Users\HP\.m2\repository\org\springframework\spring-core\5.1.9.RELEASE\spring-core-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-jcl\5.1.9.RELEASE\spring-jcl-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\com\alibaba\fastjson\1.2.47\fastjson-1.2.47.jar;C:\Users\HP\.m2\repository\org\apache\commons\commons-pool2\2.4.2\commons-pool2-2.4.2.jar;C:\Users\HP\.m2\repository\redis\clients\jedis\2.9.3\jedis-2.9.3.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-data-redis\2.1.7.RELEASE\spring-boot-starter-data-redis-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\data\spring-data-redis\2.1.10.RELEASE\spring-data-redis-2.1.10.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\data\spring-data-keyvalue\2.1.10.RELEASE\spring-data-keyvalue-2.1.10.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\data\spring-data-commons\2.1.10.RELEASE\spring-data-commons-2.1.10.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-oxm\5.1.9.RELEASE\spring-oxm-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\io\lettuce\lettuce-core\5.1.8.RELEASE\lettuce-core-5.1.8.RELEASE.jar;C:\Users\HP\.m2\repository\io\netty\netty-common\4.1.38.Final\netty-common-4.1.38.Final.jar;C:\Users\HP\.m2\repository\io\netty\netty-handler\4.1.38.Final\netty-handler-4.1.38.Final.jar;C:\Users\HP\.m2\repository\io\netty\netty-buffer\4.1.38.Final\netty-buffer-4.1.38.Final.jar;C:\Users\HP\.m2\repository\io\netty\netty-codec\4.1.38.Final\netty-codec-4.1.38.Final.jar;C:\Users\HP\.m2\repository\io\netty\netty-transport\4.1.38.Final\netty-transport-4.1.38.Final.jar;C:\Users\HP\.m2\repository\io\netty\netty-resolver\4.1.38.Final\netty-resolver-4.1.38.Final.jar;C:\Users\HP\.m2\repository\io\projectreactor\reactor-core\3.2.11.RELEASE\reactor-core-3.2.11.RELEASE.jar;C:\Users\HP\.m2\repository\org\reactivestreams\reactive-streams\1.0.2\reactive-streams-1.0.2.jar;C:\Users\HP\.m2\repository\org\springframework\boot\spring-boot-starter-cache\2.1.7.RELEASE\spring-boot-starter-cache-2.1.7.RELEASE.jar;C:\Users\HP\.m2\repository\org\springframework\spring-context-support\5.1.9.RELEASE\spring-context-support-5.1.9.RELEASE.jar;C:\Users\HP\.m2\repository\cn\hutool\hutool-all\4.5.6\hutool-all-4.5.6.jar;C:\Users\HP\.m2\repository\javax\mail\mail\1.4.7\mail-1.4.7.jar;C:\Users\HP\.m2\repository\javax\activation\activation\1.1\activation-1.1.jar;C:\Users\HP\.m2\repository\com\github\pagehelper\pagehelper-spring-boot-starter\1.2.5\pagehelper-spring-boot-starter-1.2.5.jar;C:\Users\HP\.m2\repository\com\github\pagehelper\pagehelper-spring-boot-autoconfigure\1.2.5\pagehelper-spring-boot-autoconfigure-1.2.5.jar;C:\Users\HP\.m2\repository\com\github\pagehelper\pagehelper\5.1.4\pagehelper-5.1.4.jar;C:\Users\HP\.m2\repository\com\github\jsqlparser\jsqlparser\1.0\jsqlparser-1.0.jar" com.jtl.rebirth.RebirthApplication

  .   ____          _            __ _ _
 /\\ / ___'_ __ _ _(_)_ __  __ _ \ \ \ \
( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \
 \\/  ___)| |_)| | | | | || (_| |  ) ) ) )
  '  |____| .__|_| |_|_| |_\__, | / / / /
 =========|_|==============|___/=/_/_/_/
 :: Spring Boot ::        (v2.1.7.RELEASE)

2019-10-12 11:51:21.705  INFO 18988 --- [  restartedMain] com.jtl.rebirth.RebirthApplication       : Starting RebirthApplication on DESKTOP-4HKNB5J with PID 18988 (D:\rebirth\target\classes started by 萧雨余生 in D:\rebirth)
2019-10-12 11:51:21.710  INFO 18988 --- [  restartedMain] com.jtl.rebirth.RebirthApplication       : No active profile set, falling back to default profiles: default
2019-10-12 11:51:21.823  INFO 18988 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : Devtools property defaults active! Set 'spring.devtools.add-properties' to 'false' to disable
2019-10-12 11:51:21.824  INFO 18988 --- [  restartedMain] .e.DevToolsPropertyDefaultsPostProcessor : For additional web related logging consider setting the 'logging.level.web' property to 'DEBUG'
2019-10-12 11:51:24.467  INFO 18988 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Multiple Spring Data modules found, entering strict repository configuration mode!
2019-10-12 11:51:24.472  INFO 18988 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Bootstrapping Spring Data repositories in DEFAULT mode.
2019-10-12 11:51:24.626  INFO 18988 --- [  restartedMain] .s.d.r.c.RepositoryConfigurationDelegate : Finished Spring Data repository scanning in 82ms. Found 0 repository interfaces.
2019-10-12 11:51:25.507  INFO 18988 --- [  restartedMain] trationDelegate$BeanPostProcessorChecker : Bean 'org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration' of type [org.springframework.transaction.annotation.ProxyTransactionManagementConfiguration$$EnhancerBySpringCGLIB$$c153c78c] is not eligible for getting processed by all BeanPostProcessors (for example: not eligible for auto-proxying)
2019-10-12 11:51:26.586  INFO 18988 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat initialized with port(s): 8080 (http)
2019-10-12 11:51:26.629  INFO 18988 --- [  restartedMain] o.apache.catalina.core.StandardService   : Starting service [Tomcat]
2019-10-12 11:51:26.629  INFO 18988 --- [  restartedMain] org.apache.catalina.core.StandardEngine  : Starting Servlet engine: [Apache Tomcat/9.0.22]
2019-10-12 11:51:26.895  INFO 18988 --- [  restartedMain] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring embedded WebApplicationContext
2019-10-12 11:51:26.895  INFO 18988 --- [  restartedMain] o.s.web.context.ContextLoader            : Root WebApplicationContext: initialization completed in 5071 ms
2019-10-12 11:51:29.501  INFO 18988 --- [  restartedMain] o.s.b.d.a.OptionalLiveReloadServer       : LiveReload server is running on port 35729
2019-10-12 11:51:29.594  INFO 18988 --- [  restartedMain] o.s.b.w.embedded.tomcat.TomcatWebServer  : Tomcat started on port(s): 8080 (http) with context path ''
2019-10-12 11:51:29.597  INFO 18988 --- [  restartedMain] com.jtl.rebirth.RebirthApplication       : Started RebirthApplication in 8.561 seconds (JVM running for 9.599)
2019-10-12 11:52:02.778  INFO 18988 --- [nio-8080-exec-1] o.a.c.c.C.[Tomcat].[localhost].[/]       : Initializing Spring DispatcherServlet 'dispatcherServlet'
2019-10-12 11:52:02.779  INFO 18988 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Initializing Servlet 'dispatcherServlet'
2019-10-12 11:52:02.791  INFO 18988 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet        : Completed initialization in 12 ms
2019-10-12 11:52:02.823  WARN 18988 --- [nio-8080-exec-1] o.s.web.servlet.PageNotFound             : No mapping for POST /api/user/usercollection
开始新增...
2019-10-12 11:52:29.243  INFO 18988 --- [nio-8080-exec-2] com.zaxxer.hikari.HikariDataSource       : test - Starting...
2019-10-12 11:52:29.490  INFO 18988 --- [nio-8080-exec-2] com.zaxxer.hikari.HikariDataSource       : test - Start completed.
2019-10-12 11:52:29.497 DEBUG 18988 --- [nio-8080-exec-2] c.j.r.dao.UserCollectionMapper.addUser   : ==>  Preparing: insert into u_collection (id,shopName,shopImages,shopPrice ) values (?,?,?,?) 
2019-10-12 11:52:29.532 DEBUG 18988 --- [nio-8080-exec-2] c.j.r.dao.UserCollectionMapper.addUser   : ==> Parameters: 111(Integer), 土豆1(String), 商品图1(String), test1(String)
2019-10-12 11:52:29.538 DEBUG 18988 --- [nio-8080-exec-2] c.j.r.dao.UserCollectionMapper.addUser   : <==    Updates: 1
开始新增...
2019-10-12 11:53:14.190 DEBUG 18988 --- [nio-8080-exec-3] c.j.r.dao.UserCollectionMapper.addUser   : ==>  Preparing: insert into u_collection (id,shopName,shopImages,shopPrice ) values (?,?,?,?) 
2019-10-12 11:53:14.192 DEBUG 18988 --- [nio-8080-exec-3] c.j.r.dao.UserCollectionMapper.addUser   : ==> Parameters: 1(Integer), 土豆1(String), 商品图1(String), 15(String)
2019-10-12 11:53:14.200 DEBUG 18988 --- [nio-8080-exec-3] c.j.r.dao.UserCollectionMapper.addUser   : <==    Updates: 1
开始新增...
2019-10-12 11:57:06.412 DEBUG 18988 --- [nio-8080-exec-5] c.j.r.dao.UserCollectionMapper.addUser   : ==>  Preparing: insert into u_collection (id,shopName,shopImages,shopPrice ) values (?,?,?,?) 
2019-10-12 11:57:06.413 DEBUG 18988 --- [nio-8080-exec-5] c.j.r.dao.UserCollectionMapper.addUser   : ==> Parameters: 2(Integer), 土豆1(String), 商品图1(String), 15(String)
2019-10-12 11:57:06.420 DEBUG 18988 --- [nio-8080-exec-5] c.j.r.dao.UserCollectionMapper.addUser   : <==    Updates: 1
开始新增...
2019-10-12 11:57:12.264 DEBUG 18988 --- [nio-8080-exec-6] c.j.r.dao.UserCollectionMapper.addUser   : ==>  Preparing: insert into u_collection (id,shopName,shopImages,shopPrice ) values (?,?,?,?) 
2019-10-12 11:57:12.264 DEBUG 18988 --- [nio-8080-exec-6] c.j.r.dao.UserCollectionMapper.addUser   : ==> Parameters: 3(Integer), 土豆1(String), 商品图1(String), 15(String)
2019-10-12 11:57:12.273 DEBUG 18988 --- [nio-8080-exec-6] c.j.r.dao.UserCollectionMapper.addUser   : <==    Updates: 1
开始新增...
2019-10-12 11:57:17.087 DEBUG 18988 --- [nio-8080-exec-7] c.j.r.dao.UserCollectionMapper.addUser   : ==>  Preparing: insert into u_collection (id,shopName,shopImages,shopPrice ) values (?,?,?,?) 
2019-10-12 11:57:17.087 DEBUG 18988 --- [nio-8080-exec-7] c.j.r.dao.UserCollectionMapper.addUser   : ==> Parameters: 4(Integer), 土豆1(String), 商品图1(String), 15(String)
2019-10-12 11:57:17.093 DEBUG 18988 --- [nio-8080-exec-7] c.j.r.dao.UserCollectionMapper.addUser   : <==    Updates: 1
开始新增...
2019-10-12 11:57:21.891 DEBUG 18988 --- [nio-8080-exec-8] c.j.r.dao.UserCollectionMapper.addUser   : ==>  Preparing: insert into u_collection (id,shopName,shopImages,shopPrice ) values (?,?,?,?) 
2019-10-12 11:57:21.892 DEBUG 18988 --- [nio-8080-exec-8] c.j.r.dao.UserCollectionMapper.addUser   : ==> Parameters: 5(Integer), 土豆1(String), 商品图1(String), 15(String)
2019-10-12 11:57:21.900 DEBUG 18988 --- [nio-8080-exec-8] c.j.r.dao.UserCollectionMapper.addUser   : <==    Updates: 1
2019-10-12 13:32:47.957  WARN 18988 --- [est housekeeper] com.zaxxer.hikari.pool.HikariPool        : test - Thread starvation or clock leap detected (housekeeper delta=39m48s217ms514µs592ns).

数据库的更新数据

![在这里插入图片描述](https://img-blog.csdnimg.cn/20191012134052887.png)
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值