{
  "tags": [
    "消息"
  ],
  "description": "将一条或多条消息标记为当前登录用户已读。接口要求登录。对同一消息重复调用不会新增重复已读记录；服务端只校验消息是否存在，不会额外校验消息是否属于当前用户可见范围。",
  "operationId": "user_post_v1_messages_read",
  "security": [
    {
      "AccessToken": []
    },
    {
      "ApiKey": [],
      "ApiSecret": []
    }
  ],
  "responses": {
    "200": {
      "description": "成功及业务错误均返回 HTTP 200。缺少消息 ID 或消息不存在时，响应会保留现有的 code 与 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",
                    "nullable": true,
                    "description": "成功时为 null。"
                  }
                },
                "additionalProperties": false
              },
              {
                "type": "object",
                "required": [
                  "code",
                  "msg",
                  "data"
                ],
                "properties": {
                  "code": {
                    "type": "string",
                    "enum": [
                      "请提供id",
                      "找不到此消息",
                      "login_required"
                    ],
                    "description": "缺少 ID、消息不存在或认证失败的实际业务错误标识；前两种值来自服务端的参数顺序。"
                  },
                  "msg": {
                    "type": "string",
                    "enum": [
                      "message_read-2",
                      "message_read-3",
                      "需要登录"
                    ],
                    "description": "实际业务错误消息；前两种为服务端写入的错误标识。"
                  },
                  "data": {
                    "type": "string",
                    "enum": [
                      ""
                    ],
                    "description": "业务错误时固定为空字符串。"
                  }
                },
                "additionalProperties": false
              }
            ]
          },
          "examples": {
            "success": {
              "summary": "标记成功",
              "value": {
                "code": 0,
                "msg": "消息已读",
                "data": null
              }
            },
            "missingId": {
              "summary": "缺少消息 ID（实际字段顺序）",
              "value": {
                "code": "请提供id",
                "msg": "message_read-2",
                "data": ""
              }
            }
          },
          "example": {
            "code": 0,
            "msg": "消息已读",
            "data": null
          }
        }
      }
    }
  },
  "x-python-handler": "system.MessageReadAPI",
  "x-python-route-line": 1028,
  "x-audience": "user",
  "x-auth": "user",
  "x-reviewed": true,
  "requestBody": {
    "required": true,
    "content": {
      "application/json": {
        "schema": {
          "oneOf": [
            {
              "type": "object",
              "required": [
                "id"
              ],
              "properties": {
                "id": {
                  "type": "integer",
                  "description": "要标记已读的消息 ID。服务端检查该消息记录存在。",
                  "example": 101
                }
              },
              "additionalProperties": false
            },
            {
              "type": "array",
              "description": "批量标记的消息对象数组。服务端允许空数组并直接返回成功；实际调用应至少提供一个对象。",
              "items": {
                "type": "object",
                "required": [
                  "id"
                ],
                "properties": {
                  "id": {
                    "type": "integer",
                    "description": "消息 ID。",
                    "example": 101
                  }
                },
                "additionalProperties": false
              }
            }
          ]
        },
        "examples": {
          "single": {
            "summary": "标记一条消息",
            "value": {
              "id": 101
            }
          },
          "batch": {
            "summary": "批量标记",
            "value": [
              {
                "id": 101
              },
              {
                "id": 102
              }
            ]
          }
        }
      }
    }
  },
  "parameters": [],
  "x-itecdn-source-reviewed": true,
  "extensions": [
    {
      "key": "x-python-handler",
      "value": "system.MessageReadAPI"
    },
    {
      "key": "x-python-route-line",
      "value": 1028
    },
    {
      "key": "x-audience",
      "value": "user"
    },
    {
      "key": "x-auth",
      "value": "user"
    },
    {
      "key": "x-reviewed",
      "value": true
    },
    {
      "key": "x-itecdn-source-reviewed",
      "value": true
    }
  ],
  "method": "post",
  "path": "/v1/messages/read",
  "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 同时发送。"
    }
  },
  "jsonRequestBodyExample": {
    "id": 101
  },
  "info": {
    "title": "itecdn v5 用户 API",
    "version": "5.x",
    "description": "itecdn v5.x Python 主控用户 API。本文档不适用于 v6 或其它实现。"
  },
  "postman": {
    "name": "标记消息已读",
    "description": {
      "content": "将一条或多条消息标记为当前登录用户已读。接口要求登录。对同一消息重复调用不会新增重复已读记录；服务端只校验消息是否存在，不会额外校验消息是否属于当前用户可见范围。",
      "type": "text/plain"
    },
    "url": {
      "path": [
        "v1",
        "messages",
        "read"
      ],
      "host": [
        "{{baseUrl}}"
      ],
      "query": [],
      "variable": []
    },
    "header": [
      {
        "key": "Content-Type",
        "value": "application/json"
      },
      {
        "key": "Accept",
        "value": "application/json"
      }
    ],
    "method": "POST",
    "body": {
      "mode": "raw",
      "raw": "",
      "options": {
        "raw": {
          "language": "json"
        }
      }
    },
    "auth": {
      "type": "apikey",
      "apikey": [
        {
          "type": "any",
          "value": "access-token",
          "key": "key"
        },
        {
          "type": "any",
          "value": "{{apiKey}}",
          "key": "value"
        },
        {
          "type": "any",
          "value": "header",
          "key": "in"
        }
      ]
    }
  }
}