|
|
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
|
|
|
// This file was generated by swaggo/swag at
|
|
|
// 2020-03-24 15:41:57.6304037 +0800 CST m=+0.035932001
|
|
|
|
|
|
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": {},
|
|
|
"license": {},
|
|
|
"version": "{{.Version}}"
|
|
|
},
|
|
|
"host": "{{.Host}}",
|
|
|
"basePath": "{{.BasePath}}",
|
|
|
"paths": {
|
|
|
"/data/datatype": {
|
|
|
"get": {
|
|
|
"description": "共享的数据类型有哪些",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"统一数据类"
|
|
|
],
|
|
|
"summary": "共享的数据类型有哪些",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "访问票据",
|
|
|
"name": "token",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/Model.Res"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"x-lengthlimit": [
|
|
|
{
|
|
|
"token": "26,26"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
"/data/share": {
|
|
|
"get": {
|
|
|
"description": "数据分发",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"统一数据类"
|
|
|
],
|
|
|
"summary": "数据分发",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "访问票据",
|
|
|
"name": "token",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "获取哪一类数据",
|
|
|
"name": "data_type",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "开始时间",
|
|
|
"name": "start_time",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "主键值,如果不清楚第一次可以传0,以后按返回的数据再次传入即可",
|
|
|
"name": "pk",
|
|
|
"in": "query",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/Model.Res"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"x-datetime": [
|
|
|
"start_time"
|
|
|
],
|
|
|
"x-lengthlimit": [
|
|
|
{
|
|
|
"token": "26,26"
|
|
|
},
|
|
|
{
|
|
|
"data_type": "2,20"
|
|
|
},
|
|
|
{
|
|
|
"start_time": "19,19"
|
|
|
},
|
|
|
{
|
|
|
"pk": "1,10"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
"/data/token": {
|
|
|
"post": {
|
|
|
"description": "获取授权票据",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"统一数据类"
|
|
|
],
|
|
|
"summary": "获取授权票据",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "第三方系统的访问id",
|
|
|
"name": "id",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
},
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "第三方系统的访问密码",
|
|
|
"name": "secret",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/Model.Res"
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"x-lengthlimit": [
|
|
|
{
|
|
|
"id": "20,20"
|
|
|
},
|
|
|
{
|
|
|
"secret": "26,26"
|
|
|
}
|
|
|
]
|
|
|
}
|
|
|
},
|
|
|
"/oauth2/authorize": {
|
|
|
"post": {
|
|
|
"description": "数据上报",
|
|
|
"consumes": [
|
|
|
"application/x-www-form-urlencoded"
|
|
|
],
|
|
|
"produces": [
|
|
|
"application/json"
|
|
|
],
|
|
|
"tags": [
|
|
|
"统一数据类"
|
|
|
],
|
|
|
"summary": "数据上报",
|
|
|
"parameters": [
|
|
|
{
|
|
|
"type": "string",
|
|
|
"description": "访问票据",
|
|
|
"name": "access_token",
|
|
|
"in": "formData",
|
|
|
"required": true
|
|
|
}
|
|
|
],
|
|
|
"responses": {
|
|
|
"200": {
|
|
|
"description": "OK",
|
|
|
"schema": {
|
|
|
"$ref": "#/definitions/Model.Res"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
},
|
|
|
"definitions": {
|
|
|
"Model.Res": {
|
|
|
"type": "object",
|
|
|
"properties": {
|
|
|
"code": {
|
|
|
"description": "omitempty有值就输出,没值则不输出",
|
|
|
"type": "object"
|
|
|
},
|
|
|
"count": {
|
|
|
"type": "object"
|
|
|
},
|
|
|
"data": {
|
|
|
"type": "object"
|
|
|
},
|
|
|
"expire_time": {
|
|
|
"description": "过期时间",
|
|
|
"type": "object"
|
|
|
},
|
|
|
"msg": {
|
|
|
"description": "omitempty有值就输出,没值则不输出",
|
|
|
"type": "object"
|
|
|
},
|
|
|
"pk": {
|
|
|
"type": "object"
|
|
|
},
|
|
|
"start_time": {
|
|
|
"type": "object"
|
|
|
},
|
|
|
"token": {
|
|
|
"description": "omitempty有值就输出,没值则不输出",
|
|
|
"type": "object"
|
|
|
},
|
|
|
"total_count": {
|
|
|
"type": "object"
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}`
|
|
|
|
|
|
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: "127.0.0.1:8003",
|
|
|
BasePath: "",
|
|
|
Schemes: []string{},
|
|
|
Title: "统一数据中心",
|
|
|
Description: "由东师理想数智创新中心研发并提供支持",
|
|
|
}
|
|
|
|
|
|
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{})
|
|
|
}
|