{
  "tags": [
    "消息"
  ],
  "description": "按 ID 返回 `message` 表的完整消息记录（包含正文及发送状态字段）。接口要求登录。若消息指定了 `receive` 且其值不是当前用户 ID，则仅管理员可查看；服务端不额外检查 `is_show`，因此已登录用户可读取未指定接收者的隐藏消息详情。",
  "operationId": "user_get_v1_messages_message_id",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "成功、消息不存在、接收者权限不足及认证错误均返回 HTTP 200。成功响应的 `msg` 固定为空字符串。",
      "content": {
        "application/json": {
          "schema": {
            "oneOf": [
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "integer",
                    "enum": [
                      0
                    ],
                    "description": "0 表示查询成功。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "详情查询成功时固定为空字符串。"
                  },
                  "data": {
                    "type": "object",
                    "description": "消息表完整记录。布尔数据库字段按 0/1 数值返回。",
                    "required": [
                      "id",
                      "type",
                      "pub_user",
                      "receive",
                      "title",
                      "content",
                      "phone_content",
                      "templ_id",
                      "templ_para",
                      "event_id",
                      "user_package_id",
                      "site_id",
                      "is_show",
                      "is_red",
                      "is_bold",
                      "is_external",
                      "is_popup",
                      "email_need_send",
                      "phone_need_send",
                      "email_is_sent",
                      "phone_is_sent",
                      "url",
                      "sort",
                      "create_at",
                      "update_at"
                    ],
                    "properties": {
                      "id": {
                        "type": "integer",
                        "description": "消息 ID。"
                      },
                      "type": {
                        "type": "string",
                        "nullable": true,
                        "description": "消息类型，例如 announcement。"
                      },
                      "pub_user": {
                        "type": "integer",
                        "nullable": true,
                        "description": "发布者用户 ID。"
                      },
                      "receive": {
                        "type": "integer",
                        "nullable": true,
                        "description": "指定接收用户 ID；为空表示未指定单个接收者。"
                      },
                      "title": {
                        "type": "string",
                        "nullable": true,
                        "description": "消息标题。"
                      },
                      "content": {
                        "type": "string",
                        "nullable": true,
                        "description": "站内消息正文；外部链接消息通常为空字符串。"
                      },
                      "phone_content": {
                        "type": "string",
                        "nullable": true,
                        "description": "短信发送正文。"
                      },
                      "templ_id": {
                        "type": "string",
                        "nullable": true,
                        "description": "消息发送模板 ID。"
                      },
                      "templ_para": {
                        "type": "string",
                        "nullable": true,
                        "description": "模板参数文本。"
                      },
                      "event_id": {
                        "type": "string",
                        "nullable": true,
                        "description": "关联事件标识。"
                      },
                      "user_package_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "关联用户套餐 ID。"
                      },
                      "site_id": {
                        "type": "integer",
                        "nullable": true,
                        "description": "关联网站 ID。"
                      },
                      "is_show": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "展示标记：1 展示，0 隐藏。"
                      },
                      "is_red": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "红色标题标记。"
                      },
                      "is_bold": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "粗体标题标记。"
                      },
                      "is_external": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "外部链接标记：1 使用 url，0 使用 content。"
                      },
                      "is_popup": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "弹窗显示标记。"
                      },
                      "email_need_send": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "是否需要发送邮件通知。"
                      },
                      "phone_need_send": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "是否需要发送短信通知。"
                      },
                      "email_is_sent": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "邮件是否已发送。"
                      },
                      "phone_is_sent": {
                        "type": "integer",
                        "enum": [
                          0,
                          1
                        ],
                        "nullable": true,
                        "description": "短信是否已发送。"
                      },
                      "url": {
                        "type": "string",
                        "nullable": true,
                        "description": "外部消息跳转地址。"
                      },
                      "sort": {
                        "type": "integer",
                        "nullable": true,
                        "description": "排序值。"
                      },
                      "create_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true,
                        "description": "消息创建时间。"
                      },
                      "update_at": {
                        "type": "string",
                        "format": "date-time",
                        "nullable": true,
                        "description": "消息更新时间。"
                      }
                    },
                    "additionalProperties": false
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "message-18",
                      "message-32",
                      "login_required"
                    ],
                    "description": "分别表示消息不存在、指定接收者消息需要管理员权限或认证失败。"
                  },
                  "msg": {
                    "type": "string",
                    "description": "具体错误原因。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "examples": {
            "success": {
              "summary": "查询成功",
              "value": {
                "code": 0,
                "msg": "",
                "data": {
                  "id": 101,
                  "type": "announcement",
                  "pub_user": 1,
                  "receive": null,
                  "title": "服务通知",
                  "content": "系统将在今晚进行维护。",
                  "phone_content": null,
                  "templ_id": null,
                  "templ_para": null,
                  "event_id": null,
                  "user_package_id": null,
                  "site_id": null,
                  "is_show": 1,
                  "is_red": 0,
                  "is_bold": 1,
                  "is_external": 0,
                  "is_popup": 0,
                  "email_need_send": 0,
                  "phone_need_send": 0,
                  "email_is_sent": 0,
                  "phone_is_sent": 0,
                  "url": "",
                  "sort": 100,
                  "create_at": "2026-01-01T12:00:00",
                  "update_at": "2026-01-01T12:00:00"
                }
              }
            },
            "notFound": {
              "summary": "消息不存在",
              "value": {
                "code": "message-18",
                "msg": "消息不存在",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "",
            "data": {
              "id": 101,
              "type": "announcement",
              "pub_user": 1,
              "receive": null,
              "title": "服务通知",
              "content": "系统将在今晚进行维护。",
              "phone_content": null,
              "templ_id": null,
              "templ_para": null,
              "event_id": null,
              "user_package_id": null,
              "site_id": null,
              "is_show": 1,
              "is_red": 0,
              "is_bold": 1,
              "is_external": 0,
              "is_popup": 0,
              "email_need_send": 0,
              "phone_need_send": 0,
              "email_is_sent": 0,
              "phone_is_sent": 0,
              "url": "",
              "sort": 100,
              "create_at": "2026-01-01T12:00:00",
              "update_at": "2026-01-01T12:00:00"
            }
          }
        }
      }
    }
  },
  "x-python-handler": "system.MessageAPI",
  "x-python-route-line": 1047,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "parameters": [
    {
      "name": "message_id",
      "in": "path",
      "required": true,
      "schema": {
        "type": "integer"
      },
      "description": "消息 ID。路由只匹配整数；不存在时返回业务错误。",
      "example": 101
    }
  ],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "system.MessageAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 1047
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "get",
  "path": "/v1/messages/{message_id}",
  "servers": [
    {
      "url": "https://master.example.invalid",
      "description": "不可调用的示例地址；复制示例后替换为自己的主控域名。"
    }
  ],
  "securitySchemes": {
    "AccessToken": {
      "type": "apiKey",
      "in": "header",
      "name": "access-token",
      "description": "通过登录接口获得的短期访问令牌。"
    },
    "ApiKey": {
      "type": "apiKey",
      "in": "header",
      "name": "api-key",
      "description": "API Key；必须和 api-secret 同时发送。"
    },
    "ApiSecret": {
      "type": "apiKey",
      "in": "header",
      "name": "api-secret",
      "description": "API Secret；必须和 api-key 同时发送。"
    }
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "获取消息完整详情",
    "description": {
      "content": "按 ID 返回 `message` 表的完整消息记录（包含正文及发送状态字段）。接口要求登录。若消息指定了 `receive` 且其值不是当前用户 ID，则仅管理员可查看；服务端不额外检查 `is_show`，因此已登录用户可读取未指定接收者的隐藏消息详情。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "messages",
        ":message_id"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": [
        {
          "disabled": false,
          "description": {
            "content": "(Required) 消息 ID。路由只匹配整数；不存在时返回业务错误。",
            "type": "text/plain"
          },
          "type": "any",
          "value": "",
          "key": "message_id"
        }
      ]
    },
    "header": [
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "GET",
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}