
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Document Store API是一个基于Dropwizard的应用程序,用于对MongoDB进行读写操作。该应用提供两种内容读取端点:/content-read/{uuid}用于按API设计契约返回格式化内容,确保响应格式符合规范;/content/{uuid}用于直接读取MongoDB中的原始文档,无格式限制。此外,应用还支持独立的列表(list)操作,其读写逻辑与内容操作分离。
%m%n以适配监控工具适用于需要高效文档存储与检索的后端服务,如内容管理系统、新闻资讯平台等场景,支持结构化文档和列表数据的管理需求。
编译构建JAR包
sh# 跳过测试编译 mvn clean package -Djava.net.preferIPv4Stack=true -Dmaven.test.skip=true # 仅运行非集成测试 mvn clean package -Djava.net.preferIPv4Stack=true -Dshort # 运行所有测试(需本地MongoDB) docker-compose up mongodb -d MONGO_TEST_URL=localhost:27017 -Djava.net.preferIPv4Stack=true mvn clean package
启动应用
shjava -jar target/document-store-api-0.0.1-SNAPSHOT.jar server config-local.yml
Docker镜像构建
需传递Nexus服务器认证参数:
shdocker build -t coco/document-store-api --build-arg SONATYPE_USER=upp-nexus --build-arg SONATYPE_PASSWORD=AvailableInLastPass .
注意:自2016-10-18起,不再部署至UCS环境。
内容操作(Content)
创建/更新内容(PUT)
http://localhost:14180/content/{uuid}Content-Type: application/jsonjson{ "uuid": "3b7b7702-debf-11e4-b9ec-00144feab7de", "title": "Ukraine looks to foreign-born ministers to kick-start reform", "titles": null, "byline": "Roman Olearchyk, Kiev, and Neil Buckley, London", "brands": [ { "id": "http://api.ft.com/things/dbb0bdae-1f0c-11e4-b0cb-b2227cce2b54" } ], "identifiers": [ { "authority": "http://api.ft.com/system/FTCOM-METHODE", "identifierValue": "3b7b7702-debf-11e4-b9ec-00144feab7de" } ], "publishedDate": "2015-04-15T08:33:02.000Z", "body": "<body><content data-embedded=\"true\" id=\"937885ac-e2bc-11e4-347b-978e959e1c97\" type=\"http://www.ft.com/ontology/content/ImageSet\"></content><p>Late last year, US-born Natalie Jaresko was in the Kiev office of the investment firm she founded in 2006 when headhunters came to call. Within days she was named as finance minister of war-torn country.</p></body>", "description": null, "mediaType": null, "pixelWidth": null, "pixelHeight": null, "internalBinaryUrl": null, "members": null, "mainImage": "937885ac-e2bc-11e4-347b-978e959e1c97" }
删除内容(DELETE)
http://localhost:14180/content/{uuid}Content-Type: application/json获取内容(GET)
GET http://localhost:14180/content/{uuid},返回与PUT请求体格式一致的JSONPOST /{collection}?mget=true,请求体为UUID数组,返回找到的内容数组(未找到则返回空数组)
json[ "fd204ed1-d53d-4b24-99a7-fc62a6778808", "4f97b689-d3e4-4ae2-ac34-9abc97a46c28", "c86ccb61-38d2-42bd-bb2f-9c69e1fca178" ]
GET http://localhost:14180/content?uuid={uuid1}&uuid={uuid2}...,受URI长度限制(2083字符)按标识符查询内容
GET http://localhost:14180/content-query?identifierAuthority={authority}&identifierValue={identifierValue}GET /content-query?identifierAuthority=http://api.ft.com/system/FT-LABS-WP-1-335&identifierValue=http://www.ft.com/fastft/2015/12/09/south-african-rand-dives-after-finance-ministers-exit/ HTTP/1.1列表操作(List)
创建/更新列表(PUT)
http://localhost:14180/lists/{uuid}Content-Type: application/jsonjson{ "uuid": "3c99c2ba-a6ae-11e2-95b1-00144feabdc0", "title": "Test List", "concept": { "uuid": "78d878ac-6226-47e4-84b1-39a127e3cc11", "prefLabel": "Markets" }, "listType": "TopStories", "items" : [ { "uuid": "0237b884-d124-11e2-be7b-00144feab7de" }, { "uuid": "68340f9f-67c3-33cd-97b1-f07bea7ce714" }, { "webUrl": "http://video.ft.com/3887333300001/Thames-tour-shows-changing-London-skyline/life-and-arts" } ] }
concept和listType为可选字段;若提供concept,则uuid和prefLabel为必填;数据存储中不允许存在相同concept和listType的多个列表,重复时将触发Splunk告警。获取列表(GET)
GET http://localhost:14180/lists/{uuid}GET http://localhost:14180/lists?curatedTopStoriesFor={concept-uuid}(支持多种列表类型,如curatedOpinionAndAnalysisFor),返回单条结果(多条匹配时返回一条并记录错误日志)删除列表(DELETE)
http://localhost:14180/lists/{uuid}Content-Type: application/json如需添加新资源类型,需在DocumentStoreApiApplication中为所需操作添加新的链处理器,处理器(Handler)和目标(Targets)可在多链中复用。
使用slf4j-json-logger库,日志格式固定为%m%n(详见https://github.com/savoirtech/slf4j-json-logger#logging-configuration%EF%BC%89%EF%BC%8C%E4%BB%A5%E9%80%82%E9%85%8DSplunk%E7%AD%89%E7%9B%91%E6%8E%A7%E5%B7%A5%E5%85%B7%E7%9A%84%E4%BA%8B%E4%BB%B6%E6%9F%A5%E8%AF%A2%E3%80%82
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务