Loading

龙行博客

共找到 6 篇 “java” 的文章

SpringBoot-mybatis实现自定义字段填充

这只是简单哪来做个填充比如create_time,这个我一般用数据库CURRENT_TIMESTAMP. create_by这些. 更多用法,百度. package com.sckw.transport.plugin; import org.apache.ibatis.executor.Executor; import org.apache.ibatis.mapping.MappedStatement; import org.apache.ibatis.mapping.SqlCommandType; import org.apache.ibatis.p...

使用Token机制,保证请求幂等

幂等有很多方案,但是个人觉得这个最好用,来一个示例方案先 我们使用Redis保存Token令牌,引入SpringBoot,Redis,ULID相关的依赖 <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-redis</artifactId> <version>2.7.0</version> </depend...

springboot3.0.7-redis配置记录下

配置redis一直报错,想都不用想肯定是版本原因,各种折腾终于解决 正确的配置能用版本, 记录下 <?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 https://mav...

SpringBoot注解验证的操作方法

一样的做个记录,每次找资料耗费时间 场景: 嗯! 就是. 对接收参数进行合规性校验 目前我知道的有两种方式 第一种 直接写在Controller的方法中 public HttpResult test(@NotNull(message = "缺少参数:id") Long id) 第二种: 写在实体类中 /** * @desc: 运单新增请求bean * @author: Lt * @date: 2024/3/25 17:17 */ @Setter @Getter @Accessors(chain = true) public...

SpringBoot+Netty TCP协议对接充电桩

只是记录下使用记录,fd和uid的绑定没有写 引入依赖 <dependency> <groupId>io.netty</groupId> <artifactId>netty-all</artifactId> <version>4.1.22.Final</version> </dependency> 创建编码器,解码器 编码器 // 编码器 package com.example.springbootnettyserver...

maven阿里镜像配置

每次都要去找比较麻烦,挪过来自己看的😁 ▪apache mavne中央仓库 ▪https://search.maven.org/ ▪https://mvnrepository.com/ 方式一:全局配置 可以添加阿里云的镜像到maven的setting.xml配置中,这样就不需要每次在pom中,添加镜像仓库的配置,在mirrors节点下面添加子节点: <mirror> <id>nexus-aliyun</id> <mirrorOf>central</mirrorOf> &...