濤。

t.

2023年8月17日

mac m1 docker安装redis

摘要: 1、拉取镜像 docker pull redis #查询版本(docker search redis) 2、启动服务 docker run --name redis-docker --restart always --privileged=true \-p 6379:6379 \-d redis \ 阅读全文

posted @ 2023-08-17 17:00 濤。 阅读(107) 评论(0) 推荐(0)

mac m1 docker安装mqtt服务

摘要: 1.拉取镜像 docker pull registry.cn-hangzhou.aliyuncs.com/synbop/emqttd:2.3.6或docker pull emqx/emqx -- 重命名镜像 docker tag registry.cn-hangzhou.aliyuncs.com/s 阅读全文

posted @ 2023-08-17 17:00 濤。 阅读(190) 评论(0) 推荐(0)

2023年8月16日

int类型相除,转bigdecimal保留两位小数

摘要: int a = 2;int b = 9;BigDecimal a1 = BigDecimal.valueOf(a);BigDecimal b1 = BigDecimal.valueOf(b);BigDecimal c = a1.divide(b1, 2, RoundingMode.HALF_UP); 阅读全文

posted @ 2023-08-16 17:13 濤。 阅读(172) 评论(0) 推荐(0)

2023年4月27日

SpringBoot关于自动注入service、mapper为空的坑

摘要: 普通类Test要注入**service、**mapper,在此类上加注解 @Component,此注解的作用是将该类被springboot扫描 注意::: 注意::: 注意::: 这个Test类在别处引用,千万不要直接new Test(),否则不会自动注入**service、**mapper 如果想 阅读全文

posted @ 2023-04-27 16:42 濤。 阅读(579) 评论(0) 推荐(0)

Cannot resolve method 'keys' in 'JSONObject'

摘要: //""自定义 String str = ""; JSONObject object = JSONObject.fromObject(str);Map<String, Object> conditionMap = new HashMap<String, Object>();Iterator<Stri 阅读全文

posted @ 2023-04-27 16:42 濤。 阅读(400) 评论(0) 推荐(0)

Java去掉字符串最后一个字符

摘要: 字符串:String str = "1,2,3,4,5,"; 目标:去掉最后一个逗号","; 方法:if(str.length() > 1){ str = str.substring(0, str.length() - 1)); } 阅读全文

posted @ 2023-04-27 16:41 濤。 阅读(493) 评论(0) 推荐(0)

使用stream流判断list中对象的某个字段是否有重复值

摘要: 使用stream流判断list中对象的某个字段是否有重复值 思路: 先获取指定字段的列表,再进行去重,再获取列表数量,最后和原列表比较长度 代码: long num = list.stream().map(User::getName).distinct().count();if (num < lis 阅读全文

posted @ 2023-04-27 16:41 濤。 阅读(2135) 评论(0) 推荐(0)

Git常用命令

摘要: 拉取代码命令: git clone 地址/***.git 提交代码命令: git commit -m "**"(**为提交备注) 上传代码命令: # 上传到主分支git push -u origin master 将目前文件夹下所有的文件添加至暂存区命令: git add . 查看暂存区命令: gi 阅读全文

posted @ 2023-04-27 16:40 濤。 阅读(18) 评论(0) 推荐(0)

2023年3月8日

BigDecimal比较大小

摘要: @Test public void compareTo() { BigDecimal a = new BigDecimal(10); BigDecimal b = new BigDecimal(5); if (a.compareTo(b) == 0) System.out.println("a = 阅读全文

posted @ 2023-03-08 16:43 濤。 阅读(44) 评论(0) 推荐(0)

java字符串模糊匹配

摘要: contains //在a中模糊搜索b @Test public void contains(){ String a = "小雨"; String b = "雨"; if(a.contains(b)){ System.out.println("a包含了b"); } } 阅读全文

posted @ 2023-03-08 16:42 濤。 阅读(549) 评论(0) 推荐(0)

导航