315 lines
9.3 KiB
Go
315 lines
9.3 KiB
Go
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
|
// This file was generated by swaggo/swag
|
|
|
|
package docs
|
|
|
|
import (
|
|
"bytes"
|
|
"encoding/json"
|
|
"strings"
|
|
|
|
"github.com/alecthomas/template"
|
|
"github.com/swaggo/swag"
|
|
)
|
|
|
|
var doc = `{
|
|
"schemes": {{ marshal .Schemes }},
|
|
"swagger": "2.0",
|
|
"info": {
|
|
"description": "{{.Description}}",
|
|
"title": "{{.Title}}",
|
|
"contact": {},
|
|
"version": "{{.Version}}"
|
|
},
|
|
"host": "{{.Host}}",
|
|
"basePath": "{{.BasePath}}",
|
|
"paths": {
|
|
"/upload/{field}": {
|
|
"post": {
|
|
"description": "upload file for user, one by one",
|
|
"consumes": [
|
|
"multipart/form-data"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"uploadfile"
|
|
],
|
|
"summary": "Upload File",
|
|
"operationId": "upload-file",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User struct field",
|
|
"name": "field",
|
|
"in": "path",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "UUID",
|
|
"name": "id",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "string",
|
|
"description": "File name",
|
|
"name": "file_name",
|
|
"in": "formData",
|
|
"required": true
|
|
},
|
|
{
|
|
"type": "file",
|
|
"description": "File data",
|
|
"name": "input",
|
|
"in": "formData",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.USER"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user": {
|
|
"post": {
|
|
"description": "create or update user",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"createuser"
|
|
],
|
|
"summary": "Create User",
|
|
"operationId": "create-user",
|
|
"parameters": [
|
|
{
|
|
"description": "User data",
|
|
"name": "input",
|
|
"in": "body",
|
|
"required": true,
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.USER"
|
|
}
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.USER"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"/user/{id}": {
|
|
"get": {
|
|
"description": "get user by uuid",
|
|
"consumes": [
|
|
"application/json"
|
|
],
|
|
"produces": [
|
|
"application/json"
|
|
],
|
|
"tags": [
|
|
"getuser"
|
|
],
|
|
"summary": "Get User by UID",
|
|
"operationId": "get-user-by-uid",
|
|
"parameters": [
|
|
{
|
|
"type": "string",
|
|
"description": "User ID",
|
|
"name": "id",
|
|
"in": "path",
|
|
"required": true
|
|
}
|
|
],
|
|
"responses": {
|
|
"200": {
|
|
"description": "OK",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.USER"
|
|
}
|
|
},
|
|
"400": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"404": {
|
|
"description": "Bad Request",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
},
|
|
"default": {
|
|
"description": "",
|
|
"schema": {
|
|
"$ref": "#/definitions/structs.ANSWERAPI"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"definitions": {
|
|
"structs.ANSWERAPI": {
|
|
"type": "object",
|
|
"properties": {
|
|
"additional": {
|
|
"type": "string"
|
|
},
|
|
"data": {
|
|
"type": "object"
|
|
},
|
|
"error": {
|
|
"type": "string"
|
|
},
|
|
"status": {
|
|
"type": "boolean"
|
|
}
|
|
}
|
|
},
|
|
"structs.USER": {
|
|
"type": "object",
|
|
"properties": {
|
|
"birthday": {
|
|
"type": "string"
|
|
},
|
|
"certificate": {
|
|
"type": "string"
|
|
},
|
|
"currentlocation": {
|
|
"type": "string"
|
|
},
|
|
"firstname": {
|
|
"type": "string"
|
|
},
|
|
"id": {
|
|
"type": "string"
|
|
},
|
|
"lastname": {
|
|
"type": "string"
|
|
},
|
|
"userpicture": {
|
|
"type": "string"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}`
|
|
|
|
type swaggerInfo struct {
|
|
Version string
|
|
Host string
|
|
BasePath string
|
|
Schemes []string
|
|
Title string
|
|
Description string
|
|
}
|
|
|
|
// SwaggerInfo holds exported Swagger Info so clients can modify it
|
|
var SwaggerInfo = swaggerInfo{
|
|
Version: "0.1",
|
|
Host: "localhost:8080",
|
|
BasePath: "/",
|
|
Schemes: []string{},
|
|
Title: "User Profile Service API",
|
|
Description: "API Server for User Profile Service",
|
|
}
|
|
|
|
type s struct{}
|
|
|
|
func (s *s) ReadDoc() string {
|
|
sInfo := SwaggerInfo
|
|
sInfo.Description = strings.Replace(sInfo.Description, "\n", "\\n", -1)
|
|
|
|
t, err := template.New("swagger_info").Funcs(template.FuncMap{
|
|
"marshal": func(v interface{}) string {
|
|
a, _ := json.Marshal(v)
|
|
return string(a)
|
|
},
|
|
}).Parse(doc)
|
|
if err != nil {
|
|
return doc
|
|
}
|
|
|
|
var tpl bytes.Buffer
|
|
if err := t.Execute(&tpl, sInfo); err != nil {
|
|
return doc
|
|
}
|
|
|
|
return tpl.String()
|
|
}
|
|
|
|
func init() {
|
|
swag.Register(swag.Name, &s{})
|
|
}
|