| // Licensed to the Apache Software Foundation (ASF) under one or more |
| // contributor license agreements. See the NOTICE file distributed with |
| // this work for additional information regarding copyright ownership. |
| // The ASF licenses this file to You under the Apache License, Version 2.0 |
| // (the "License"); you may not use this file except in compliance with |
| // the License. You may obtain a copy of the License at |
| // |
| // http://www.apache.org/licenses/LICENSE-2.0 |
| // |
| // Unless required by applicable law or agreed to in writing, software |
| // distributed under the License is distributed on an "AS IS" BASIS, |
| // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| // See the License for the specific language governing permissions and |
| // limitations under the License. |
| |
| { |
| "swagger": "2.0", |
| "info": { |
| "description": "This is a event catalog server.", |
| "title": "Event Catalog API", |
| "contact": {}, |
| "license": { |
| "name": "Apache 2.0", |
| "url": "http://www.apache.org/licenses/LICENSE-2.0.html" |
| }, |
| "version": "1.0" |
| }, |
| "paths": { |
| "/catalog": { |
| "get": { |
| "description": "query event catalog list", |
| "consumes": [ |
| "application/json" |
| ], |
| "produces": [ |
| "application/json" |
| ], |
| "tags": [ |
| "Catalog" |
| ], |
| "summary": "query event catalog list", |
| "parameters": [ |
| { |
| "type": "string", |
| "description": "query page", |
| "name": "page", |
| "in": "query" |
| }, |
| { |
| "type": "string", |
| "description": "query size", |
| "name": "size", |
| "in": "query" |
| } |
| ], |
| "responses": { |
| "200": { |
| "description": "OK", |
| "schema": { |
| "$ref": "#/definitions/main.QueryEventsResponse" |
| } |
| }, |
| "400": { |
| "description": "Bad Request" |
| }, |
| "404": { |
| "description": "Not Found" |
| }, |
| "500": { |
| "description": "Internal Server Error" |
| } |
| } |
| }, |
| "post": { |
| "description": "save event catalog", |
| "consumes": [ |
| "application/json" |
| ], |
| "produces": [ |
| "application/json" |
| ], |
| "tags": [ |
| "Catalog" |
| ], |
| "summary": "save event catalog", |
| "parameters": [ |
| { |
| "description": "event catalog data", |
| "name": "request", |
| "in": "body", |
| "required": true, |
| "schema": { |
| "$ref": "#/definitions/main.SaveEventRequest" |
| } |
| } |
| ], |
| "responses": { |
| "200": { |
| "description": "OK" |
| }, |
| "400": { |
| "description": "Bad Request" |
| }, |
| "404": { |
| "description": "Not Found" |
| }, |
| "500": { |
| "description": "Internal Server Error" |
| } |
| } |
| } |
| }, |
| "/catalog/{eventId}": { |
| "get": { |
| "description": "query event catalog detail info", |
| "consumes": [ |
| "application/json" |
| ], |
| "produces": [ |
| "application/json" |
| ], |
| "tags": [ |
| "Catalog" |
| ], |
| "summary": "query event catalog detail info", |
| "parameters": [ |
| { |
| "type": "string", |
| "description": "event id", |
| "name": "eventId", |
| "in": "path", |
| "required": true |
| } |
| ], |
| "responses": { |
| "200": { |
| "description": "OK", |
| "schema": { |
| "$ref": "#/definitions/main.QueryEventResponse" |
| } |
| }, |
| "400": { |
| "description": "Bad Request" |
| }, |
| "404": { |
| "description": "Not Found" |
| }, |
| "500": { |
| "description": "Internal Server Error" |
| } |
| } |
| } |
| } |
| }, |
| "definitions": { |
| "main.QueryEventResponse": { |
| "type": "object", |
| "properties": { |
| "event": { |
| "$ref": "#/definitions/model.Event" |
| } |
| } |
| }, |
| "main.QueryEventsResponse": { |
| "type": "object", |
| "properties": { |
| "events": { |
| "type": "array", |
| "items": { |
| "$ref": "#/definitions/model.Event" |
| } |
| }, |
| "total": { |
| "description": "total count", |
| "type": "integer" |
| } |
| } |
| }, |
| "main.SaveEventRequest": { |
| "type": "object", |
| "properties": { |
| "event": { |
| "$ref": "#/definitions/model.Event" |
| } |
| } |
| }, |
| "model.Event": { |
| "type": "object", |
| "properties": { |
| "create_time": { |
| "type": "string" |
| }, |
| "definition": { |
| "type": "string" |
| }, |
| "file_name": { |
| "type": "string" |
| }, |
| "id": { |
| "type": "integer" |
| }, |
| "status": { |
| "type": "integer" |
| }, |
| "title": { |
| "type": "string" |
| }, |
| "update_time": { |
| "type": "string" |
| }, |
| "version": { |
| "type": "string" |
| } |
| } |
| } |
| } |
| } |