// Package docs GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag
package docs

import (
	"bytes"
	"encoding/json"
	"strings"
	"text/template"

	"github.com/swaggo/swag"
)

var doc = `{
    "schemes": {{ marshal .Schemes }},
    "swagger": "2.0",
    "info": {
        "description": "{{escape .Description}}",
        "title": "{{.Title}}",
        "termsOfService": "http://swagger.io/terms/",
        "contact": {},
        "license": {
            "name": "Apache 2.0",
            "url": "http://www.apache.org/licenses/LICENSE-2.0.html"
        },
        "version": "{{.Version}}"
    },
    "host": "{{.Host}}",
    "basePath": "{{.BasePath}}",
    "paths": {
        "/project": {
            "get": {
                "description": "Get project list in pages",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Get Project List",
                "parameters": [
                    {
                        "type": "integer",
                        "name": "page",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "name": "page_size",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.getProjectListRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a new project",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Create Project",
                "parameters": [
                    {
                        "description": "create project request",
                        "name": "createProjectReq",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/project.createProjectReq"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.createProjectRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            }
        },
        "/project/{project_id}": {
            "get": {
                "description": "Get project info in pages",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Get Project Info",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.getProjectInfoRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete project",
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Delete Project",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.deleteProjectRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            }
        },
        "/project/{project_id}/report": {
            "get": {
                "description": "Get specific project report",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Get Project Report",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.getProjectReportRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            }
        },
        "/project/{project_id}/task": {
            "get": {
                "description": "Get all tasks in specific project",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Get Task List",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "name": "page",
                        "in": "query",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "name": "page_size",
                        "in": "query"
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.getTaskListRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            },
            "post": {
                "description": "Create a new scan task",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Create Task",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "description": "create task request",
                        "name": "createTaskReq",
                        "in": "body",
                        "required": true,
                        "schema": {
                            "$ref": "#/definitions/project.createTaskReq"
                        }
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.createTaskRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            }
        },
        "/project/{project_id}/task/{task_id}": {
            "get": {
                "description": "Get specific task info",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Get Task Info",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "task id",
                        "name": "task_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.getTaskInfoRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            },
            "delete": {
                "description": "Delete specific task",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Delete Task",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "task id",
                        "name": "task_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.deleteTaskRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            }
        },
        "/project/{project_id}/task/{task_id}/report": {
            "get": {
                "description": "Get specific task report",
                "consumes": [
                    "application/json"
                ],
                "produces": [
                    "application/json"
                ],
                "tags": [
                    "Project"
                ],
                "summary": "Get Task Report",
                "parameters": [
                    {
                        "type": "integer",
                        "description": "project id",
                        "name": "project_id",
                        "in": "path",
                        "required": true
                    },
                    {
                        "type": "integer",
                        "description": "task id",
                        "name": "task_id",
                        "in": "path",
                        "required": true
                    }
                ],
                "responses": {
                    "200": {
                        "description": "OK",
                        "schema": {
                            "allOf": [
                                {
                                    "$ref": "#/definitions/controller.CommonResult"
                                },
                                {
                                    "type": "object",
                                    "properties": {
                                        "data": {
                                            "$ref": "#/definitions/project.getTaskReportRsp"
                                        }
                                    }
                                }
                            ]
                        }
                    },
                    "500": {
                        "description": "Internal Server Error",
                        "schema": {
                            "$ref": "#/definitions/controller.CommonResult"
                        }
                    }
                }
            }
        }
    },
    "definitions": {
        "controller.CommonResult": {
            "type": "object",
            "properties": {
                "code": {
                    "type": "integer"
                },
                "data": {
                    "type": "object"
                },
                "message": {
                    "type": "string"
                }
            }
        },
        "model.ProjectModel": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                }
            }
        },
        "model.TaskModel": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                },
                "version": {
                    "type": "string"
                }
            }
        },
        "model.VulnerabilityModel": {
            "type": "object",
            "properties": {
                "class": {
                    "type": "string"
                },
                "description": {
                    "type": "string"
                },
                "fixed_version": {
                    "type": "string"
                },
                "id": {
                    "type": "integer"
                },
                "installed_version": {
                    "type": "string"
                },
                "package_name": {
                    "type": "string"
                },
                "severity": {
                    "type": "string"
                },
                "target": {
                    "type": "string"
                },
                "title": {
                    "type": "string"
                },
                "type": {
                    "type": "string"
                },
                "vulnerability_id": {
                    "type": "string"
                }
            }
        },
        "project.createProjectReq": {
            "type": "object",
            "required": [
                "name"
            ],
            "properties": {
                "name": {
                    "type": "string"
                }
            }
        },
        "project.createProjectRsp": {
            "type": "object",
            "properties": {
                "project": {
                    "$ref": "#/definitions/model.ProjectModel"
                }
            }
        },
        "project.createTaskReq": {
            "type": "object",
            "required": [
                "type",
                "url"
            ],
            "properties": {
                "type": {
                    "type": "string"
                },
                "url": {
                    "type": "string"
                }
            }
        },
        "project.createTaskRsp": {
            "type": "object",
            "properties": {
                "task": {
                    "$ref": "#/definitions/model.TaskModel"
                }
            }
        },
        "project.deleteProjectRsp": {
            "type": "object"
        },
        "project.deleteTaskRsp": {
            "type": "object"
        },
        "project.getProjectInfoRsp": {
            "type": "object",
            "properties": {
                "project": {
                    "$ref": "#/definitions/project.projectInfo"
                }
            }
        },
        "project.getProjectListRsp": {
            "type": "object",
            "properties": {
                "projects": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/project.projectInfo"
                    }
                }
            }
        },
        "project.getProjectReportRsp": {
            "type": "object",
            "properties": {
                "project": {
                    "$ref": "#/definitions/project.projectInfo"
                },
                "tasks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/project.getTaskReportRsp"
                    }
                }
            }
        },
        "project.getTaskInfoRsp": {
            "type": "object",
            "properties": {
                "task": {
                    "$ref": "#/definitions/project.taskInfo"
                }
            }
        },
        "project.getTaskListRsp": {
            "type": "object",
            "properties": {
                "tasks": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/project.taskInfo"
                    }
                }
            }
        },
        "project.getTaskReportRsp": {
            "type": "object",
            "properties": {
                "task": {
                    "$ref": "#/definitions/project.taskInfo"
                },
                "vulnerabilities": {
                    "type": "array",
                    "items": {
                        "$ref": "#/definitions/model.VulnerabilityModel"
                    }
                }
            }
        },
        "project.projectInfo": {
            "type": "object",
            "properties": {
                "id": {
                    "type": "integer"
                },
                "image": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "repository": {
                    "type": "integer"
                },
                "total": {
                    "type": "integer"
                }
            }
        },
        "project.taskInfo": {
            "type": "object",
            "properties": {
                "critical": {
                    "type": "integer"
                },
                "high": {
                    "type": "integer"
                },
                "id": {
                    "type": "integer"
                },
                "low": {
                    "type": "integer"
                },
                "medium": {
                    "type": "integer"
                },
                "name": {
                    "type": "string"
                },
                "status": {
                    "type": "string"
                },
                "total": {
                    "type": "integer"
                },
                "type": {
                    "type": "string"
                },
                "unknown": {
                    "type": "integer"
                },
                "url": {
                    "type": "string"
                },
                "version": {
                    "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:     "1.0",
	Host:        "",
	BasePath:    "/api/v1",
	Schemes:     []string{},
	Title:       "Baseline Server API",
	Description: "API Documents of Baseline Check Server",
}

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)
		},
		"escape": func(v interface{}) string {
			// escape tabs
			str := strings.Replace(v.(string), "\t", "\\t", -1)
			// replace " with \", and if that results in \\", replace that with \\\"
			str = strings.Replace(str, "\"", "\\\"", -1)
			return strings.Replace(str, "\\\\\"", "\\\\\\\"", -1)
		},
	}).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{})
}
