|
|
// Code generated by swaggo/swag. DO NOT EDIT.
|
|
|
|
|
|
package docs
|
|
|
|
|
|
import "github.com/swaggo/swag"
|
|
|
|
|
|
const docTemplate = `{
|
|
|
"schemes": {{ marshal .Schemes }},
|
|
|
"swagger": "2.0",
|
|
|
"info": {
|
|
|
"description": "{{escape .Description}}",
|
|
|
"title": "{{.Title}}",
|
|
|
"contact": {},
|
|
|
"version": "{{.Version}}"
|
|
|
},
|
|
|
"host": "{{.Host}}",
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
"paths": {
|
|
|
"/api/device/v1/create": {
|
|
|
"post": {
|
|
|
"description": "新建设备,UDID唯一",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "新建设备",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "项目",
|
|
|
"name": "project",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "产品",
|
|
|
"name": "product_name",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "存放设备名字型号",
|
|
|
"name": "device_name",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "操作系统的版本",
|
|
|
"name": "os",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备唯一udid",
|
|
|
"name": "udid",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "操作系统平台adr/ios",
|
|
|
"name": "platform",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回创建后的设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/device/v1/delete/{id}": {
|
|
|
"delete": {
|
|
|
"description": "根据主键软删除设备,is_del设为1",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "删除设备",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备id,必传",
|
|
|
"name": "id",
|
|
|
"in": "path",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回创建后的设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/device/v1/get_device": {
|
|
|
"get": {
|
|
|
"description": "根据udid查询设备",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "查询设备",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备udid",
|
|
|
"name": "udid",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/device/v1/list": {
|
|
|
"get": {
|
|
|
"description": "获取设备列表",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "获取设备列表",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "每页大小,默认为10",
|
|
|
"name": "page_size",
|
|
|
"in": "query"
|
|
|
},
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "第几页,默认为第一页",
|
|
|
"name": "page_index",
|
|
|
"in": "query"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回设备列表信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/device/v1/opt/install": {
|
|
|
"post": {
|
|
|
"description": "传入安装包链接并指定设备安装",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "安装应用",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备udid",
|
|
|
"name": "udid",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "安装平台",
|
|
|
"name": "pf",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "安装包下载链接",
|
|
|
"name": "pkg_url",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回结果",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/device/v1/update": {
|
|
|
"post": {
|
|
|
"description": "根据主键更新设备",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "更新设备",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备id,必传",
|
|
|
"name": "id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "项目",
|
|
|
"name": "project",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "产品",
|
|
|
"name": "product_name",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "存放设备名字型号",
|
|
|
"name": "device_name",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "操作系统的版本",
|
|
|
"name": "os",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备唯一udid",
|
|
|
"name": "udid",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "操作系统平台adr/ios",
|
|
|
"name": "platform",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回创建后的设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/device/v1/update_status": {
|
|
|
"post": {
|
|
|
"description": "更新设备状态,错误的状态会被拒绝",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"设备相关 /api/device/v1/"
|
|
|
],
|
|
|
"summary": "更新设备状态",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备udid",
|
|
|
"name": "udid",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的设备状态,online-在线空闲,busy-占用中,offline-离线",
|
|
|
"name": "status",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新的状态",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/create_task": {
|
|
|
"post": {
|
|
|
"description": "新建Monkey任务,创建成功后将会发送指令到monkey服务,初始status为WAITTING-等待中",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "新建Monkey任务",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "项目名",
|
|
|
"name": "project",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "测试包下载链接",
|
|
|
"name": "package_url",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "应用包名",
|
|
|
"name": "package_name",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "启动activity页",
|
|
|
"name": "launch_activity",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "平台adr/ios",
|
|
|
"name": "platform",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "运行时间(s),默认两小时(7200s)",
|
|
|
"name": "run_time",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "任务创建者",
|
|
|
"name": "creator",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "调用服务的方式,0-cli模式/1-api模式,默认cli",
|
|
|
"name": "mode",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回创建的任务id",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/devices": {
|
|
|
"get": {
|
|
|
"description": "获取安卓设备列表",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "获取设备列表",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "平台:ios/adr",
|
|
|
"name": "platform",
|
|
|
"in": "query"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task": {
|
|
|
"get": {
|
|
|
"description": "根据id获取monkey任务信息",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "获取monkey任务信息",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "id",
|
|
|
"in": "query"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回monkey任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/activity": {
|
|
|
"get": {
|
|
|
"description": "通过monkey任务id获取覆盖的活动页面",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "获取覆盖页面列表",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回任务覆盖的活动页",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"post": {
|
|
|
"description": "Android上报activity名",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "上报Monkey应用页",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备id",
|
|
|
"name": "device_name",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "页面名称",
|
|
|
"name": "activity_name",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新后的任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/crash_count": {
|
|
|
"post": {
|
|
|
"description": "更新Monkey任务崩溃数量",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "更新Monkey任务崩溃数量",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的崩溃数量",
|
|
|
"name": "crash_count",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新后的任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/devices": {
|
|
|
"get": {
|
|
|
"description": "获取安卓设备列表",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "获取设备列表",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/pid": {
|
|
|
"post": {
|
|
|
"description": "上传进程id并关联到任务",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "上报进程id",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "进程id",
|
|
|
"name": "pid",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回成功或失败",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/result": {
|
|
|
"get": {
|
|
|
"description": "通过任务id获取Monkey结果",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "获取Monkey结果",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回任务结果",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"post": {
|
|
|
"description": "上报Monkey结果",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "上报Monkey结果",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "crash_log_list",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "activity_name_info",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "device_name",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "status",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新后的任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/status": {
|
|
|
"post": {
|
|
|
"description": "更新Monkey任务状态,进行中为RUNNING,已完成为FINISH,如有错误为ERROR",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "更新Monkey任务状态",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "status",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新后的任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/stop": {
|
|
|
"post": {
|
|
|
"description": "停止monkey任务,杀死所有关联任务的进程id",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "停止monkey任务",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回成功或失败",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/task/update_devices": {
|
|
|
"post": {
|
|
|
"description": "上报运行设备Udid,调用后追加到指定任务的设备字段中",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "上报运行设备",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "设备udid",
|
|
|
"name": "udid",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回成功或失败",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v1/tasks": {
|
|
|
"get": {
|
|
|
"description": "获取任务列表",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v1/"
|
|
|
],
|
|
|
"summary": "获取任务列表",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "每页大小,默认为10",
|
|
|
"name": "page_size",
|
|
|
"in": "query"
|
|
|
},
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "第几页,默认为第一页",
|
|
|
"name": "page_index",
|
|
|
"in": "query"
|
|
|
},
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "项目名称",
|
|
|
"name": "project",
|
|
|
"in": "query"
|
|
|
},
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "传1筛选有异常的任务",
|
|
|
"name": "has_error",
|
|
|
"in": "query"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新后的任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v2/create_task": {
|
|
|
"post": {
|
|
|
"description": "新建Monkey任务,创建成功后将会发送指令到monkey服务,初始status为WAITTING-等待中",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v2/"
|
|
|
],
|
|
|
"summary": "新建Monkey任务",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "项目名",
|
|
|
"name": "project",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "产品名",
|
|
|
"name": "product",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "应用包名",
|
|
|
"name": "package_name",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "测试包下载链接",
|
|
|
"name": "package_url",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "平台adr/ios",
|
|
|
"name": "platform",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "运行时间(s),默认两小时(3600s)",
|
|
|
"name": "run_time",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "安卓启动页名称",
|
|
|
"name": "launch_activity",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "任务创建者",
|
|
|
"name": "creator",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "启动来源,web-平台启动,ci-持续集成",
|
|
|
"name": "referer",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "调用服务的方式,0-cli模式/1-api模式,默认cli",
|
|
|
"name": "mode",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "备注",
|
|
|
"name": "remark",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回创建的任务id",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v2/task/command": {
|
|
|
"get": {
|
|
|
"description": "通过任务id获取任务的执行命令",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v2/"
|
|
|
],
|
|
|
"summary": "获取Monkey任务的执行命令",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回执行命令",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v2/task/get_anomalies": {
|
|
|
"get": {
|
|
|
"description": "通过任务id获取Monkey异常信息",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v2/"
|
|
|
],
|
|
|
"summary": "获取Monkey异常信息",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回任务结果",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v2/task/handle/set": {
|
|
|
"post": {
|
|
|
"description": "更新Monkey任务跟进状态",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v2/"
|
|
|
],
|
|
|
"summary": "更新任务跟进状态",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "Monkey任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "跟进情况:IN_PROGRESS-跟进中/DONE-已跟进",
|
|
|
"name": "handle_status",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回创建后的设备信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/monkey/v2/task/store_anomaly": {
|
|
|
"post": {
|
|
|
"description": "上报Monkey异常",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/monkey/v2/"
|
|
|
],
|
|
|
"summary": "上报Monkey异常",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "integer",
|
|
|
"description": "任务id",
|
|
|
"name": "task_id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "crash_log_list",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "activity_name_info",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "device_name",
|
|
|
"in": "formData"
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "要更新的任务状态",
|
|
|
"name": "status",
|
|
|
"in": "formData"
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回更新后的任务信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/project/v1/app": {
|
|
|
"get": {
|
|
|
"description": "根据应用名称app_name获取应用信息",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"Monkey相关 /api/project/v1/"
|
|
|
],
|
|
|
"summary": "获取应用信息",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "应用名称",
|
|
|
"name": "app_name",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回任务结果",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/api/tool/v1/voice/list": {
|
|
|
"get": {
|
|
|
"description": "根据表单id获取声音评测内容,返回分组和分组文件信息",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"工具相关 /api/tool/v1/"
|
|
|
],
|
|
|
"summary": "获取声音评测内容",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "表单id",
|
|
|
"name": "form_id",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回分组和分组文件信息",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"/webdav/monkey/task/:id/:filename": {
|
|
|
"put": {
|
|
|
"description": "上传Logcat日志",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"tags": [
|
|
|
"文件相关 /webdav"
|
|
|
],
|
|
|
"summary": "上传Logcat日志",
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "返回成功或失败",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/models.Response"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"definitions": {
|
|
|
"models.Response": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"code": {
|
|
|
"type": "integer"
|
|
|
},
|
|
|
"data": {},
|
|
|
"msg": {
|
|
|
"type": "string"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}`
|
|
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
|
var SwaggerInfo = &swag.Spec{
|
|
|
Version: "",
|
|
|
Host: "",
|
|
|
BasePath: "",
|
|
|
Schemes: []string{},
|
|
|
Title: "",
|
|
|
Description: "",
|
|
|
InfoInstanceName: "swagger",
|
|
|
SwaggerTemplate: docTemplate,
|
|
|
}
|
|
|
|
|
|
func init() {
|
|
|
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
|
|
|
}
|