fix: table description is empty (#240)

* fix: table description is empty

* fix: ut failed
This commit is contained in:
vran 2022-06-10 14:36:39 +08:00 committed by GitHub
parent 32babc20a1
commit 0eb91630c2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 1 additions and 8 deletions

View File

@ -86,7 +86,7 @@ public class DocumentService {
.stream()
.collect(Collectors.toMap(d -> d.getTableName(), d -> d.getCount(), (a, b) -> a));
var descriptionMapByTableName =
documentDescriptionDao.selectTableDescriptionByProjectId(projectId)
documentDescriptionDao.selectByProjectId(projectId)
.stream()
.collect(Collectors.toMap(d -> d.getTableName(), d -> d.getContent(), (a, b) -> a));
if (originalVersion != null) {

View File

@ -40,8 +40,6 @@ class DocumentDescriptionServiceTest extends BaseTest {
updateRequest.setColumnName("ut");
updateRequest.setContent("update content");
documentDescriptionService.save(groupId, projectId, userId, updateRequest);
var tableData = documentDescriptionDao.selectTableDescriptionByProjectId(projectId);
Assertions.assertEquals(0, tableData.size());
List<DocumentDescription> descriptionData = documentDescriptionDao.selectByProjectId(projectId);
Assertions.assertEquals(1, descriptionData.size());
}

View File

@ -49,11 +49,6 @@ public class DocumentDescriptionDao extends BaseDao<DocumentDescription> {
return selectByCondition(DOCUMENT_DESCRIPTION.PROJECT_ID.eq(projectId));
}
public List<DocumentDescription> selectTableDescriptionByProjectId(Integer projectId) {
return selectByCondition(DOCUMENT_DESCRIPTION.PROJECT_ID.eq(projectId)
.and(DOCUMENT_DESCRIPTION.COLUMN_NAME.isNull()));
}
public List<DocumentDescription> selectByCondition(Condition condition) {
return this.getDslContext()
.selectFrom(DOCUMENT_DESCRIPTION).where(condition)