{"openapi": "3.0.3", "info": {"title": "模拟账单服务", "version": "1.0.0", "description": "测试用账单接口。只返回当前 SSO 令牌对应用户的模拟账单，不连接真实账单库。"}, "servers": [{"url": "https://bill.shaoq.com"}], "paths": {"/invoices": {"get": {"operationId": "listInvoices", "summary": "查询当前用户的账单列表", "description": "用户询问自己的账单、发票、费用或欠费时调用。只返回当前访问令牌对应用户和租户的模拟数据。", "parameters": [{"name": "month", "in": "query", "required": false, "description": "账期，格式 YYYY-MM。不传则返回全部模拟账单。", "schema": {"type": "string"}}], "responses": {"200": {"description": "账单列表", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/InvoiceList"}}}}}, "security": [{"sso": ["openid", "profile", "email", "offline_access"]}]}}, "/invoices/{invoiceId}": {"get": {"operationId": "getInvoice", "summary": "查询一张账单", "description": "用户给出账单号，或要看某一张账单的金额和状态时调用。", "parameters": [{"name": "invoiceId", "in": "path", "required": true, "description": "账单号，例如 inv-2026-09。", "schema": {"type": "string"}}], "responses": {"200": {"description": "账单详情", "content": {"application/json": {"schema": {"$ref": "#/components/schemas/Invoice"}}}}}, "security": [{"sso": ["openid", "profile", "email", "offline_access"]}]}}}, "components": {"schemas": {"Invoice": {"type": "object", "properties": {"id": {"type": "string"}, "month": {"type": "string"}, "title": {"type": "string"}, "amount": {"type": "number"}, "currency": {"type": "string"}, "status": {"type": "string", "description": "paid 或 unpaid"}, "username": {"type": "string"}, "tenant_id": {"type": "integer"}}}, "InvoiceList": {"type": "object", "properties": {"username": {"type": "string"}, "email": {"type": "string"}, "tenant_id": {"type": "integer"}, "total_amount": {"type": "number"}, "unpaid_amount": {"type": "number"}, "items": {"type": "array", "items": {"$ref": "#/components/schemas/Invoice"}}}}}, "securitySchemes": {"sso": {"type": "oauth2", "flows": {"authorizationCode": {"authorizationUrl": "https://login.racorecloud.com/oauth/authorize", "tokenUrl": "https://login.racorecloud.com/oauth/token", "scopes": {"openid": "身份", "profile": "资料", "email": "邮箱", "offline_access": "刷新令牌"}}}}}}}