上一页 1 2 3 4 5 6 7 8 9 10 ··· 20 下一页
摘要: 临时鉴权使用: void sendEmail(@RequestBody SendDto temp,@RequestHeader("Authorization") String auth); 调用: mailService.sendEmail(sendDto,"Bearer 123456"); 阅读全文
posted @ 2022-04-21 11:26 许伟强 阅读(220) 评论(0) 推荐(0) 编辑
摘要: 依赖地址: 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 许伟强 阅读(39) 评论(0) 推荐(0) 编辑
摘要: 依赖地址(这里我们用的版本是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 许伟强 阅读(58) 评论(0) 推荐(0) 编辑
摘要: 依赖包 <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 许伟强 阅读(1280) 评论(0) 推荐(0) 编辑
摘要: 时间戳 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 许伟强 阅读(1107) 评论(0) 推荐(0) 编辑
摘要: 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 许伟强 阅读(412) 评论(0) 推荐(0) 编辑
摘要: /** * 获取压缩文件解压后的内容和文件类型 * * @param inputStream 压缩文件流 * @return * @author 许伟强51189 * @date 2022/4/1 17:10 * @throws XthIncidentException 发生异常时 */ priva 阅读全文
posted @ 2022-04-02 09:30 许伟强 阅读(1280) 评论(0) 推荐(0) 编辑
摘要: 比如自定义的 HelloException \ @ResponseBody给参数赋值因为post的json不存在时候的 HttpMessageNotReadableException 不做处理的话,程序会直接相应404、500之类信息,如何接收呢 那就是用最常用也是最好用的方式,添加一个Except 阅读全文
posted @ 2022-03-30 13:22 许伟强 阅读(108) 评论(0) 推荐(0) 编辑
摘要: 1、验证integer字段 @NotNull -- key存在 \ 可以为空字符串"" @Range -- 判定数字值范围 2、验证String字段 @NotNull key存在 \ 可以为空字符串"" @NotEmpty key存在 \ 非空字符串"" \ 但有可能是" " ,只能用于字符串 @N 阅读全文
posted @ 2022-03-30 12:40 许伟强 阅读(87) 评论(0) 推荐(0) 编辑
摘要: go mod init example.com/m/v2 go get golang.org/x/crypto/bcrypt 阅读全文
posted @ 2022-03-22 12:51 许伟强 阅读(364) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 20 下一页