Skip to content

Commit a4f96cb

Browse files
authored
Merge pull request #1484 from congyuluo/identifier-refactorings
Refactored Identifiers
2 parents f30992c + 6081435 commit a4f96cb

File tree

4 files changed

+14
-14
lines changed

4 files changed

+14
-14
lines changed

chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/DashboardServiceImpl.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ public DataResult<Long> createWithPermission(DashboardCreateParam param) {
6666

6767
@Override
6868
public ActionResult updateWithPermission(DashboardUpdateParam param) {
69-
Dashboard data = queryExistent(param.getId()).getData();
70-
PermissionUtils.checkOperationPermission(data.getUserId());
69+
Dashboard dashboardData = queryExistent(param.getId()).getData();
70+
PermissionUtils.checkOperationPermission(dashboardData.getUserId());
7171

7272
param.setGmtModified(LocalDateTime.now());
7373
DashboardDO dashboardDO = dashboardConverter.updateParam2do(param);
@@ -106,14 +106,14 @@ public DataResult<Dashboard> queryExistent(DashboardQueryParam param) {
106106
if (CollectionUtils.isEmpty(page.getRecords())) {
107107
throw new DataNotFoundException();
108108
}
109-
Dashboard data = dashboardConverter.do2model(page.getRecords().get(0));
109+
Dashboard dashboardData = dashboardConverter.do2model(page.getRecords().get(0));
110110
LambdaQueryWrapper<DashboardChartRelationDO> dashboardChartRelationQueryWrapper = new LambdaQueryWrapper<>();
111111
dashboardChartRelationQueryWrapper.eq(DashboardChartRelationDO::getDashboardId, param.getId());
112112
List<DashboardChartRelationDO> relationDO = getMapper1().selectList(
113113
dashboardChartRelationQueryWrapper);
114114
List<Long> chartIds = relationDO.stream().map(DashboardChartRelationDO::getChartId).toList();
115-
data.setChartIds(chartIds);
116-
return DataResult.of(data);
115+
dashboardData.setChartIds(chartIds);
116+
return DataResult.of(dashboardData);
117117
}
118118

119119
@Override

chat2db-server/chat2db-server-domain/chat2db-server-domain-core/src/main/java/ai/chat2db/server/domain/core/impl/DatabaseServiceImpl.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -87,16 +87,16 @@ private void sortSchema(List<Schema> schemas, Connection connection) {
8787
log.error("get url error", e);
8888
}
8989
// If the database name contains the name of the current database, the current database is placed in the first place
90-
int num = -1;
90+
int targetIndex = -1;
9191
for (int i = 0; i < schemas.size(); i++) {
9292
String schema = schemas.get(i).getName();
9393
if (StringUtils.isNotBlank(ulr) && schema!=null && ulr.contains(schema)) {
94-
num = i;
94+
targetIndex = i;
9595
break;
9696
}
9797
}
98-
if (num != -1 && num != 0) {
99-
Collections.swap(schemas, num, 0);
98+
if (targetIndex != -1 && targetIndex != 0) {
99+
Collections.swap(schemas, targetIndex, 0);
100100
}
101101
}
102102

chat2db-server/chat2db-server-start/src/main/java/ai/chat2db/server/start/config/config/Chat2dbWebMvcConfigurer.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,12 @@ public boolean preHandle(@NotNull HttpServletRequest request, @NotNull HttpServl
7575
if (user == null) {
7676
return null;
7777
}
78-
boolean admin = RoleCodeEnum.ADMIN.getCode().equals(user.getRoleCode());
78+
boolean iaAdmin = RoleCodeEnum.ADMIN.getCode().equals(user.getRoleCode());
7979

8080
return LoginUser.builder()
8181
.id(user.getId())
8282
.nickName(user.getNickName())
83-
.admin(admin)
83+
.admin(iaAdmin)
8484
.roleCode(user.getRoleCode())
8585
.build();
8686
});

chat2db-server/chat2db-server-web-start/src/main/java/ai/chat2db/server/web/start/config/config/Chat2dbWebMvcConfigurer.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -190,10 +190,10 @@ private String buildHeaderString(HttpServletRequest request) {
190190
StringBuilder stringBuilder = new StringBuilder();
191191
Enumeration<String> headerNames = request.getHeaderNames();
192192
while (headerNames.hasMoreElements()) {
193-
String headName = headerNames.nextElement();
194-
stringBuilder.append(headName);
193+
String headerName = headerNames.nextElement();
194+
stringBuilder.append(headerName);
195195
stringBuilder.append(SymbolConstant.COLON);
196-
stringBuilder.append(request.getHeader(headName));
196+
stringBuilder.append(request.getHeader(headerName));
197197
stringBuilder.append(SymbolConstant.COMMA);
198198
}
199199
return stringBuilder.toString();

0 commit comments

Comments
 (0)