Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat:增加swag的依赖和用户接口显示 #345

Merged
merged 23 commits into from
May 20, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
3d14d07
feat: 增加操作日志请求头查询和清空日志功能
nangongchengfeng May 15, 2024
3a60303
Merge branch 'main' of https://github.com/nangongchengfeng/go-ldap-admin
nangongchengfeng May 15, 2024
86f19c9
fix: r 变量未使用
nangongchengfeng May 15, 2024
14a43fb
增加数据库初始化数据
nangongchengfeng May 15, 2024
750cae6
fix: 移除r变量未使用
nangongchengfeng May 15, 2024
f08f994
Merge branch 'eryajf:main' into main
nangongchengfeng May 17, 2024
3f7e0a8
feat:增加swag的依赖和用户接口显示
nangongchengfeng May 17, 2024
6dbe290
fix:版本保持一致,增加swag的依赖
nangongchengfeng May 17, 2024
9485ef3
fix:恢复高版本
nangongchengfeng May 17, 2024
c9095a5
fix:修改依赖版本
nangongchengfeng May 17, 2024
9bd3f1a
fix:go.mod
nangongchengfeng May 18, 2024
5e1e9c9
fix:保持版本一致
nangongchengfeng May 18, 2024
b55272c
fix:保持版本一致
nangongchengfeng May 18, 2024
8da2d49
fix:修复tag标签为基础管理
nangongchengfeng May 19, 2024
28cbf07
feat:增加用户管理的12个接口显示
nangongchengfeng May 19, 2024
b5e8e49
feat:增加分组管理的14个接口显示
nangongchengfeng May 20, 2024
c2b760f
feat:增加角色管理的8个接口显示
nangongchengfeng May 20, 2024
70ec4c5
feat:增加菜单管理的5个接口显示
nangongchengfeng May 20, 2024
2fcdb56
feat:增加接口管理的5个接口显示
nangongchengfeng May 20, 2024
af77717
feat:增加操作日志管理的3个接口显示
nangongchengfeng May 20, 2024
73def36
feat:增加字段关系管理的4个接口显示
nangongchengfeng May 20, 2024
b8cf0f0
feat:增加登录接口注解
nangongchengfeng May 20, 2024
29612b6
feat:增加登录接口注解
nangongchengfeng May 20, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
feat:增加swag的依赖和用户接口显示
  • Loading branch information
nangongchengfeng committed May 17, 2024
commit 3f7e0a829c77c92c02998b7108a219d05a41a745
8 changes: 8 additions & 0 deletions controller/a_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,15 @@ func Run(c *gin.Context, req interface{}, fn func() (interface{}, interface{}))
tools.Success(c, data)
}

// Demo
// @Summary 健康检测
// @Tags 用户管理
// @Produce json
// @Description 健康检测
// @Success 200 {object} response.ResponseBody
// @router /base/ping [get]
func Demo(c *gin.Context) {
// 健康检测
CodeDebug()
c.JSON(http.StatusOK, tools.H{"code": 200, "msg": "ok", "data": "pong"})
}
Expand Down
41 changes: 40 additions & 1 deletion controller/base_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ import (
type BaseController struct{}

// SendCode 给用户邮箱发送验证码
// @Summary 发送验证码
// @Description 向指定邮箱发送验证码
// @Tags 用户管理
// @Accept application/json
// @Produce application/json
// @Param data body request.BaseSendCodeReq true "发送验证码请求数据"
// @Success 200 {object} response.ResponseBody
// @Router /base/sendcode [post]
func (m *BaseController) SendCode(c *gin.Context) {
req := new(request.BaseSendCodeReq)
Run(c, req, func() (interface{}, interface{}) {
Expand All @@ -18,6 +26,14 @@ func (m *BaseController) SendCode(c *gin.Context) {
}

// ChangePwd 用户通过邮箱修改密码
// @Summary 用户通过邮箱修改密码
// @Description 使用邮箱验证码修改密码
// @Tags 用户管理
// @Accept application/json
// @Produce application/json
// @Param data body request.BaseChangePwdReq true "发送验证码请求数据"
// @Success 200 {object} response.ResponseBody
// @Router /base/changePwd [post]
func (m *BaseController) ChangePwd(c *gin.Context) {
req := new(request.BaseChangePwdReq)
Run(c, req, func() (interface{}, interface{}) {
Expand All @@ -26,14 +42,29 @@ func (m *BaseController) ChangePwd(c *gin.Context) {
}

// Dashboard 系统首页展示数据
// @Summary 获取仪表盘数据
// @Description 获取系统仪表盘概览数据
// @Tags 用户管理
// @Accept application/json
// @Produce application/json
// @Success 200 {object} response.ResponseBody
// @Router /base/dashboard [get]
func (m *BaseController) Dashboard(c *gin.Context) {
req := new(request.BaseDashboardReq)
Run(c, req, func() (interface{}, interface{}) {
return logic.Base.Dashboard(c, req)
})
}

// EncryptPasswd 生成加密密码
// EncryptPasswd 密码加密
// @Summary 密码加密
// @Description 将明文密码加密
// @Tags 用户管理
// @Accept application/json
// @Produce application/json
// @Param passwd query string true "需要加密的明文密码"
// @Success 200 {object} response.ResponseBody
// @Router /base/encryptpwd [get]
func (m *BaseController) EncryptPasswd(c *gin.Context) {
req := new(request.EncryptPasswdReq)
Run(c, req, func() (interface{}, interface{}) {
Expand All @@ -42,6 +73,14 @@ func (m *BaseController) EncryptPasswd(c *gin.Context) {
}

// DecryptPasswd 密码解密为明文
// @Summary 密码解密
// @Description 将加密后的密码解密为明文
// @Tags 用户管理
// @Accept application/json
// @Produce application/json
// @Param passwd query string true "需要解密的加密密码"
// @Success 200 {object} response.ResponseBody
// @Router /base/decryptpwd [get]
func (m *BaseController) DecryptPasswd(c *gin.Context) {
req := new(request.DecryptPasswdReq)
Run(c, req, func() (interface{}, interface{}) {
Expand Down
Loading
Loading