
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
e-invoice-validator是一个小型服务,用于根据factur-x、Peppol BIS、XRechnung和EN***的官方schematron规则验证XML文件。它暴露验证接口,接收待验证XML并返回包含警告或错误的JSON结果,HTTP状态码200表示有效,400表示存在问题,支持UBL和CII格式。
该服务以容器化设计为主,建议通过Docker镜像部署,并从主应用向服务发送HTTP请求完成验证。
服务提供健康检查接口/health(用于确认服务就绪)和/swagger(OpenAPI文档入口):
yamle-invoice-validator: image: 'docker.xuanyuan.run/easybill/e-invoice-validator:latest' ports: - '8081:8080' environment: JAVA_TOOL_OPTIONS: -Xmx512m healthcheck: test: curl --fail http://localhost:8081/health || exit 0 interval: 10s retries: 6
bashdocker compose up --detach --wait --wait-timeout 30
PHP<?php declare(strict_types=1); final class EN16931Validator { public function isValid(string $xml): ?bool { $httpClient = new Client(); $response = $httpClient->request('POST', 'http://localhost:8081/validation', [ RequestOptions::HEADERS => [ 'Content-Type' => 'application/json', ], RequestOptions::BODY => $xml, RequestOptions::TIMEOUT => 10, RequestOptions::CONNECT_TIMEOUT => 10, RequestOptions::HTTP_ERRORS => false, ]); return 200 === $response->getStatusCode(); } }
JSON{ "meta": { "xml_syntax_type": "CII", "xml_profile_type": "FACTURX_EXTENDED" }, "errors": [], "warnings": [], "is_valid": true }
JSON{ "meta": { "xml_syntax_type": "CII", "xml_profile_type": "EN16931" }, "errors": [ { "rule_id": "BR-CO-15", "rule_location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]", "rule_severity": "FATAL", "rule_messages": [ "[BR-CO-15]-Invoice total amount with VAT (BT-112) = Invoice total amount without VAT (BT-109) + Invoice total VAT amount (BT-110)." ] }, { "rule_id": "BR-CL-04", "rule_location": "/*:CrossIndustryInvoice[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:SupplyChainTradeTransaction[namespace-uri()='urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100'][1]/*:ApplicableHeaderTradeSettlement[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]/*:InvoiceCurrencyCode[namespace-uri()='urn:un:unece:uncefact:data:standard:ReusableAggregateBusinessInformationEntity:100'][1]", "rule_severity": "FATAL", "rule_messages": [ "[BR-CL-04]-Invoice currency code MUST be coded using ISO code list 4217 alpha-3" ] } ], "warnings": [], "is_valid": false }
通过设置BUGSNAG_API_KEY环境变量启用Bugsnag错误报告:
yamle-invoice-validator: image: 'docker.xuanyuan.run/easybill/e-invoice-validator:latest' ports: - '8081:8080' environment: JAVA_TOOL_OPTIONS: -Xmx512m BUGSNAG_API_KEY: <你的API密钥> healthcheck: test: curl --fail http://localhost:8081/health || exit 0 interval: 10s retries: 6
欢迎提交Pull Request或Issue反馈问题或改进建议。
待更新
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务