外观
软件相关
软件模块提供配置下发、公告获取和版本检查等只读接口。
获取软件配置
获取软件的全局配置信息。
GET /api/client/v1/software/config
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| app_key | string | 是 | 应用标识 |
| timestamp | int | 是 | 当前时间戳(秒) |
| nonce | string | 是 | 随机字符串 |
| sign | string | 是 | 请求签名 |
成功响应
json
{
"code": 0,
"message": "ok",
"result": {
"config": "{\"api_url\": \"...\", \"features\": [...]}"
}
}获取公告
获取软件当前公告信息。
GET /api/client/v1/software/notice
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| app_key | string | 是 | 应用标识 |
| timestamp | int | 是 | 当前时间戳(秒) |
| nonce | string | 是 | 随机字符串 |
| sign | string | 是 | 请求签名 |
成功响应
json
{
"code": 0,
"message": "ok",
"result": {
"notice": "系统将于今晚 22:00 进行维护..."
}
}检查最新版本
检查软件是否有新版本可用。
GET /api/client/v1/software/version/latest
请求参数
| 参数名 | 类型 | 必填 | 说明 |
|---|---|---|---|
| app_key | string | 是 | 应用标识 |
| version | string | 否 | 当前客户端版本号 |
| channel | string | 否 | 更新渠道,默认 stable |
| timestamp | int | 是 | 当前时间戳(秒) |
| nonce | string | 是 | 随机字符串 |
| sign | string | 是 | 请求签名 |
成功响应
json
{
"code": 0,
"message": "ok",
"result": {
"notice": "修复已知问题,优化性能",
"url": "https://example.com/download/v2.0.0.apk",
"version": "2.0.0",
"server_time": 1703001600
}
}| 字段 | 类型 | 说明 |
|---|---|---|
| notice | string | 更新说明 |
| url | string | 下载地址 |
| version | string | 最新版本号 |
| server_time | int | 服务器当前时间戳 |
相关错误码
| 错误码 | 说明 |
|---|---|
| 10304 | 已经是最新版本 |
对应实现
- Handler:
internal/module/app/handler_client.go - DTO:
internal/module/app/dto_client.go