会员
周边
新闻
博问
闪存
众包
赞助商
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
Live in the moment
笔记本而已!
首页
新随笔
管理
上一页
1
2
3
4
5
6
7
8
9
10
···
20
下一页
2022年4月21日
feign调用添加header
摘要: 临时鉴权使用: void sendEmail(@RequestBody SendDto temp,@RequestHeader("Authorization") String auth); 调用: mailService.sendEmail(sendDto,"Bearer 123456");
阅读全文
posted @ 2022-04-21 11:26 许伟强
阅读(238)
评论(0)
推荐(0)
2022年4月20日
spring mongo
摘要: 依赖地址: https://mvnrepository.com/artifact/org.springframework.boot/spring-boot-starter-data-mongodb/2.3.4.RELEASE 官方手册地址: https://docs.spring.io/spring
阅读全文
posted @ 2022-04-20 22:46 许伟强
阅读(49)
评论(0)
推荐(0)
spring elastic
摘要: 依赖地址(这里我们用的版本是7.1.1): https://mvnrepository.com/artifact/org.elasticsearch.client/elasticsearch-rest-high-level-client 对应的文档地址 https://www.elastic.co/
阅读全文
posted @ 2022-04-20 22:45 许伟强
阅读(68)
评论(0)
推荐(0)
2022年4月19日
Java加密并压缩文件
摘要: 依赖包 <dependency> <groupId>net.lingala.zip4j</groupId> <artifactId>zip4j</artifactId> <version>1.3.1</version> </dependency> 执行用例 package com.example.o
阅读全文
posted @ 2022-04-19 23:52 许伟强
阅读(1310)
评论(0)
推荐(0)
2022年4月12日
国际化软件如何保证MySQL的时间是正确的
摘要: 时间戳 UNIX 时间 是没有时区概念的都是按照伦敦时间 UTC 1970年1月1日00:00:00 时间戳 UNIX 时间 是没有时区概念的都是按照伦敦时间 UTC 1970年1月1日00:00:00 MySQL数据库存储列最好是 int64 存储 UNIX 时间 如果展示为中国北京时间,那么如果
阅读全文
posted @ 2022-04-12 23:25 许伟强
阅读(1659)
评论(0)
推荐(0)
2022年4月9日
golang log类记录日志和输出
摘要: osFile, err := os.OpenFile("log.txt", os.O_WRONLY|os.O_CREATE, 0755) if err != nil { log.Fatalf("create file log.txt failed: %v", err) } logger := log
阅读全文
posted @ 2022-04-09 11:02 许伟强
阅读(441)
评论(0)
推荐(0)
2022年4月2日
java获取压缩文件的文件内容和文件后缀名
摘要: /** * 获取压缩文件解压后的内容和文件类型 * * @param inputStream 压缩文件流 * @return * @author 许伟强51189 * @date 2022/4/1 17:10 * @throws XthIncidentException 发生异常时 */ priva
阅读全文
posted @ 2022-04-02 09:30 许伟强
阅读(1693)
评论(0)
推荐(0)
2022年3月30日
springboot的错误处理
摘要: 比如自定义的 HelloException \ @ResponseBody给参数赋值因为post的json不存在时候的 HttpMessageNotReadableException 不做处理的话,程序会直接相应404、500之类信息,如何接收呢 那就是用最常用也是最好用的方式,添加一个Except
阅读全文
posted @ 2022-03-30 13:22 许伟强
阅读(143)
评论(0)
推荐(0)
Java容易混淆的valid
摘要: 1、验证integer字段 @NotNull -- key存在 \ 可以为空字符串"" @Range -- 判定数字值范围 2、验证String字段 @NotNull key存在 \ 可以为空字符串"" @NotEmpty key存在 \ 非空字符串"" \ 但有可能是" " ,只能用于字符串 @N
阅读全文
posted @ 2022-03-30 12:40 许伟强
阅读(100)
评论(0)
推荐(0)
2022年3月22日
go初始化一个项目
摘要: go mod init example.com/m/v2 go get golang.org/x/crypto/bcrypt
阅读全文
posted @ 2022-03-22 12:51 许伟强
阅读(393)
评论(0)
推荐(0)
上一页
1
2
3
4
5
6
7
8
9
10
···
20
下一页
公告