必应每日壁纸API服务,提供壁纸下载、元数据获取等功能。
- 自动获取必应每日壁纸
- 支持本地存储和对象存储
- 提供RESTful API接口
- 支持定时更新和清理
- 提供Prometheus指标监控
- 克隆仓库
git clone https://github.com/ysicing/BingWallpaperAPI.git
cd BingWallpaperAPI
- 使用Docker Compose启动服务
docker compose up -d
- 访问API
- 获取壁纸信息:
http://localhost:3000/api/v1/wallpaper
- 获取壁纸图片:
http://localhost:3000/images/[filename]
- 获取元数据:
http://localhost:3000/metadata
- 健康检查:
http://localhost:3000/health
- 构建应用
go build -o bin/server cmd/server/main.go
- 运行应用
./bin/server
配置文件位于config/config.yaml
,主要配置项包括:
- 服务器配置:端口、主机等
- 存储配置:本地存储路径、对象存储参数等
- 定时任务配置:更新间隔、清理间隔等
- API配置:基础路径、速率限制等
GET /api/v1/wallpaper
返回当前壁纸的信息,包括图片URL和元数据。
GET /images/[filename]
返回壁纸图片文件。
GET /metadata
返回壁纸的完整元数据。
GET /api/v1/update
手动触发壁纸更新。
GET /health
返回服务健康状态。
服务提供了Prometheus格式的监控指标,可通过/metrics
端点访问。
MIT