系统设计面试:设计 URL 短链接与 Twitter 时间线

FreeGuideOnline 最新 2026-07-02

POST /api/v1/urls Request Body: { "long_url": "https://www.example.com/very-long-path", "expiry_days": 90 } Response: { "short_url": "https://short.en/A7x9F3", "expires_at": "..." }


**跳转接口**

GET /{short_code} 返回302状态码,Location头设置为原始长URL。