458 lines
14 KiB
JSON
458 lines
14 KiB
JSON
{
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "知识共享平台",
|
|
"title": "ShareKnowledgeServer Api",
|
|
"contact": {},
|
|
"version": "1.0"
|
|
},
|
|
"basePath": "/api",
|
|
"paths": {
|
|
"/people": {
|
|
"get": {
|
|
"description": "此接口用来获取人员数据列表,支持名称模糊查询,以及自定义排序(name, created_at)",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"peple"
|
|
],
|
|
"summary": "人员列表",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "页码",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "每页数量",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maxLength": 100,
|
|
"type": "string",
|
|
"description": "名称",
|
|
"name": "name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "排序字段",
|
|
"name": "sort_by",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "排序类型",
|
|
"name": "sort_direction",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Person"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"people"
|
|
],
|
|
"summary": "新增一条人员数据",
|
|
"parameters": [
|
|
{
|
|
"maxLength": 100,
|
|
"minLength": 1,
|
|
"type": "string",
|
|
"description": "名称",
|
|
"name": "name",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "个性签名",
|
|
"name": "signature",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Person"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/people/{id}": {
|
|
"get": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"people"
|
|
],
|
|
"summary": "获取单个人员",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Person"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"people"
|
|
],
|
|
"summary": "删除一条人员数据",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Person"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"people"
|
|
],
|
|
"summary": "修改人员数据",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 100,
|
|
"type": "string",
|
|
"description": "名称",
|
|
"name": "name",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "个性签名",
|
|
"name": "signature",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Person"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/templates": {
|
|
"get": {
|
|
"description": "一段描述",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"templates"
|
|
],
|
|
"summary": "数据列表",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "页码",
|
|
"name": "page",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "每页数量",
|
|
"name": "page_size",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"maxLength": 100,
|
|
"type": "string",
|
|
"description": "名称搜索",
|
|
"name": "name",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "uuid搜索",
|
|
"name": "uuid",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "排序字段",
|
|
"name": "sort_by",
|
|
"in": "query"
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "排序类型",
|
|
"name": "sort_direction",
|
|
"in": "query"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Template"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"post": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"templates"
|
|
],
|
|
"summary": "新增一条模板数据",
|
|
"parameters": [
|
|
{
|
|
"maxLength": 100,
|
|
"minLength": 1,
|
|
"type": "string",
|
|
"description": "名称",
|
|
"name": "name",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "uuid",
|
|
"name": "uuid",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Template"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/templates/{id}": {
|
|
"get": {
|
|
"description": "这是一段描述",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"templates"
|
|
],
|
|
"summary": "获取单个模板",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Template"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"delete": {
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"templates"
|
|
],
|
|
"summary": "删除一条数据",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Template"
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"patch": {
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"templates"
|
|
],
|
|
"summary": "修改模板数据",
|
|
"parameters": [
|
|
{
|
|
"type": "integer",
|
|
"description": "ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"maxLength": 100,
|
|
"minLength": 1,
|
|
"type": "string",
|
|
"description": "名称",
|
|
"name": "name",
|
|
"in": "formData"
|
|
},
|
|
{
|
|
"type": "integer",
|
|
"description": "uuid",
|
|
"name": "uuid",
|
|
"in": "formData"
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "请求成功",
|
|
"schema": {
|
|
"$ref": "#/definitions/model.Template"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"model.Person": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"followed_count": {
|
|
"description": "关注数",
|
|
"type": "integer"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"description": "名称",
|
|
"type": "string"
|
|
},
|
|
"signature": {
|
|
"description": "个性签名",
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
},
|
|
"model.Template": {
|
|
"type": "object",
|
|
"properties": {
|
|
"created_at": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "integer"
|
|
},
|
|
"name": {
|
|
"type": "string"
|
|
},
|
|
"updated_at": {
|
|
"type": "string"
|
|
},
|
|
"uuid": {
|
|
"type": "integer"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |