IDEA编译乱码 Build Output提示信息乱码 出现乱码如下图
解决方案与一下是一样的:点击 help->edit custom vm options 然后加上 -Dfile.encoding=utf-8 重启一下就好了********
4.idea 控制台乱码解决方案: 可以点击 help->edit custom vm options 然后加上 -Dfile.encoding=utf-8 重启一下就好了********
mysql in 超过1000条报错
解决方案一
<select id="selectOneCarInfoByIds" parameterType="java.util.List" resultType="com.csg.dgri.gmp.sp.application.powergridresource.pem.carequipmenttire.apply.model.VehicleInfoVO">
SELECT V.* from SP_PV_VEHICLE_INFO V where V.ID in
<trim suffixOverrides="OR V.ID IN()">
<foreach collection="list" item="idItem" index="index" open="(" close=")">
<if test="index !=0">
<choose>
<when test="index % 1000 == 999">) OR T.ID IN (</when>
<otherwise>,</otherwise>
</choose>
</if>
#{idItem}
</foreach>
</trim>
</select>
1.使用lombok的@Builder时注意加@NoArgsConstructor 无参构造。不然会报错。因为@Builder会创建一个全参数的构造函数,但并未创建无参构造函数
(no Creators, like default construct, exist): cannot deserialize from Object
2.正则表达式
//只能以字母和数字和_.@开头,内容可以包含字母数字.-_@
Predicate<String> matchLoginName = loginName -> ReUtil.isMatch("^[a-zA-Z0-9@._][a-zA-Z0-9@_.-]*$", loginName);
//不能以. .git .atom 结尾
matchLoginName = matchLoginName.and(loginName -> !StrUtil.endWithAny(loginName, ".", ".git", ".atom"));
if (matchLoginName.negate().test(vo.getLoginName())) {
throw new IamAppCommException("user.loginName.content");
}
其中@符号不要放到-后面。这样如果包含-的字符串就过不去。错误示范:
^[a-zA-Z0-9._@][a-zA-Z0-9_.-@]*$
3.http://10.54.16.148:8096/actuator/health
{“status”:"DOWN "} 这个是失败
{“status”:“UP”} 这样才是正常
因为好好得服务突然运行不起来了。找了很久。服务是启动了,但是注册不进去。也没有报错。最后通过health 发现是DOWN.然后百度。结果是
因为这个服务的pom文件中引入了redis,然后uat环境是测试发布的。他们把配置文件中的redis的配置没有配置正确,导致无法通过springbootadmin的健康检测,eureka 显示状态为 down。
如何打开health 点击红圈圈内
把info改成health
UP代表正常, DOWN代表有问题