下载文件url为MultipartFile
良好的秩序是一切的基础。——伯克 代码如下: 123456789101112131415161718192021222324252627282930313233343536373839404142import lombok.Cleanup;import lombok.SneakyThrows;import lombok.val;import org.apache.commons.fileupload.FileItem;import org.apache.commons.fileupload.FileItemFactory;import org.apache.commons.fileupload.disk.DiskFileItemFactory;import org.dromara.hutool.core.io.IoUtil;import org.dromara.hutool.core.net.url.URLUtil;import org.springframework.http.MediaType;import org.springframework.web.multipar...
hutool-http配置默认实现
谨慎有时伸展太远了,以致堵塞了前进的道路。——佚名 在hutool中默认是通过spi扫描获取默认实现客户端 如果我们需要手动指定,只需要配置 1Singleton.put(ClientEngine.class.getName(), new JdkClientEngine()); 即可
mp方法注入支持typeHandler
画虎画皮难画骨,知人知面不知心。——佚名 今天处理了mp中自定义注入方法的typeHandler逻辑,只需要 #{et.name,typeHandler=org.dromara.streamquery.stream.plugin.mybatisplus.JsonFieldHandlerTest$JsonFieldHandler}即可直接指定typeHandler 123456789101112131415161718<script> <if test="list != null and !list.isEmpty()">UPDATE user_info SET name=case id<foreach collection="list" item="et"><choose><when test="et != null and et.name != null">when #{et.id} then #{e...
升级hutool 6.0
给别人自由和维护自己的自由,两者同样是崇高的事业。——林肯 今天把hutool升级到了6.0 发现了很多变更 版本:5.8.7 -> 6.0.0.M3不兼容情况: 首先是groupId 1234567<dependency>- <groupId>cn.hutool</groupId>+ <groupId>org.dromara.hutool</groupId> <artifactId>hutool-all</artifactId>- <version>5.8.7</version>+ <version>6.0.0.M3</version></dependency> 然后是全部的包名 123456- import cn.hutool.core.collection.CollUtil;- import cn.hutool.core.util.StrUtil;- import cn.hutool...
soya
发觉谬误比寻求真理容易,因为前者浮于表面容易见到,而后者藏于深处。——歌德 分享一个基于jvm的编程语言soya https://github.com/mySingleLive/soya soya有很多很棒的特性: Intuitive Syntax:指编程语言的语法易于理解和使用。 OOP features:指面向对象编程的特性,如封装、继承、多态等。 Functional Programming features:指函数式编程的特性,如高阶函数、纯函数、不可变性等。 Support many basic type literals (ex. collection, regular expression, file, url, date):指编程语言支持多种基本类型的字面量,如集合、正则表达式、文件、URL、日期等。 Pattern Matching features:指模式匹配的特性,可以用于匹配数据结构中的模式。 Exception Handling:指程序出现异常时的处理机制,可以用于优雅地处理错误。 Advanced Assignment:指高级赋值语...
Jinx
得到人处且饶人。——佚名 分享一个框架 Spring-boot框架采用netty取代tomcat 来做http服务 Spring-boot框架采用netty取代tomcat 来做http服务 Spring-boot用户 首先引起jar包 12345<dependency> <groupId>com.happylife.netty</groupId> <artifactId>happylife-netty</artifactId> <version>1.0-SNAPSHOT</version></dependency> 在spring-boot的Application类中加上如下代码: 123456@Beanpublic EmbeddedServletContainerFactory servletContainer(){ NettyContainerConfig nettyContainerConfig = new NettyConta...
json-server
错误同真理的关系,就像睡梦中同清醒的关系一样。一个人从促物中醒来,就会以新的力量走向其真理。——歌德 在前端与后端开发的时候,偶尔会有在后端接口没有开发完毕时进行一些接口的mock,这里有一款开源框架做了类似的事情,让你可以“不到30秒得到一个零编码的假REST API” https://github.com/typicode/json-server 我们只需要安装: 1npm install -g json-server 然后配置数据格式:db.json 123456789{ "posts": [ { "id": 1, "title": "json-server", "author": "typicode" } ], "comments": [ { "id": 1, "body": "some comment", &...
获取图片dpi坑
不会笑的女人是世上最令人厌烦的。——萨克雷 今天踩了个坑,windows文件资源管理器中显示96dpi 但是使用获取图片dpi的方式获取到一直是-1 最后找了很久才知道原来是文件资源管理器的垂直分辨率默认值96dpi
js实时协作编辑器
爱护才华吧,保护那些才华修美的人物吧。文明的民族啊,培养他们吧。——卢俊 https://github.com/ether/etherpad-lite https://etherpad.org/ 效果: 非常地nice
获取图片dpi
在只能说谎与沉默两者来选择的时候,沉默也是好的。——何其芳 可以通过下面的代码获取: 123ImageInfo imageInfo = Imaging.getImageInfo(file);imageInfo.getPhysicalWidthDpi();imageInfo.getPhysicalHeightDpi(); 对应的依赖: 12345<dependency> <groupId>org.apache.commons</groupId> <artifactId>commons-imaging</artifactId> <version>1.0-alpha3</version></dependency> 用的是apache-commons的commons-imaging这个库 https://commons.apache.org/proper/commons-imaging/index.html
