refactor diff api (#138)

* ref: migrate diff logic to list api

* feat: update frontend resources

* fix: checkstyle
This commit is contained in:
vran
2022-04-30 23:03:20 +08:00
committed by GitHub
parent ba60cf12e1
commit 573a82b96d
39 changed files with 625 additions and 149 deletions

View File

@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -30,7 +31,7 @@ public class TableColumnDocumentDao extends BaseDao<TableColumnDocumentPojo> {
}
public List<TableColumnDocumentPojo> selectByDatabaseDocumentIdAndTableIdIn(Integer schemaDocumentId,
List<Integer> tableIdIn) {
Collection<Integer> tableIdIn) {
if (tableIdIn == null || tableIdIn.isEmpty()) {
return Collections.emptyList();
}

View File

@@ -7,6 +7,7 @@ import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.Optional;
@@ -32,7 +33,7 @@ public class TableDocumentDao extends BaseDao<TableDocumentPojo> {
}
public List<TableDocumentPojo> selectByDatabaseDocumentIdAndIdIn(Integer databaseDocumentId,
List<Integer> idList) {
Collection<Integer> idList) {
if (idList == null || idList.isEmpty()) {
return Collections.emptyList();
}
@@ -60,4 +61,16 @@ public class TableDocumentDao extends BaseDao<TableDocumentPojo> {
.and(TABLE_DOCUMENT.ID.eq(id)))
.fetchOptionalInto(TableDocumentPojo.class);
}
public List<Integer> selectTableIdsByDatabaseDocumentIdAndTableNameIn(Integer databaseDocumentId,
Collection<String> tableNames) {
if (tableNames == null || tableNames.isEmpty()) {
return Collections.emptyList();
}
return getDslContext()
.select(TABLE_DOCUMENT.ID).from(TABLE_DOCUMENT)
.where(TABLE_DOCUMENT.DATABASE_DOCUMENT_ID.eq(databaseDocumentId)
.and(TABLE_DOCUMENT.NAME.in(tableNames)))
.fetchInto(Integer.class);
}
}

View File

@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -30,7 +31,7 @@ public class TableForeignKeyDocumentDao extends BaseDao<TableForeignKeyDocumentP
}
public List<TableForeignKeyDocumentPojo> selectByDatabaseDocumentIdAndTableIdIn(Integer databaseDocumentId,
List<Integer> tableIdIn) {
Collection<Integer> tableIdIn) {
if (tableIdIn == null || tableIdIn.isEmpty()) {
return Collections.emptyList();
}

View File

@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -30,7 +31,7 @@ public class TableIndexDocumentDao extends BaseDao<TableIndexDocumentPojo> {
}
public List<TableIndexDocumentPojo> selectByDatabaseDocumentIdAndIdIn(Integer documentId,
List<Integer> tableIdIn) {
Collection<Integer> tableIdIn) {
if (tableIdIn == null || tableIdIn.isEmpty()) {
return Collections.emptyList();
}

View File

@@ -6,6 +6,7 @@ import org.jooq.DSLContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
@@ -30,7 +31,7 @@ public class TableTriggerDocumentDao extends BaseDao<TableTriggerDocumentPojo> {
}
public List<TableTriggerDocumentPojo> selectByDatabaseDocumentIdAndIdIn(Integer documentId,
List<Integer> tableIdIn) {
Collection<Integer> tableIdIn) {
if (tableIdIn == null || tableIdIn.isEmpty()) {
return Collections.emptyList();
}