摘要: 今天用nacos做配置中心,发现一只读取不到nacos的配置,发现是因为bootstrap.properties根本没有加载。发现原因是 2020版本以后,添加spring-cloud-context是没有用的,因为官方重构了bootstrap引导配置的加载方式 需要增加如下依赖: <depende 阅读全文
posted @ 2021-09-06 00:18 hulian425 阅读(466) 评论(0) 推荐(0) 编辑
摘要: hello world package main import "fmt" func main() { /* 这是我的第一个简单的程序 */ fmt.Println("Hello, World!") } 格式化字符串 package main import ( "fmt" ) func main() 阅读全文
posted @ 2021-06-09 13:14 hulian425 阅读(39) 评论(0) 推荐(0) 编辑
摘要: limit len countNum; len: 偏移量 从len后面一条开始显示 countNum: 每条显示页数 len = (页数-1)*countNum; 阅读全文
posted @ 2021-05-30 17:21 hulian425 阅读(21) 评论(0) 推荐(0) 编辑
摘要: 1. 下载nodejs 2. 新建一个文件夹, 执行命令node init --yes 3.安装express框架 npm i express 4. 新建js 文件*** // 1. 引入express const express = require('express'); // 2. 创建应用对象 阅读全文
posted @ 2021-05-16 15:49 hulian425 阅读(73) 评论(0) 推荐(0) 编辑
摘要: + + + + + + + + + + | stream of elements + > |filter+-> |sorted+-> |map+-> |collect| + + + + + + + + + + stream() − 为集合创建串行流。 forEach Stream 提供了新的方法 ' 阅读全文
posted @ 2021-05-12 14:59 hulian425 阅读(115) 评论(0) 推荐(0) 编辑
摘要: <sql id="insertColumn"> data_job_id, ds_info, src_ds_type, dst_ds_type, scene_state, last_checked_time, check_period_ms, last_round_reset_time, round_ 阅读全文
posted @ 2021-05-10 12:22 hulian425 阅读(24) 评论(0) 推荐(0) 编辑
摘要: 写了个每日一报的python脚本,但是每天还是要手动点击程序,如果电脑能够自动帮我再规定时间运行程序就好了,研究了一下,linux就有这个命令 在服务器上使用命令 `crontab -e` 在里面添加 就会在每天的0点执行命令。 具体关于crontab的用法可以自行搜索 阅读全文
posted @ 2021-05-09 16:14 hulian425 阅读(162) 评论(0) 推荐(0) 编辑
摘要: Public enum method unconditionally sets its field 枚举类中set方法私有是一个安全的写法,如果共有可能会被恶意代码篡改 尽管可变枚举字段可能用于延迟初始化,但将它们暴露于外部世界是一种不好的做法。请考虑删除此方法或将其声明为包私有。 Potentia 阅读全文
posted @ 2021-05-07 14:43 hulian425 阅读(451) 评论(0) 推荐(0) 编辑
摘要: 主要用到的是org.apache.commons.lang3包下的RandomStringUtils 随机英文字符串 /** * 创建一个随机字符串,其长度是指定的字符数,字符将从参数的字母数字字符集中选择,如参数所示。 * count:计算创建的随机字符长度 * start:字符集在开始时的位置 阅读全文
posted @ 2021-05-07 11:17 hulian425 阅读(1004) 评论(0) 推荐(0) 编辑
摘要: 1. 异常上抛,原则上不吞异常,除非你明确吞异常的业务用途 2. IO操作一定要用try-resource public static SqlSessionFactory initSqlSessionFactory() { String resource = RESOURCE; try (Input 阅读全文
posted @ 2021-04-20 14:17 hulian425 阅读(124) 评论(0) 推荐(0) 编辑