优化代码语法

This commit is contained in:
2026-07-26 16:36:07 +08:00
parent b1064475e2
commit 90238cd0bf
2 changed files with 4 additions and 4 deletions
@@ -207,7 +207,7 @@ public class LogBusServiceImpl implements LogBusService, BaseParams {
*/ */
@Override @Override
public Map<Integer, Long> getTotalByDay(Instant time) { public Map<Integer, Long> getTotalByDay(Instant time) {
Map<Integer, Long> result = new HashMap<>(); Map<Integer, Long> result = new HashMap<>(CP_NUM16);
if (Objects.isNull(time)) { if (Objects.isNull(time)) {
return result; return result;
} }
@@ -211,11 +211,11 @@ public class SysOptLogServiceImpl implements SysOptLogService, BaseParams {
@Override @Override
public Result<List<SysOptLogAccountResp>> getAccountList(SysOptLogAccountReq req) { public Result<List<SysOptLogAccountResp>> getAccountList(SysOptLogAccountReq req) {
Instant[] range = req.getGmtCreateRange(); Instant[] range = req.getGmtCreateRange();
if (Objects.isNull(range) || range.length != 2) { if (Objects.isNull(range) || range.length != CP_NUM2) {
throw new BizWarning("时间范围不能为空且需要包含开始和结束时间"); throw new BizWarning("时间范围不能为空且需要包含开始和结束时间");
} }
Instant startTime = range[0]; Instant startTime = range[CP_NUM0];
Instant endTime = range[1]; Instant endTime = range[CP_NUM1];
if (startTime.isAfter(endTime)) { if (startTime.isAfter(endTime)) {
throw new BizWarning("开始时间不能大于结束时间"); throw new BizWarning("开始时间不能大于结束时间");
} }