API DocsAPI Docs
get/api/gallery/{namespace}/display/{id}
get/api/gallery/{namespace}/display/{id}
获取图库图片
Basic Information
Request Method:
get
Request URL:
https://abit.fun/api/gallery/{namespace}/display/{id}
Tags:
公用图库
Description
根据命名空间和ID获取图库中的图片。可通过size参数指定不同尺寸的图片。
默认返回缩略图以减少流量压力,只有在明确请求时才返回原图或预览图。
用途:
- 获取图库图片的不同尺寸版本
- 用于显示图片的缩略图、预览图或原图
- 根据不同场景选择合适的图片尺寸,优化网络性能
Path Parameters
Path Parameters Explanation
Path parameters are variables in the URL path, for example:
https://abit.fun/api/gallery/:namespace/display/:id
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
namespace | string | Required | example | 图片所属的命名空间 |
id | string | Required | abc123 | 图片ID |
Query Parameters
Query Parameters Explanation
Query parameters are added at the end of the URL, starting with a question mark, for example:
https://abit.fun/api/gallery/{namespace}/display/{id}?size=example
Parameter Name | Type | Required | Example Value | Description |
---|---|---|---|---|
size | string | Optional | example | 图片尺寸版本,支持original(原图)、thumbnail(缩略图,默认)、preview(预览图) |
Response Example
200成功获取图片
304图片未修改(缓存有效)
404图片未找到
500