2026-01-17
1.优化代码
This commit is contained in:
+1
-1
@@ -1,4 +1,4 @@
|
||||
package cn.lailab.toolbox.beans.tools;
|
||||
package cn.lailab.toolbox.beans.domain;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
@@ -2,7 +2,7 @@ package cn.lailab.toolbox.controller.tools;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
import cn.lailab.toolbox.beans.domain.ToolMd5;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@@ -2,7 +2,7 @@ package cn.lailab.toolbox.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
import cn.lailab.toolbox.beans.domain.ToolMd5;
|
||||
|
||||
@Mapper
|
||||
public interface ToolMd5Mapper {
|
||||
|
||||
@@ -2,7 +2,7 @@ package cn.lailab.toolbox.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
import cn.lailab.toolbox.beans.domain.ToolMd5;
|
||||
|
||||
@Service
|
||||
public interface ToolMd5Service {
|
||||
|
||||
@@ -2,7 +2,7 @@ package cn.lailab.toolbox.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
import cn.lailab.toolbox.beans.domain.ToolMd5;
|
||||
import cn.lailab.toolbox.mapper.ToolMd5Mapper;
|
||||
import cn.lailab.toolbox.service.ToolMd5Service;
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ mybatis:
|
||||
# mapper-locations: classpath:mapper/*Mapper.xml #mapper的映射文件
|
||||
mapper-locations: classpath:mapper/**/*.xml
|
||||
# 2. 配置实体类的别名包(这样在 XML 中可以直接用类名,不用写全限定名)
|
||||
type-aliases-package: cn.lailab.toolbox.beans.domain,cn.lailab.toolbox.beans.other
|
||||
type-aliases-package: cn.lailab.toolbox.beans.domain
|
||||
# 3. 开启驼峰命名自动转换(比如数据库字段 user_name 自动映射到实体类属性 userName)
|
||||
# configuration:
|
||||
# map-underscore-to-camel-case: true
|
||||
@@ -47,6 +47,9 @@ logging:
|
||||
org.springframework.web: info
|
||||
org.hibernate.SQL: debug
|
||||
cn.lailab.toolbox: info
|
||||
# 开启 MyBatis 核心类的 DEBUG 日志
|
||||
org.apache.ibatis: DEBUG
|
||||
org.mybatis.spring: DEBUG
|
||||
logback:
|
||||
rollingpolicy:
|
||||
max-file-size: 10MB
|
||||
|
||||
@@ -1,12 +1,20 @@
|
||||
<?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="cn.lailab.toolbox.mapper.ToolMd5Mapper">
|
||||
<insert id="insertToolMd5" parameterType="toolMd5">
|
||||
|
||||
<resultMap id="base_result_map" type="cn.lailab.toolbox.beans.domain.ToolMd5">
|
||||
<id column="id" property="id"/>
|
||||
<result column="str" property="str"/>
|
||||
<result column="md5" property="md5"/>
|
||||
<result column="create_time" property="createTime"/>
|
||||
</resultMap>
|
||||
|
||||
<insert id="insertToolMd5" parameterType="base_result_map">
|
||||
insert into tool_md5_dict(str,md5)
|
||||
values(#{str}, #{md5});
|
||||
</insert>
|
||||
|
||||
<select id="selectToolMd5" resultMap="toolMd5">
|
||||
<select id="selectToolMd5" resultMap="base_result_map">
|
||||
select id,str,md5,create_time from tool_md5_dict;
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user