Spring Boot配置文件读取中文乱码
【问题】在配置文件application.properties中配置一个值含有中文的变量。 spring加载配置之后,读取的变量中文部分出现乱码。 根据CSDN说的一堆办法,改encoding为UTF-8,都试过了统统不好使。 【解决方法】知乎上有人说: 配置文件可以用yml文件来代替properties文件, yml文件是支持中文的,并且利用换行缩进来避免重复的前缀。 照做之后问题解决。但是注意:data source中jdbc url中的转义符号反斜杠“\”必须去掉。 from:https://www.cnblogs.com/tigerhsu/p/9794072.html
View Details解决 fatal: refusing to merge unrelated histories
Git 的报错 一、fatal: refusing to merge unrelated histories 新建了一个仓库之后,把本地仓库进行关联提交、拉取的时候,出现了如下错误:
1 2 3 |
ankobot@DESKTOP-9IUDMKP MINGW64 /e/workspace/firmware_upload/firmware_upload (master) $ git pull fatal: refusing to merge unrelated histories |
二、解决方案 在你操作命令后面加 –allow-unrelated-histories 例如:
1 |
git merge master --allow-unrelated-histories |
1 2 3 4 |
$ git pull --allow-unrelated-histories CONFLICT (add/add): Merge conflict in .gitignore Auto-merging .gitignore Automatic merge failed; fix conflicts and then commit the result. |
我这里由于使用了官方的 .gitignore 自动合并失败,需要手动合并之后再进行 add、commit 即可 如果你是git pull或者git push报fatal: refusing to merge unrelated histories 同理: git pull origin master --allow-unrelated-histories / git pull --allow-unrelated-histories 等等,就是这样完美的解决! from:https://blog.51cto.com/laok8/2454524
View DetailsSpring Boot 学习资料汇总
今天开始学习并转载大神【纯洁的微笑】的文章。 收集 Spring Boot 相关的学习资料,Spring Cloud点这里 重点推荐:Spring Boot 中文索引 推荐博客 纯洁的微笑-Spring Boot系列文章 林祥纤-从零开始学Spring Boot Mkyong-Spring Boot教程(国外) baeldung-Spring Boot教程(国外) liaokailin的专栏-Spring Boot实战 catoop的专栏-Spring Boot 学习 方志朋-SpringBoot 非官方教程 嘟嘟-Spring-Boot干货系列 小柒-SpringBoot开发案例 江南一点雨-关于Spring Boot 天码营-Spring Boot 猿天地-Spring Boot 刘冬的博客-Spring Boot 唐亚峰 Battcn-Spring Boot sylvanassun-Spring Boot dalaoyang-Spring Boot 开源 纯洁的微笑 Spring Boot 示例 Spring Boot 官方示例 Spring Boot开源软件 云收藏 Docker+SpringBoot+Mybatis+thymeleaf等技术实现的Java博客系统 Spring boot & Shiro 权限管理系统 Spring Boot实现支付服务:支付宝,微信… Spring Boot后台商城 h5 小程序 基于Spring Boot响应式文件浏览管理器 Spring Boot开源博客 邮件发送服务多种实现,队列,线程定时任务 Spring Boot视频展示项目 Spring Boot项目实践总结 Vue+SpringBoot实现的多用户博客管理平台 Vue+SpringBoot实现的人力资源管理系统 hsweb企业后台管理系统基础框架 一个基于spring boot 实现的股票指数💹爬虫 KKFileView-SpringBoot实现在线预览 boot-websocket-log-SpringBoot实现日志WEB输出 SpringBoot+MyBatis+A pacheShiro+Ehcahe基础平台 leelance Spring Boot各种示例 一个基于Spring […]
View DetailsIDEA打包jar包将依赖包打包到一起
File >Project Structure Artifacts >> JAR >> From……. 第一,选择要打包成jar包的class(对应图中1) 第二,将依赖包一起打包(对应图中2,选择这个) 第三,将依赖包一起下载(对应图中3) 第四, 这是生成 META-INF文件的路径,不能是默认路径,一般直接把src后面的路径删掉就行。 最后点击OK 此时在这里会有META-INF文件,如果选择默认路径这里是没有这个文件的,该文件是指向要运行的class的。 然后右击左上方的JAR文件,选择ADD copy of >>>> Libraby 选择需要的jar包,然后点OK 然后点击上面的Build >> Build Artifacts… 点击Build 此时jar包就会生产在项目的out目录下 此时运行可能会出现 找不到或无法加载主类 的问题 解决办法 借鉴:启动jar包报错: 找不到或无法加载主类亮一点的博客-CSDN博客运行jar包找不到或无法加载主类 打开jar包找到META-INF 原文写 删除jar包META-INF目录下的.SF .DSA ,RSA 后缀文件,但是我只删除了DSA文件就可以了 from:https://zhuanlan.zhihu.com/p/558914730
View DetailsIDEA java: constant string too long 解决
Error:(39,24) java: constant string too long 问题解决: file -> setting -> build, execution, deployment -> compiler -> java compiler -> user compiler: 选择 Eclipse 保存即可;(原本是 javac) from:https://www.cnblogs.com/xj63183/p/15868267.html
View Details关于FastJson几点常用小技巧
反序列化保持字段顺序
1 2 3 4 |
JSONObject respondeBodyJson = JSONObject.parseObject(jsonStr, Feature.OrderedField); // 初始华有序对象 JSONObject retObj = new JSONObject(true); |
序列化保持字段顺序
1 2 3 4 |
JSON.DEFAULT_GENERATE_FEATURE &= ~SerializerFeature.SortField.getMask(); // 序列化时加上参数 String result = JSON.toJSONString(data, new SerializeConfig(true)); |
保留null值的序列化
1 |
String dataStr = JSONObject.toJSONString(dataJSON,SerializerFeature.WriteMapNullValue); |
View Details
Docker安装Apollo
Docker安装Apollo
Docker安装Mysql
拉取镜像
创建挂载目录
创建配置文件
运行容器
连接测试
Docker安装Apollo
拉取镜像
准备配置数据
运行容器
启动config
启动admin
启动portal
运行验证
所遇问题
RSA双向加解密(公钥加密-私钥解密;私钥加密-公钥解密)
非对称加密算法中,提供一个公钥一个私钥。一般情况下,采用公钥加密、私钥解密的方式。 假设有这样一个场景:服务A与服务B需要通信,通信内容为了安全需要进行加密传输,并且服务A与服务B不能互相持有对方的钥匙。
View DetailsSqlSugar中查看生成的SQL语句
注意:Aop一定要设置在你操作语句之前,不然不会生效,还有必须是同一个SqlSuagrClient才会有效
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
public async Task<dynamic> GetNoPagingList([FromQuery] YkzptSafecompanypromiseListQueryInput input) { //每次Sql执行前事件 _db.Aop.OnLogExecuting = (sql, data) => { var n1 = sql; }; var data = await _db.Queryable<YkzptSafecompanypromiseEntity>() .WhereIF(!string.IsNullOrEmpty(input.warehouseId), p => p.WarehouseId.Equals(input.warehouseId)) .Select(it => new YkzptSafecompanypromiseListOutput { id = it.Id, warehouseId = it.WarehouseId, promiseDate = it.PromiseDate, mainPerson = it.MainPerson, promiseContent = it.PromiseContent, companyStateInfor = it.CompanyStateInfor, }).MergeTable().OrderBy(sidx + " " + input.sort).ToListAsync(); return data; } |
全局
1 2 3 4 5 6 7 8 9 10 11 12 |
public DbContext() { Db = Instance; //调式代码 用来打印SQL Db.Aop.OnLogExecuting = (sql, pars) => { string s = sql; Console.WriteLine(sql + "\r\n" + Db.Utilities.SerializeObject(pars.ToDictionary(it => it.ParameterName, it => it.Value))); Console.WriteLine(); }; } |
from:https://www.cnblogs.com/canfengfeixue/p/15649378.html
View Details