mirror of
https://github.com/CodePhiliaX/Chat2DB.git
synced 2025-08-02 21:50:43 +08:00
Merge pull request #1484 from congyuluo/identifier-refactorings
Refactored Identifiers
This commit is contained in:
@ -66,8 +66,8 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
|
||||
@Override
|
||||
public ActionResult updateWithPermission(DashboardUpdateParam param) {
|
||||
Dashboard data = queryExistent(param.getId()).getData();
|
||||
PermissionUtils.checkOperationPermission(data.getUserId());
|
||||
Dashboard dashboardData = queryExistent(param.getId()).getData();
|
||||
PermissionUtils.checkOperationPermission(dashboardData.getUserId());
|
||||
|
||||
param.setGmtModified(LocalDateTime.now());
|
||||
DashboardDO dashboardDO = dashboardConverter.updateParam2do(param);
|
||||
@ -106,14 +106,14 @@ public class DashboardServiceImpl implements DashboardService {
|
||||
if (CollectionUtils.isEmpty(page.getRecords())) {
|
||||
throw new DataNotFoundException();
|
||||
}
|
||||
Dashboard data = dashboardConverter.do2model(page.getRecords().get(0));
|
||||
Dashboard dashboardData = dashboardConverter.do2model(page.getRecords().get(0));
|
||||
LambdaQueryWrapper<DashboardChartRelationDO> dashboardChartRelationQueryWrapper = new LambdaQueryWrapper<>();
|
||||
dashboardChartRelationQueryWrapper.eq(DashboardChartRelationDO::getDashboardId, param.getId());
|
||||
List<DashboardChartRelationDO> relationDO = getMapper1().selectList(
|
||||
dashboardChartRelationQueryWrapper);
|
||||
List<Long> chartIds = relationDO.stream().map(DashboardChartRelationDO::getChartId).toList();
|
||||
data.setChartIds(chartIds);
|
||||
return DataResult.of(data);
|
||||
dashboardData.setChartIds(chartIds);
|
||||
return DataResult.of(dashboardData);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -87,16 +87,16 @@ public class DatabaseServiceImpl implements DatabaseService {
|
||||
log.error("get url error", e);
|
||||
}
|
||||
// If the database name contains the name of the current database, the current database is placed in the first place
|
||||
int num = -1;
|
||||
int targetIndex = -1;
|
||||
for (int i = 0; i < schemas.size(); i++) {
|
||||
String schema = schemas.get(i).getName();
|
||||
if (StringUtils.isNotBlank(ulr) && schema!=null && ulr.contains(schema)) {
|
||||
num = i;
|
||||
targetIndex = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (num != -1 && num != 0) {
|
||||
Collections.swap(schemas, num, 0);
|
||||
if (targetIndex != -1 && targetIndex != 0) {
|
||||
Collections.swap(schemas, targetIndex, 0);
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user