You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

609 lines
19 KiB

// Package docs GENERATED BY SWAG; DO NOT EDIT
// This file was generated by swaggo/swag
package docs
import "github.com/swaggo/swag"
const docTemplate = `{
"schemes": {{ marshal .Schemes }},
"swagger": "2.0",
"info": {
"description": "{{escape .Description}}",
"title": "{{.Title}}",
"contact": {
"name": "Samuel Pua",
"url": "https://git.samuelpua.com/telboon"
},
"version": "{{.Version}}"
},
"host": "{{.Host}}",
"basePath": "{{.BasePath}}",
"paths": {
"/": {
"get": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Base"
],
"summary": "This is test",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
}
}
}
},
"/api/v1/ktmtrainbot/booking": {
"get": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ktmtrainbot Booking"
],
"summary": "Get All Booking",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/ktmtrainbot.BookingResponse"
}
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
},
"post": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ktmtrainbot Booking"
],
"summary": "Create New Booking",
"parameters": [
{
"description": "Booking Create Request",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/ktmtrainbot.BookingCreateRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ktmtrainbot.BookingResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/ktmtrainbot/booking/{bookingID}": {
"delete": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"ktmtrainbot Booking"
],
"summary": "Delete booking",
"parameters": [
{
"type": "string",
"description": "Booking ID",
"name": "bookingID",
"in": "path",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ktmtrainbot.BookingResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/ktmtrainbot/current-time": {
"get": {
"description": "Description",
"produces": [
"application/json"
],
"tags": [
"Info"
],
"summary": "Get current server time",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/ktmtrainbot.ServerTimeResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/user/login": {
"post": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "For user login",
"parameters": [
{
"description": "User Login info",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.UserLoginRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/user.UserResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/user/logout": {
"post": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "For user logout",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/common.TextResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/user/me": {
"get": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "Returns current logged in user",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/user.UserResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/user/profile": {
"put": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "For setting current user profile",
"parameters": [
{
"description": "User registration info",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.ProfileRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/user.UserResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/api/v1/user/register": {
"post": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"User"
],
"summary": "For user registration",
"parameters": [
{
"description": "User registration info",
"name": "user",
"in": "body",
"required": true,
"schema": {
"$ref": "#/definitions/user.UserRegisterRequest"
}
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/user.UserResponse"
}
},
"400": {
"description": "Bad Request",
"schema": {
"$ref": "#/definitions/common.ErrResponse"
}
}
}
}
},
"/health": {
"get": {
"description": "Description",
"consumes": [
"application/json"
],
"produces": [
"application/json"
],
"tags": [
"Base"
],
"summary": "Responds to health check",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
},
"404": {
"description": "Not Found",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"common.ErrResponse": {
"type": "object",
"properties": {
"code": {
"description": "application-specific error code",
"type": "integer"
},
"error": {
"description": "application-level error message, for debugging",
"type": "string"
},
"status": {
"description": "user-level status message",
"type": "string"
}
}
},
"common.TextResponse": {
"type": "object",
"properties": {
"status": {
"description": "user-level status message",
"type": "string"
},
"text": {
"description": "application-specific error code",
"type": "string"
}
}
},
"ktmtrainbot.BookingCreateRequest": {
"type": "object",
"required": [
"name",
"passport",
"passportExpiry",
"travelDate"
],
"properties": {
"contact": {
"type": "string"
},
"gender": {
"type": "string"
},
"name": {
"type": "string"
},
"passport": {
"type": "string"
},
"passportExpiry": {
"type": "string"
},
"timeCode": {
"type": "string"
},
"travelDate": {
"type": "string"
}
}
},
"ktmtrainbot.BookingResponse": {
"type": "object",
"properties": {
"contact": {
"type": "string"
},
"gender": {
"type": "string"
},
"id": {
"type": "string"
},
"name": {
"type": "string"
},
"passport": {
"type": "string"
},
"passportExpiry": {
"type": "string"
},
"status": {
"type": "string"
},
"timeCode": {
"type": "string"
},
"travelDate": {
"type": "string"
}
}
},
"ktmtrainbot.ServerTimeResponse": {
"type": "object",
"properties": {
"serverLocalTime": {
"type": "string"
}
}
},
"user.ProfileRequest": {
"type": "object",
"properties": {
"ktmTrainCreditCard": {
"type": "string"
},
"ktmTrainCreditCardCVV": {
"type": "string"
},
"ktmTrainCreditCardExpiry": {
"type": "string"
},
"ktmTrainCreditCardType": {
"type": "string"
},
"ktmTrainPassword": {
"type": "string"
},
"ktmTrainUsername": {
"type": "string"
}
}
},
"user.ProfileResponse": {
"type": "object",
"properties": {
"ktmTrainCreditCard": {
"type": "string"
},
"ktmTrainCreditCardCVV": {
"type": "string"
},
"ktmTrainCreditCardExpiry": {
"type": "string"
},
"ktmTrainCreditCardType": {
"type": "string"
},
"ktmTrainPassword": {
"type": "string"
},
"ktmTrainUsername": {
"type": "string"
}
}
},
"user.UserLoginRequest": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"password": {
"type": "string"
},
"username": {
"type": "string",
"maxLength": 100,
"minLength": 2
}
}
},
"user.UserRegisterRequest": {
"type": "object",
"required": [
"password",
"username"
],
"properties": {
"password": {
"type": "string",
"maxLength": 100,
"minLength": 6
},
"username": {
"type": "string",
"maxLength": 100,
"minLength": 2
}
}
},
"user.UserResponse": {
"type": "object",
"properties": {
"id": {
"type": "string"
},
"profile": {
"$ref": "#/definitions/user.ProfileResponse"
},
"username": {
"type": "string"
}
}
}
}
}`
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = &swag.Spec{
Version: "1.0",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "KTM Train Booking Bot",
Description: "API for frontend - built on Go-chi",
InfoInstanceName: "swagger",
SwaggerTemplate: docTemplate,
}
func init() {
swag.Register(SwaggerInfo.InstanceName(), SwaggerInfo)
}