2026-01-17
1.添加Md5工具
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
package cn.lailab.toolbox.beans.tools;
|
||||
|
||||
import java.util.Date;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
@Data
|
||||
public class ToolMd5 {
|
||||
int id;
|
||||
String str;
|
||||
String md5;
|
||||
Date createTime;
|
||||
String authCode;
|
||||
}
|
||||
@@ -6,7 +6,7 @@ import org.springframework.web.bind.annotation.RequestMapping;
|
||||
@Controller
|
||||
public class ToolController {
|
||||
|
||||
@RequestMapping("/JiSuanQi")
|
||||
@RequestMapping("/tools/JiSuanQi")
|
||||
public String JiSuanQi() {
|
||||
return "tools/JiSuanQi/JiSuanQi.html";
|
||||
}
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
package cn.lailab.toolbox.controller.tools;
|
||||
|
||||
import org.springframework.web.bind.annotation.RestController;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
import org.springframework.web.bind.annotation.RequestParam;
|
||||
|
||||
@RestController
|
||||
public class ToolMd5Controller {
|
||||
@RequestMapping("/tools/insertMd5")
|
||||
public String insertToolMd51String(@RequestParam ToolMd5 ToolMd5) {
|
||||
return "12345";
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,25 @@
|
||||
package cn.lailab.toolbox.mapper;
|
||||
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
|
||||
@Mapper
|
||||
public interface ToolMd5Mapper {
|
||||
/**
|
||||
* 添加Md5到库里
|
||||
*
|
||||
* @param toolMd5
|
||||
* @return
|
||||
*/
|
||||
int insertToolMd5(ToolMd5 toolMd5);
|
||||
|
||||
/**
|
||||
* 获取对用的Md5信息
|
||||
*
|
||||
* @param toolMd5
|
||||
* @return
|
||||
*/
|
||||
ToolMd5 selectToolMd5(ToolMd5 toolMd5);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,12 @@
|
||||
package cn.lailab.toolbox.service;
|
||||
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
|
||||
@Service
|
||||
public interface ToolMd5Service {
|
||||
int insertToolMd5(ToolMd5 toolMd5);
|
||||
|
||||
ToolMd5 selectToolMd5(ToolMd5 toolMd5);
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
package cn.lailab.toolbox.service.impl;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
import cn.lailab.toolbox.mapper.ToolMd5Mapper;
|
||||
import cn.lailab.toolbox.service.ToolMd5Service;
|
||||
|
||||
public class ToolMd5ServiceImpl implements ToolMd5Service {
|
||||
|
||||
@Autowired
|
||||
ToolMd5Mapper toolMd5Mapper;
|
||||
|
||||
@Override
|
||||
public int insertToolMd5(ToolMd5 toolMd5) {
|
||||
return toolMd5Mapper.insertToolMd5(toolMd5);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ToolMd5 selectToolMd5(ToolMd5 toolMd5) {
|
||||
return toolMd5Mapper.selectToolMd5(toolMd5);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -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
|
||||
type-aliases-package: cn.lailab.toolbox.beans.domain,cn.lailab.toolbox.beans.other
|
||||
# 3. 开启驼峰命名自动转换(比如数据库字段 user_name 自动映射到实体类属性 userName)
|
||||
# configuration:
|
||||
# map-underscore-to-camel-case: true
|
||||
@@ -46,7 +46,7 @@ logging:
|
||||
level:
|
||||
org.springframework.web: info
|
||||
org.hibernate.SQL: debug
|
||||
cn.lailab: info
|
||||
cn.lailab.toolbox: info
|
||||
logback:
|
||||
rollingpolicy:
|
||||
max-file-size: 10MB
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
<?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">
|
||||
insert into tool_md5_dict(str,md5)
|
||||
values(#{str}, #{md5});
|
||||
</insert>
|
||||
|
||||
<select id="selectToolMd5" resultMap="toolMd5">
|
||||
select id,str,md5,create_time from tool_md5_dict;
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -53,12 +53,12 @@
|
||||
|
||||
/* 功能按钮(AC、+/-、%) */
|
||||
.func-btn {
|
||||
background-color: #e6f7ff;
|
||||
color: #1890ff;
|
||||
background-color: #e3b0a1;
|
||||
color: #dd4d20;
|
||||
}
|
||||
|
||||
.func-btn:active {
|
||||
background-color: #bae7ff;
|
||||
background-color: #ea8363;
|
||||
}
|
||||
|
||||
/* 数字按钮 */
|
||||
@@ -73,12 +73,12 @@
|
||||
|
||||
/* 运算符按钮(天蓝色主题) */
|
||||
.op-btn {
|
||||
background-color: #1890ff;
|
||||
background-color: #dd4d20;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
.op-btn:active {
|
||||
background-color: #096dd9;
|
||||
background-color: #c76a4e;
|
||||
}
|
||||
|
||||
/* 0号按钮占两列 */
|
||||
|
||||
@@ -0,0 +1,23 @@
|
||||
package cn.lailab.toolbox.service;
|
||||
|
||||
import org.junit.jupiter.api.Test;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.boot.test.context.SpringBootTest;
|
||||
|
||||
import cn.lailab.toolbox.beans.tools.ToolMd5;
|
||||
|
||||
@SpringBootTest
|
||||
public class ToolMd5ServiceTest {
|
||||
|
||||
// @Autowired
|
||||
// ToolMd5Service toolMd5Service;
|
||||
|
||||
@Test
|
||||
public void insertToolMd5Tests() {
|
||||
// ToolMd5 toolMd5 = new ToolMd5();
|
||||
// toolMd5.setStr("12345");
|
||||
// toolMd5.setMd5("34556");
|
||||
// int rst = toolMd5Service.insertToolMd5(toolMd5);
|
||||
System.out.println("返回:");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user