fix: Manifest 接口也返回 names[]/urls[] 数组 + 文档同步
This commit is contained in:
@@ -140,7 +140,8 @@ curl -H "If-None-Match: a1b2c3d4..." http://par:9012/api/v1/manifest
|
|||||||
"sites": [
|
"sites": [
|
||||||
{
|
{
|
||||||
"siteId": "pthome",
|
"siteId": "pthome",
|
||||||
"name": "PThome",
|
"names": ["PThome", "PThome镜像"],
|
||||||
|
"urls": ["https://pthome.net", "https://pthome.mirror"],
|
||||||
"siteType": "private",
|
"siteType": "private",
|
||||||
"schemaVersion": "1.0.0",
|
"schemaVersion": "1.0.0",
|
||||||
"status": "active",
|
"status": "active",
|
||||||
|
|||||||
@@ -54,8 +54,8 @@ public class ManifestController {
|
|||||||
var dto = siteService.toDTO(site);
|
var dto = siteService.toDTO(site);
|
||||||
Map<String, Object> entry = new HashMap<>();
|
Map<String, Object> entry = new HashMap<>();
|
||||||
entry.put("siteId", site.getSiteId());
|
entry.put("siteId", site.getSiteId());
|
||||||
entry.put("name", dto.getNames() != null && !dto.getNames().isEmpty() ? dto.getNames().get(0) : site.getSiteId());
|
entry.put("names", dto.getNames());
|
||||||
entry.put("baseUrl", dto.getUrls() != null && !dto.getUrls().isEmpty() ? dto.getUrls().get(0) : null);
|
entry.put("urls", dto.getUrls());
|
||||||
entry.put("siteType", site.getSiteType() != null ? site.getSiteType().getValue() : null);
|
entry.put("siteType", site.getSiteType() != null ? site.getSiteType().getValue() : null);
|
||||||
entry.put("schemaVersion", site.getSchemaVersion());
|
entry.put("schemaVersion", site.getSchemaVersion());
|
||||||
entry.put("status", site.getStatus() != null ? site.getStatus().getValue() : null);
|
entry.put("status", site.getStatus() != null ? site.getStatus().getValue() : null);
|
||||||
|
|||||||
Reference in New Issue
Block a user