-
Notifications
You must be signed in to change notification settings - Fork 9
MarketAPI
marstone edited this page Nov 25, 2016
·
6 revisions
- 请首先使用OAuth2协议获取access_token
- 所有返回值格式参见Response定义
- 传入参数必须使用URI Query或Form-Encoded Body的参数方式,具体可参考RFC6750的section-2.2和section-2.3
GET /apps @returns Response<App> @scope "market_apps"- App结构定义:
{
"id":{guid}, // 无意义的唯一id
"name":{string}, // 应用名
"tags":{string}, // 标签,逗号分割,无空格
"description":{string}, // 描述
"icon":{url}, // 图标URL
"created":{long}, // 创建时间
"updated":{long}, // 上传时间
"currentVersion":{Version} // 当前发布版本
}- Version结构定义:
{
"id":{guid}, // 无意义的唯一id
"version":{string}, // 版本号
"created":{long}, // 创建时间
"updated":{long}, // 上传时间
"released":{long}, // 发布时间,未发布版未空
"configuration":{string}, // 配置信息
"source":{url-safe base64 string} // URL-SAFE的BASE-64编码的源代码
}GET /app/{id} @returns Response<App> @scope "market_download"- 返回id为{id}的应用详情,以及发布版Version的信息。
POST /app @returns Response<App> @scope "market_publish"- 上传一个应用,参数:
| Parameter | Type | Description |
|---|---|---|
| name | string | 名称 |
| tags | string | 可为空 |
| description | string | 可为空 |
| version | long | UNIX时间戳 |
| configuration | string | 可为空 |
| icon | {url-safe base64 string} | 可为空 |
| source | {url-safe base64 string} | 源代码 |
PUT /app/{id} @returns Response<App> @scope "market_upload"- 更新或上传新版本,参数同1.3。
- 根据id定位到app数据,检查发布人是否相同(否则报无权限),更新app内容
- 对比version和现有的所有app的所有version,相同则更新,否则增加新版本
DELETE /app/{id} @returns Response<App> @scope "market_upload"- 参数 version
- 确保调用者身份相同
- disable指定版本,当所有版本disable时,disable整个应用。