doc: swagger add auth tag

This commit is contained in:
zhangwenjian committed 2020-07-18 14:24:59 +08:00
1 parent ea3408de84
commit b9d0318b45
16 files changed
+97 -97

No files matched your search

+2 -2
View File
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/loginloglist [get]
// @Security
// @Security Bearer
func GetLoginLogList(c *gin.Context) {
var data models.LoginLog
var err error
@@ -59,7 +59,7 @@ func GetLoginLogList(c *gin.Context) {
// @Param infoId path int true "infoId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/loginlog/{infoId} [get]
// @Security
// @Security Bearer
func GetLoginLog(c *gin.Context) {
var LoginLog models.LoginLog
LoginLog.InfoId, _ = tools.StringToInt(c.Param("infoId"))
+2 -2
View File
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/operloglist [get]
// @Security
// @Security Bearer
func GetOperLogList(c *gin.Context) {
var data models.SysOperLog
var err error
@@ -60,7 +60,7 @@ func GetOperLogList(c *gin.Context) {
// @Param infoId path int true "infoId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/operlog/{infoId} [get]
// @Security
// @Security Bearer
func GetOperLog(c *gin.Context) {
var OperLog models.SysOperLog
OperLog.OperId, _ = tools.StringToInt(c.Param("operId"))
+3 -3
View File
@@ -20,7 +20,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/configList [get]
// @Security
// @Security Bearer
func GetConfigList(c *gin.Context) {
var data models.SysConfig
var err error
@@ -60,7 +60,7 @@ func GetConfigList(c *gin.Context) {
// @Param configId path int true "配置编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/config/{configId} [get]
// @Security
// @Security Bearer
func GetConfig(c *gin.Context) {
var Config models.SysConfig
Config.ConfigId, _ = tools.StringToInt(c.Param("configId"))
@@ -79,7 +79,7 @@ func GetConfig(c *gin.Context) {
// @Param configKey path int true "configKey"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/configKey/{configKey} [get]
// @Security
// @Security Bearer
func GetConfigByConfigKey(c *gin.Context) {
var Config models.SysConfig
Config.ConfigKey = c.Param("configKey")
+2 -2
View File
@@ -17,7 +17,7 @@ import (
// @Param position query string false "position"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/deptList [get]
// @Security
// @Security Bearer
func GetDeptList(c *gin.Context) {
var Dept models.SysDept
Dept.DeptName = c.Request.FormValue("deptName")
@@ -46,7 +46,7 @@ func GetDeptTree(c *gin.Context) {
// @Param position query string false "position"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dept/{deptId} [get]
// @Security
// @Security Bearer
func GetDept(c *gin.Context) {
var Dept models.SysDept
Dept.DeptId, _ = tools.StringToInt(c.Param("deptId"))
+3 -3
View File
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/data/list [get]
// @Security
// @Security Bearer
func GetDictDataList(c *gin.Context) {
var data models.DictData
var err error
@@ -61,7 +61,7 @@ func GetDictDataList(c *gin.Context) {
// @Param dictCode path int true "字典编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/data/{dictCode} [get]
// @Security
// @Security Bearer
func GetDictData(c *gin.Context) {
var DictData models.DictData
DictData.DictLabel = c.Request.FormValue("dictLabel")
@@ -79,7 +79,7 @@ func GetDictData(c *gin.Context) {
// @Param dictType path int true "dictType"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/databyType/{dictType} [get]
// @Security
// @Security Bearer
func GetDictDataByDictType(c *gin.Context) {
var DictData models.DictData
DictData.DictType = c.Param("dictType")
+2 -2
View File
@@ -19,7 +19,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/type/list [get]
// @Security
// @Security Bearer
func GetDictTypeList(c *gin.Context) {
var data models.DictType
var err error
@@ -59,7 +59,7 @@ func GetDictTypeList(c *gin.Context) {
// @Param dictId path int true "字典类型编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/dict/type/{dictId} [get]
// @Security
// @Security Bearer
func GetDictType(c *gin.Context) {
var DictType models.DictType
DictType.DictName = c.Request.FormValue("dictName")
+2 -2
View File
@@ -16,7 +16,7 @@ import (
// @Param status query string false "status"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/post [get]
// @Security
// @Security Bearer
func GetPostList(c *gin.Context) {
var data models.Post
var err error
@@ -48,7 +48,7 @@ func GetPostList(c *gin.Context) {
// @Param postId path int true "postId"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/post/{postId} [get]
// @Security
// @Security Bearer
func GetPost(c *gin.Context) {
var Post models.Post
Post.PostId, _ = tools.StringToInt(c.Param("postId"))
+1 -1
View File
@@ -18,7 +18,7 @@ import (
// @Param pageIndex query int false "页码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/rolelist [get]
// @Security
// @Security Bearer
func GetRoleList(c *gin.Context) {
var data models.SysRole
var err error
+3 -3
View File
@@ -57,7 +57,7 @@ func GetSysUserList(c *gin.Context) {
// @Param userId path int true "用户编码"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sysUser/{userId} [get]
// @Security
// @Security Bearer
func GetSysUser(c *gin.Context) {
var SysUser models.SysUser
SysUser.UserId, _ = tools.StringToInt(c.Param("userId"))
@@ -88,7 +88,7 @@ func GetSysUser(c *gin.Context) {
// @Tags 个人中心
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/user/profile [get]
// @Security
// @Security Bearer
func GetSysUserProfile(c *gin.Context) {
var SysUser models.SysUser
userId := tools.GetUserIdStr(c)
@@ -128,7 +128,7 @@ func GetSysUserProfile(c *gin.Context) {
// @Tags 用户
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sysUser [get]
// @Security
// @Security Bearer
func GetSysUserInit(c *gin.Context) {
var SysRole models.SysRole
var Post models.Post
+1 -1
View File
@@ -97,7 +97,7 @@ func GenMenuAndApi(c *gin.Context) {
Mmenu.Permission = tab.PackageName + ":" + tab.ModuleName + ":list"
Mmenu.ParentId = 0
Mmenu.NoCache = false
Mmenu.Component = tab.ModuleName + "/index"
Mmenu.Component = "/" + tab.ModuleName + "/index"
Mmenu.Sort = 0
Mmenu.Visible = "0"
Mmenu.IsFrame = "0"
+1 -1
View File
@@ -54,7 +54,7 @@ func GetSysTableList(c *gin.Context) {
// @Param configKey path int true "configKey"
// @Success 200 {object} app.Response "{"code": 200, "data": [...]}"
// @Router /api/v1/sys/tables/info/{tableId} [get]
// @Security
// @Security Bearer
func GetSysTables(c *gin.Context) {
var data tools.SysTables
data.TableId, _ = tools2.StringToInt(c.Param("tableId"))
+25 -25
View File
@@ -1,6 +1,6 @@
// GENERATED BY THE COMMAND ABOVE; DO NOT EDIT
// This file was generated by swaggo/swag at
// 2020-07-15 20:40:18.457047 +0800 CST m=+0.111190243
// 2020-07-17 22:43:59.920467 +0800 CST m=+0.161144112
package docs
@@ -70,7 +70,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -125,7 +125,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -156,7 +156,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -363,7 +363,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -425,7 +425,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "分页列表",
@@ -539,7 +539,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -593,7 +593,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -648,7 +648,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -751,7 +751,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -805,7 +805,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -932,7 +932,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -987,7 +987,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1359,7 +1359,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1416,7 +1416,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1470,7 +1470,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1590,7 +1590,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1767,7 +1767,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "Get JSON",
@@ -1951,7 +1951,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2043,7 +2043,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2095,7 +2095,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2212,7 +2212,7 @@ var doc = `{
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2261,7 +2261,7 @@ var doc = `{
},
"/login": {
"post": {
"description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n开发模式:需要注意全部字段不能为空,账号密码外可以传入0值",
"description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值",
"consumes": [
"application/json"
],
@@ -2292,7 +2292,7 @@ var doc = `{
"post": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取token",
@@ -3341,7 +3341,7 @@ type swaggerInfo struct {
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "0.0.1",
Version: "1.0.1",
Host: "",
BasePath: "",
Schemes: []string{},
+24 -24
View File
@@ -8,7 +8,7 @@
"name": "MIT",
"url": "https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md"
},
"version": "0.0.1"
"version": "1.0.1"
},
"paths": {
"/api/v1/config": {
@@ -52,7 +52,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -107,7 +107,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -138,7 +138,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -345,7 +345,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -407,7 +407,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "分页列表",
@@ -521,7 +521,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -575,7 +575,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -630,7 +630,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -733,7 +733,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -787,7 +787,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -914,7 +914,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -969,7 +969,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1341,7 +1341,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1398,7 +1398,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1452,7 +1452,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1572,7 +1572,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -1749,7 +1749,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "Get JSON",
@@ -1933,7 +1933,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2025,7 +2025,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2077,7 +2077,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2194,7 +2194,7 @@
"get": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取JSON",
@@ -2243,7 +2243,7 @@
},
"/login": {
"post": {
"description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n开发模式:需要注意全部字段不能为空,账号密码外可以传入0值",
"description": "获取token\nLoginHandler can be used by clients to get a jwt token.\nPayload needs to be json in the form of {\"username\": \"USERNAME\", \"password\": \"PASSWORD\"}.\nReply will be of the form {\"token\": \"TOKEN\"}.\ndev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password\n注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值",
"consumes": [
"application/json"
],
@@ -2274,7 +2274,7 @@
"post": {
"security": [
{
"": []
"Bearer": []
}
],
"description": "获取token",
+24 -24
View File
@@ -632,7 +632,7 @@ info:
name: MIT
url: https://github.com/wenjianzhang/go-admin/blob/master/LICENSE.md
title: go-admin API
version: 0.0.1
version: 1.0.1
paths:
/api/v1/config:
put:
@@ -688,7 +688,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取配置
tags:
- 配置
@@ -707,7 +707,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取配置
tags:
- 配置
@@ -741,7 +741,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 配置列表数据
tags:
- 配置
@@ -861,7 +861,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 部门列表数据
tags:
- 部门
@@ -904,7 +904,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 分页部门列表数据
tags:
- 部门
@@ -984,7 +984,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过编码获取字典数据
tags:
- 字典数据
@@ -1018,7 +1018,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 字典数据列表
tags:
- 字典数据
@@ -1037,7 +1037,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过字典类型获取字典数据
tags:
- 字典数据
@@ -1117,7 +1117,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过字典id获取字典类型
tags:
- 字典类型
@@ -1151,7 +1151,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 字典类型列表数据
tags:
- 字典类型
@@ -1231,7 +1231,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过编码获取登录日志
tags:
- 登录日志
@@ -1265,7 +1265,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 登录日志列表
tags:
- 登录日志
@@ -1484,7 +1484,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 通过编码获取登录日志
tags:
- 登录日志
@@ -1535,7 +1535,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 登录日志列表
tags:
- 登录日志
@@ -1565,7 +1565,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 岗位列表数据
tags:
- 岗位
@@ -1649,7 +1649,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取岗位信息
tags:
- 岗位
@@ -1758,7 +1758,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 角色列表数据
tags:
- 角色/Role
@@ -1874,7 +1874,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取配置
tags:
- 工具 - 生成表
@@ -1911,7 +1911,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取用户角色和职位
tags:
- 用户
@@ -1950,7 +1950,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取用户
tags:
- 用户
@@ -2018,7 +2018,7 @@ paths:
schema:
$ref: '#/definitions/app.Response'
security:
- "": []
- Bearer: []
summary: 获取个人中心用户
tags:
- 个人中心
@@ -2051,7 +2051,7 @@ paths:
Payload needs to be json in the form of {"username": "USERNAME", "password": "PASSWORD"}.
Reply will be of the form {"token": "TOKEN"}.
dev mode:It should be noted that all fields cannot be empty, and a value of 0 can be passed in addition to the account password
开发模式:需要注意全部字段不能为空,账号密码外可以传入0值
注意:开发模式:需要注意全部字段不能为空,账号密码外可以传入0值
parameters:
- description: account
in: body
@@ -2079,7 +2079,7 @@ paths:
schema:
type: string
security:
- "": []
- Bearer: []
summary: 退出登录
/sd/cpu:
get:
+1 -1
View File
@@ -122,7 +122,7 @@ func LoginLogToDB(c *gin.Context, status string, msg string, username string) {
// @Product application/json
// @Success 200 {string} string "{"code": 200, "msg": "成功退出系统" }"
// @Router /logout [post]
// @Security
// @Security Bearer
func LogOut(c *gin.Context) {
var loginlog models.LoginLog
ua := user_agent.New(c.Request.UserAgent())
+1 -1
View File
@@ -5,7 +5,7 @@ import (
)
// @title go-admin API
// @version 0.0.1
// @version 1.0.1
// @description 基于Gin + Vue + Element UI的前后端分离权限管理系统的接口文档
// @description 添加qq群: 74520518 进入技术交流群 请备注,谢谢!
// @license.name MIT