{
    "swagger": "2.0",
    "info": {
        "description": "OnlyGame 内部调试 API。所有时间以 UTC RFC3339 格式返回。\n在本页执行 /api/login 后，浏览器会自动携带 HttpOnly 会话 Cookie；也可沿用用户调试页面的登录状态。调用 /api/logout 会同时退出当前浏览器的控制台会话。",
        "title": "OnlyGame API",
        "contact": {},
        "version": "1.0"
    },
    "basePath": "/",
    "paths": {
        "/api/login": {
            "post": {
                "description": "成功后更新最近登录时间，并通过 Set-Cookie 设置 HttpOnly 会话。本页后续请求会自动携带 Cookie，无需手动填写 Authorization 或 Cookie 请求头。",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "账号"
                ],
                "summary": "登录账号",
                "operationId": "login",
                "parameters": [
                    {
                        "description": "登录信息",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/main.credentials"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.UserResponse"
                        },
                        "headers": {
                            "Set-Cookie": {
                                "type": "string",
                                "description": "onlygame_session 会话 Cookie，HttpOnly，SameSite=Lax"
                            }
                        }
                    },
                    "400": {
                        "description": "JSON 格式错误",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "用户名或密码错误",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "跨站请求被拒绝",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "415": {
                        "description": "请求类型必须为 application/json",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "请求过于频繁，一分钟后重试",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/logout": {
            "post": {
                "description": "使当前会话失效并清除 Cookie；未登录时调用也返回 204。成功响应无正文。",
                "tags": [
                    "账号"
                ],
                "summary": "退出登录",
                "operationId": "logout",
                "responses": {
                    "204": {
                        "description": "已退出，无响应正文",
                        "headers": {
                            "Set-Cookie": {
                                "type": "string",
                                "description": "清除 onlygame_session 会话 Cookie"
                            }
                        }
                    },
                    "403": {
                        "description": "跨站请求被拒绝",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/me": {
            "get": {
                "description": "需要登录。先执行 /api/login，或在同源控制台登录后再调用；会话不存在、过期或服务重启后返回 401。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "用户"
                ],
                "summary": "获取当前用户",
                "operationId": "currentUser",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.UserResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/posts": {
            "get": {
                "description": "需要登录。按发布时间倒序，返回所有用户的帖子；媒体地址同样需要登录。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子"
                ],
                "summary": "获取帖子列表",
                "operationId": "listPosts",
                "parameters": [
                    {
                        "maximum": 50,
                        "minimum": 1,
                        "type": "integer",
                        "description": "每页数量，1–50，默认 20",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "minimum": 0,
                        "type": "integer",
                        "description": "跳过数量，非负整数，默认 0",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.PostsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "需要登录。multipart/form-data：title 为 1–100 字，body 为 1–10000 字；files 上传 1 段 MP4/WebM 视频（≤100 MiB）或 1–9 张 JPEG/PNG/GIF/WebP 图片（每张≤10 MiB），不可混传。多图重复 files 字段并按提交顺序保存。Swagger 2.0 的文件控件仅支持单文件，多图请使用帖子页面或 curl 多个 -F files=@文件。请求总大小≤101 MiB，上传超时 15 分钟。",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子"
                ],
                "summary": "发布帖子",
                "operationId": "createPost",
                "parameters": [
                    {
                        "maxLength": 100,
                        "type": "string",
                        "description": "标题，1–100 字",
                        "name": "title",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "maxLength": 10000,
                        "type": "string",
                        "description": "正文，1–10000 字",
                        "name": "body",
                        "in": "formData",
                        "required": true
                    },
                    {
                        "type": "file",
                        "description": "一段视频或图片；多图重复 files 字段",
                        "name": "files",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/main.PostResponse"
                        },
                        "headers": {
                            "Location": {
                                "type": "string",
                                "description": "新帖子的 API 地址"
                            }
                        }
                    },
                    "400": {
                        "description": "字段错误、数量不符或混合图片和视频",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "413": {
                        "description": "文件或请求超过限制",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "415": {
                        "description": "不支持的请求或媒体类型",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "上传繁忙，请稍后重试",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/posts/{id}": {
            "get": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子"
                ],
                "summary": "获取单篇帖子",
                "parameters": [
                    {
                        "type": "string",
                        "description": "帖子 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.PostResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/posts/{id}/comments": {
            "get": {
                "description": "需要登录。按评论时间倒序分页，返回作者用户名、当前头像、评论正文和发布时间；不返回邮箱、手机或密码。帖子尚无评论时返回空数组。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子互动"
                ],
                "summary": "获取帖子评论",
                "parameters": [
                    {
                        "type": "string",
                        "description": "帖子 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "maximum": 50,
                        "minimum": 1,
                        "type": "integer",
                        "description": "每页数量，1–50，默认 20",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "maximum": 1000000000,
                        "minimum": 0,
                        "type": "integer",
                        "description": "跳过数量，默认 0",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.CommentsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            },
            "post": {
                "description": "需要登录。body 为 1–1000 字，去除首尾空白，保留正文换行，按纯文本展示。请求总大小最多 8 KiB，作者和时间由服务端决定。当前为单层评论，不支持回复其他评论。",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子互动"
                ],
                "summary": "评论帖子",
                "parameters": [
                    {
                        "type": "string",
                        "description": "帖子 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "评论内容",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/main.commentInput"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/main.CommentResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "413": {
                        "description": "Request Entity Too Large",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "415": {
                        "description": "Unsupported Media Type",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/posts/{id}/like": {
            "put": {
                "description": "需要登录。无需请求正文，每个账号对同一帖子只记一个赞，重复调用不重复计数。liked_by_me 表示当前账号的点赞状态。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子互动"
                ],
                "summary": "点赞帖子",
                "parameters": [
                    {
                        "type": "string",
                        "description": "帖子 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ActivityResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "description": "需要登录。取消当前账号对帖子的点赞；未点赞或重复取消也返回 200，不影响其他账号的赞。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "帖子互动"
                ],
                "summary": "取消点赞",
                "parameters": [
                    {
                        "type": "string",
                        "description": "帖子 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ActivityResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/profile": {
            "get": {
                "description": "需要登录。包含公开头像、签名和仅本人可见的邮箱、手机；旧账号未设置字段返回空字符串。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "个人主页"
                ],
                "summary": "获取我的资料",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ProfileResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            },
            "patch": {
                "description": "需要登录。只更新传入的字段，空字符串可清空；签名最多 200 字，邮箱最多 254 字节并检查基本格式。手机可包含空格、短横线，保存时去除，允许开头 + 及 7–15 位数字。邮箱和手机是联系资料，不校验归属，不用作登录账号。用户名、用户 ID、头像不在本接口修改。",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "个人主页"
                ],
                "summary": "修改我的资料",
                "parameters": [
                    {
                        "description": "至少提供一个资料字段",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/main.profileInput"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ProfileResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "415": {
                        "description": "Unsupported Media Type",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/profile/avatar": {
            "post": {
                "description": "需要登录。单个 file 文件，支持 JPEG/PNG/GIF/WebP，最多 5 MiB，宽高各最多 4096 像素。居中裁剪为 256×256 PNG，GIF 取首帧。替换成功后清理旧头像；失败时保留原头像。上传限时 2 分钟。",
                "consumes": [
                    "multipart/form-data"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "个人主页"
                ],
                "summary": "上传或更换我的头像",
                "parameters": [
                    {
                        "type": "file",
                        "description": "头像图片",
                        "name": "file",
                        "in": "formData",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ProfileResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "413": {
                        "description": "Request Entity Too Large",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "415": {
                        "description": "Unsupported Media Type",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "503": {
                        "description": "Service Unavailable",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            },
            "delete": {
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "个人主页"
                ],
                "summary": "移除我的头像",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.ProfileResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "Forbidden",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/profile/posts": {
            "get": {
                "description": "需要登录。按作者 ID 筛选后再分页，返回当前用户的帖子总数和发布时间倒序的列表。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "个人主页"
                ],
                "summary": "获取我发布的帖子",
                "parameters": [
                    {
                        "maximum": 50,
                        "minimum": 1,
                        "type": "integer",
                        "description": "每页数量，1–50，默认 20",
                        "name": "limit",
                        "in": "query"
                    },
                    {
                        "maximum": 1000000000,
                        "minimum": 0,
                        "type": "integer",
                        "description": "跳过数量，默认 0",
                        "name": "offset",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.PostsResponse"
                        }
                    },
                    "400": {
                        "description": "Bad Request",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/register": {
            "post": {
                "description": "注册成功后仍需调用登录接口，最近登录时间初始为 null。用户名不区分大小写，首尾空格会去除。",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "账号"
                ],
                "summary": "注册账号",
                "operationId": "register",
                "parameters": [
                    {
                        "description": "注册信息",
                        "name": "body",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/main.credentials"
                        }
                    }
                ],
                "responses": {
                    "201": {
                        "description": "Created",
                        "schema": {
                            "$ref": "#/definitions/main.UserResponse"
                        }
                    },
                    "400": {
                        "description": "参数或 JSON 格式错误",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "403": {
                        "description": "跨站请求被拒绝",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "409": {
                        "description": "用户名已被注册",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "415": {
                        "description": "请求类型必须为 application/json",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "429": {
                        "description": "请求过于频繁，一分钟后重试",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/api/users": {
            "get": {
                "description": "需要登录。按最近成功登录时间倒序排列，未登录用户排在最后；last_login_at 为 null 表示从未登录。读取列表不会更新登录时间，不返回密码或密码哈希。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "用户"
                ],
                "summary": "获取所有用户",
                "operationId": "listUsers",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.UsersResponse"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/avatars/{id}/{filename}": {
            "get": {
                "tags": [
                    "个人主页"
                ],
                "summary": "查看用户头像",
                "parameters": [
                    {
                        "type": "string",
                        "description": "用户 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "头像文件名，从 avatar_url 获取",
                        "name": "filename",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "file"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        },
        "/healthz": {
            "get": {
                "description": "无需登录，返回 HTTP 服务运行状态。",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "系统"
                ],
                "summary": "健康检查",
                "operationId": "health",
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "$ref": "#/definitions/main.HealthResponse"
                        }
                    }
                }
            }
        },
        "/media/{id}/{filename}": {
            "get": {
                "description": "需要登录。仅提供已发布帖子中的文件；支持 Range 请求以拖动视频。URL 从帖子响应的 media[].url 获取。",
                "tags": [
                    "帖子"
                ],
                "summary": "查看帖子媒体",
                "parameters": [
                    {
                        "type": "string",
                        "description": "帖子 ID",
                        "name": "id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "string",
                        "description": "媒体文件名",
                        "name": "filename",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "type": "file"
                        }
                    },
                    "206": {
                        "description": "部分媒体内容",
                        "schema": {
                            "type": "file"
                        }
                    },
                    "401": {
                        "description": "Unauthorized",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    },
                    "404": {
                        "description": "Not Found",
                        "schema": {
                            "$ref": "#/definitions/main.ErrorResponse"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "main.ActivityResponse": {
            "type": "object",
            "properties": {
                "activity": {
                    "$ref": "#/definitions/main.PostActivity"
                }
            }
        },
        "main.Comment": {
            "type": "object",
            "properties": {
                "author": {
                    "$ref": "#/definitions/main.PostAuthor"
                },
                "body": {
                    "type": "string",
                    "maxLength": 1000,
                    "minLength": 1,
                    "example": "这篇帖子很有意思！"
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time"
                },
                "id": {
                    "type": "string",
                    "example": "comment_id"
                },
                "post_id": {
                    "type": "string",
                    "example": "post_id"
                }
            }
        },
        "main.CommentResponse": {
            "type": "object",
            "properties": {
                "activity": {
                    "$ref": "#/definitions/main.PostActivity"
                },
                "comment": {
                    "$ref": "#/definitions/main.Comment"
                }
            }
        },
        "main.CommentsResponse": {
            "type": "object",
            "properties": {
                "comments": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/main.Comment"
                    }
                },
                "limit": {
                    "type": "integer",
                    "example": 20
                },
                "offset": {
                    "type": "integer",
                    "example": 0
                },
                "total": {
                    "type": "integer",
                    "example": 2
                }
            }
        },
        "main.ErrorResponse": {
            "type": "object",
            "properties": {
                "error": {
                    "type": "string",
                    "example": "错误说明"
                }
            }
        },
        "main.HealthResponse": {
            "type": "object",
            "properties": {
                "status": {
                    "type": "string",
                    "enum": [
                        "ok"
                    ],
                    "example": "ok"
                }
            }
        },
        "main.PostActivity": {
            "type": "object",
            "properties": {
                "comment_count": {
                    "type": "integer",
                    "example": 2
                },
                "like_count": {
                    "type": "integer",
                    "example": 3
                },
                "liked_by_me": {
                    "type": "boolean",
                    "example": true
                }
            }
        },
        "main.PostAuthor": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string",
                    "example": "/avatars/user_id/avatar_id.png"
                },
                "id": {
                    "type": "string",
                    "example": "aBcdEf0123456789_sample"
                },
                "username": {
                    "type": "string",
                    "example": "debug_user"
                }
            }
        },
        "main.PostMedia": {
            "type": "object",
            "properties": {
                "content_type": {
                    "type": "string",
                    "example": "image/jpeg"
                },
                "size": {
                    "type": "integer",
                    "example": 102400
                },
                "url": {
                    "type": "string",
                    "example": "/media/post_id/image_id.jpg"
                }
            }
        },
        "main.PostResponse": {
            "type": "object",
            "properties": {
                "post": {
                    "$ref": "#/definitions/main.PostSummary"
                }
            }
        },
        "main.PostSummary": {
            "type": "object",
            "properties": {
                "author": {
                    "$ref": "#/definitions/main.PostAuthor"
                },
                "body": {
                    "type": "string",
                    "maxLength": 10000,
                    "minLength": 1,
                    "example": "分享这次体验。"
                },
                "comment_count": {
                    "type": "integer",
                    "example": 2
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time"
                },
                "id": {
                    "type": "string",
                    "example": "post_id"
                },
                "kind": {
                    "type": "string",
                    "enum": [
                        "image",
                        "video"
                    ],
                    "example": "image"
                },
                "like_count": {
                    "type": "integer",
                    "example": 3
                },
                "liked_by_me": {
                    "type": "boolean",
                    "example": true
                },
                "media": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/main.PostMedia"
                    }
                },
                "title": {
                    "type": "string",
                    "maxLength": 100,
                    "minLength": 1,
                    "example": "今天的游戏记录"
                }
            }
        },
        "main.PostsResponse": {
            "type": "object",
            "properties": {
                "limit": {
                    "type": "integer",
                    "example": 20
                },
                "offset": {
                    "type": "integer",
                    "example": 0
                },
                "posts": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/main.PostSummary"
                    }
                },
                "total": {
                    "type": "integer",
                    "example": 1
                }
            }
        },
        "main.Profile": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string",
                    "example": "/avatars/user_id/avatar_id.png"
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "example": "2026-10-20T10:00:00Z"
                },
                "email": {
                    "type": "string",
                    "maxLength": 254,
                    "example": "player@example.com"
                },
                "id": {
                    "type": "string",
                    "example": "aBcdEf0123456789_sample"
                },
                "last_login_at": {
                    "description": "最近一次成功登录的 UTC 时间；从未登录时为 null。",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true,
                    "example": "2026-10-20T10:30:00Z"
                },
                "phone": {
                    "type": "string",
                    "maxLength": 16,
                    "example": "13800138000"
                },
                "signature": {
                    "type": "string",
                    "maxLength": 200,
                    "example": "热爱游戏，记录生活。"
                },
                "username": {
                    "type": "string",
                    "example": "debug_user"
                }
            }
        },
        "main.ProfileResponse": {
            "type": "object",
            "properties": {
                "profile": {
                    "$ref": "#/definitions/main.Profile"
                }
            }
        },
        "main.User": {
            "type": "object",
            "properties": {
                "avatar_url": {
                    "type": "string",
                    "example": "/avatars/user_id/avatar_id.png"
                },
                "created_at": {
                    "type": "string",
                    "format": "date-time",
                    "example": "2026-10-20T10:00:00Z"
                },
                "id": {
                    "type": "string",
                    "example": "aBcdEf0123456789_sample"
                },
                "last_login_at": {
                    "description": "最近一次成功登录的 UTC 时间；从未登录时为 null。",
                    "type": "string",
                    "format": "date-time",
                    "x-nullable": true,
                    "example": "2026-10-20T10:30:00Z"
                },
                "signature": {
                    "type": "string",
                    "maxLength": 200,
                    "example": "热爱游戏，记录生活。"
                },
                "username": {
                    "type": "string",
                    "example": "debug_user"
                }
            }
        },
        "main.UserResponse": {
            "type": "object",
            "properties": {
                "user": {
                    "$ref": "#/definitions/main.User"
                }
            }
        },
        "main.UsersResponse": {
            "type": "object",
            "properties": {
                "users": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/main.User"
                    }
                }
            }
        },
        "main.commentInput": {
            "type": "object",
            "required": [
                "body"
            ],
            "properties": {
                "body": {
                    "type": "string",
                    "maxLength": 1000,
                    "minLength": 1,
                    "example": "这篇帖子很有意思！"
                }
            }
        },
        "main.credentials": {
            "type": "object",
            "required": [
                "password",
                "username"
            ],
            "properties": {
                "password": {
                    "description": "密码保留首尾空格；注册时要求 8–128 个字符。",
                    "type": "string",
                    "format": "password",
                    "maxLength": 128,
                    "minLength": 8,
                    "example": "example-password"
                },
                "username": {
                    "description": "用户名忽略大小写，允许中文、字母、数字、下划线和短横线。",
                    "type": "string",
                    "maxLength": 32,
                    "minLength": 2,
                    "example": "debug_user"
                }
            }
        },
        "main.profileInput": {
            "type": "object",
            "properties": {
                "email": {
                    "type": "string",
                    "maxLength": 254,
                    "example": "player@example.com"
                },
                "phone": {
                    "type": "string",
                    "maxLength": 40,
                    "example": "+86 13800138000"
                },
                "signature": {
                    "type": "string",
                    "maxLength": 200,
                    "example": "热爱游戏，记录生活。"
                }
            }
        }
    },
    "tags": [
        {
            "description": "注册、登录和退出。注册与登录按连接 IP 合计每分钟最多 30 次。",
            "name": "账号"
        },
        {
            "description": "需要登录，沿用同源浏览器会话。",
            "name": "用户"
        },
        {
            "description": "服务运行状态。",
            "name": "系统"
        },
        {
            "description": "需要登录。支持一段视频或最多九张图片，媒体随帖子一起上传。",
            "name": "帖子"
        },
        {
            "description": "管理当前账号的头像、签名及私人联系资料，查看自己发布的帖子。",
            "name": "个人主页"
        },
        {
            "description": "需要登录。点赞、取消点赞和单层文字评论。",
            "name": "帖子互动"
        }
    ]
}