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.

700 lines
22 KiB

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

// 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": {
"/oauth2/AddClient": {
"post": {
"description": "增加一个接入系统",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"统一认证管理"
],
"summary": "增加一个接入系统",
"parameters": [
{
"type": "string",
"description": "access_key",
"name": "access_key",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "secret_key",
"name": "secret_key",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "redirect_uri",
"name": "redirect_uri",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/DelClient": {
"post": {
"description": "删除一个接入系统",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"统一认证管理"
],
"summary": "删除一个接入系统",
"parameters": [
{
"type": "string",
"description": "access_key",
"name": "access_key",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/access_token": {
"post": {
"description": "获取access_token",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "获取access_token",
"parameters": [
{
"type": "string",
"description": "code",
"name": "code",
"in": "query"
},
{
"type": "string",
"description": "refresh_token",
"name": "refresh_token",
"in": "query"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/authorize": {
"get": {
"description": "登录验证跳转路由",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "登录验证跳转路由",
"parameters": [
{
"type": "string",
"description": "client_id",
"name": "client_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "redirect_uri",
"name": "redirect_uri",
"in": "query",
"required": true
},
{
"type": "string",
"description": "device_id",
"name": "device_id",
"in": "query",
"required": true
},
{
"type": "string",
"description": "第三方系统回跳的页面地址",
"name": "oauth_callback",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"X-EmptyLimit": [
"client_id",
"redirect_uri",
"device_id",
"oauth_callback"
]
},
"post": {
"description": "验证post",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "验证post",
"parameters": [
{
"type": "string",
"description": "验证码id",
"name": "captchaId",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "验证码值",
"name": "value",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "用户名",
"name": "username",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "密码",
"name": "password",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "设备ID",
"name": "device_id",
"in": "formData",
"required": true
},
{
"type": "string",
"description": "第三方系统的接口回调地址",
"name": "redirect_uri",
"in": "formData"
},
{
"type": "string",
"description": "第三方系统的ID",
"name": "client_id",
"in": "formData"
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Model.Res"
}
}
},
"X-EmptyLimit": [
"username",
"password",
"captchaId",
"value"
],
"X-IntLimit": [
"device_id"
]
}
},
"/oauth2/bindWxUser": {
"get": {
"description": "绑定微信用户",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "绑定微信用户",
"parameters": [
{
"type": "string",
"description": "username",
"name": "username",
"in": "query",
"required": true
},
{
"type": "string",
"description": "password",
"name": "password",
"in": "query",
"required": true
},
{
"type": "string",
"description": "openId",
"name": "openId",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/checkOpenId": {
"get": {
"description": "检查OPENID的是否已经绑定",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "检查OPENID的是否已经绑定",
"parameters": [
{
"type": "string",
"description": "OpenId",
"name": "openid",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/getCaptcha": {
"get": {
"description": "获取验证码(为了以后WEB服务器的集群扩展将验证码保存到redis中避免ip_hash)",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "获取验证码",
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Model.Res"
}
}
}
}
},
"/oauth2/getCaptchaPng": {
"get": {
"description": "获取验证码图片",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "获取验证码图片",
"parameters": [
{
"type": "string",
"description": "captchaId",
"name": "captchaId",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"X-LengthLimit": [
{
"captchaId": "20,20"
}
]
}
},
"/oauth2/logout": {
"get": {
"description": "退出统一认证",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "退出统一认证",
"parameters": [
{
"type": "string",
"description": "redirect_uri",
"name": "redirect_uri",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/resetRemainCount": {
"get": {
"description": "重置错误重试次数限制",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "重置错误重试次数限制",
"parameters": [
{
"type": "string",
"description": "登录用的用户名",
"name": "userName",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"X-EmptyLimit": [
"userName"
]
}
},
"/oauth2/unBindWxUser": {
"get": {
"description": "绑定微信用户",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"解除登录验证类"
],
"summary": "解除绑定微信用户",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
},
"/oauth2/wxLogin": {
"post": {
"description": "微信登录",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"登录验证类"
],
"summary": "微信登录",
"parameters": [
{
"type": "string",
"description": "腾讯返回的code码",
"name": "code",
"in": "formData",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
},
"X-EmptyLimit": [
"code"
]
}
},
"/sso/getAppInfoById": {
"get": {
"description": "根据appId获取接入第三方统一认证系统的信息",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"接入系统维护类"
],
"summary": "根据appId获取接入第三方统一认证系统的信息",
"parameters": [
{
"type": "string",
"description": "系统app_id",
"name": "app_id",
"in": "query",
"required": true
}
],
"responses": {
"200": {
"description": "OK",
"schema": {
"$ref": "#/definitions/Model.AppInfo"
}
}
},
"X-IntLimit": [
"app_id"
]
}
},
"/sso/login": {
"get": {
"description": "manager dsideal4r5t6y7u 为统一认证管理员默认帐号",
"consumes": [
"application/x-www-form-urlencoded"
],
"produces": [
"application/json"
],
"tags": [
"接入系统维护类"
],
"summary": "接入系统管理中心维护的路由跳转",
"responses": {
"200": {
"description": "OK",
"schema": {
"type": "string"
}
}
}
}
}
},
"definitions": {
"Model.AppInfo": {
"type": "object",
"properties": {
"app_key": {
"type": "string"
},
"app_name": {
"type": "string"
},
"app_secret": {
"type": "string"
},
"code": {
"type": "integer"
},
"msg": {
"type": "string"
},
"redirect_uri": {
"type": "string"
}
}
},
"Model.Res": {
"type": "object",
"properties": {
"code": {
"description": "omitempty有值就输出没值则不输出",
"type": "object"
},
"data": {
"description": "omitempty有值就输出没值则不输出",
"type": "object"
},
"items": {
"description": "omitempty有值就输出没值则不输出",
"type": "object"
},
"msg": {
"description": "omitempty有值就输出没值则不输出",
"type": "object"
},
"total_count": {
"description": "个数",
"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: "2.0",
Host: "127.0.0.1:8000",
BasePath: "",
Schemes: []string{},
Title: "东师理想统一认证中心(OAuth2+Sso)",
Description: "参考自xxl-sso",
}
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{})
}