feat: 站点列表显示适配版本和状态,支持查看配置内容
This commit is contained in:
@@ -23,6 +23,8 @@ public class SiteDTO {
|
||||
private SiteType siteType;
|
||||
private String schemaVersion;
|
||||
private SiteStatus status;
|
||||
private String latestVersion;
|
||||
private String configStatus;
|
||||
private LocalDateTime createdAt;
|
||||
private LocalDateTime updatedAt;
|
||||
}
|
||||
|
||||
@@ -9,7 +9,9 @@ import com.par.core.entity.Site;
|
||||
import com.par.core.entity.SiteChange;
|
||||
import com.par.core.enums.SiteStatus;
|
||||
import com.par.core.enums.SiteType;
|
||||
import com.par.core.entity.SiteConfig;
|
||||
import com.par.core.mapper.SiteChangeMapper;
|
||||
import com.par.core.mapper.SiteConfigMapper;
|
||||
import com.par.core.mapper.SiteMapper;
|
||||
import com.par.core.service.SiteService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
@@ -29,6 +31,7 @@ public class SiteServiceImpl implements SiteService {
|
||||
|
||||
private final SiteMapper siteMapper;
|
||||
private final SiteChangeMapper changeMapper;
|
||||
private final SiteConfigMapper siteConfigMapper;
|
||||
private static final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
// ==================== 工具方法 ====================
|
||||
@@ -84,6 +87,12 @@ public class SiteServiceImpl implements SiteService {
|
||||
dto.setSiteType(site.getSiteType());
|
||||
dto.setSchemaVersion(site.getSchemaVersion());
|
||||
dto.setStatus(site.getStatus());
|
||||
// 填充适配信息:最新版本号和状态
|
||||
SiteConfig latest = siteConfigMapper.selectLatestBySiteId(site.getSiteId());
|
||||
if (latest != null) {
|
||||
dto.setLatestVersion(latest.getVersion());
|
||||
dto.setConfigStatus(latest.getStatus() != null ? latest.getStatus().getValue() : null);
|
||||
}
|
||||
dto.setCreatedAt(site.getCreatedAt());
|
||||
dto.setUpdatedAt(site.getUpdatedAt());
|
||||
return dto;
|
||||
|
||||
Reference in New Issue
Block a user