313 lines
9.2 KiB
JSON
Executable File
313 lines
9.2 KiB
JSON
Executable File
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"contact": {}
|
|
},
|
|
"paths": {
|
|
"/feature": {
|
|
"put": {
|
|
"description": "更新要素",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"feature"
|
|
],
|
|
"summary": "更新要素",
|
|
"parameters": [
|
|
{
|
|
"description": "要素",
|
|
"name": "feature",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/store.FeatureUpdate"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Response-model_Feature"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"description": "创建要素",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"feature"
|
|
],
|
|
"summary": "创建要素",
|
|
"parameters": [
|
|
{
|
|
"description": "要素",
|
|
"name": "feature",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/store.FeatureCreate"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Response-model_Feature"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/feature/banned/{id}": {
|
|
"post": {
|
|
"description": "禁用要素",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"feature"
|
|
],
|
|
"summary": "禁用要素",
|
|
"parameters": [
|
|
{
|
|
"description": "要素",
|
|
"name": "feature",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/store.FeatureDeleteOrBanned"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Response-model_Feature"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/feature/{id}": {
|
|
"get": {
|
|
"description": "获取要素",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"feature"
|
|
],
|
|
"summary": "获取要素",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "要素 ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Response-model_Feature"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"description": "删除要素",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"feature"
|
|
],
|
|
"summary": "删除要素",
|
|
"parameters": [
|
|
{
|
|
"description": "要素",
|
|
"name": "feature",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/store.FeatureDeleteOrBanned"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Response-model_Feature"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/features": {
|
|
"get": {
|
|
"description": "获取要素列表",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"feature"
|
|
],
|
|
"summary": "获取要素列表",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "页码",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "每页数量",
|
|
"name": "size",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/api.Pagination-model_Feature"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"api.Pagination-model_Feature": {
|
|
"type": "object",
|
|
"properties": {
|
|
"data": {
|
|
"type": "array",
|
|
"items": {
|
|
"$ref": "#/definitions/model.Feature"
|
|
}
|
|
},
|
|
"page": {
|
|
"type": "integer"
|
|
},
|
|
"size": {
|
|
"type": "integer"
|
|
},
|
|
"total": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"api.Response-model_Feature": {
|
|
"type": "object",
|
|
"properties": {
|
|
"code": {
|
|
"type": "integer"
|
|
},
|
|
"data": {
|
|
"$ref": "#/definitions/model.Feature"
|
|
},
|
|
"message": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"model.Feature": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "integer"
|
|
},
|
|
"geometry": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
},
|
|
"store.FeatureCreate": {
|
|
"type": "object",
|
|
"required": [
|
|
"geometry",
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"geometry": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"store.FeatureDeleteOrBanned": {
|
|
"type": "object",
|
|
"required": [
|
|
"id"
|
|
],
|
|
"properties": {
|
|
"id": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"store.FeatureUpdate": {
|
|
"type": "object",
|
|
"required": [
|
|
"geometry",
|
|
"id",
|
|
"name"
|
|
],
|
|
"properties": {
|
|
"geometry": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |