Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
R
rym-util
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
zhengqiuyun
rym-util
Commits
fc8c061a
Commit
fc8c061a
authored
Aug 10, 2022
by
zhengqiuyun86
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
初始化
parent
24152d41
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
0 deletions
+9
-0
go.mod
go.mod
+2
-0
go.sum
go.sum
+0
-0
router.go
router/router.go
+7
-0
No files found.
go.mod
View file @
fc8c061a
...
...
@@ -14,4 +14,6 @@ require (
require (
github.com/onsi/ginkgo v1.16.5 // indirect
github.com/onsi/gomega v1.20.0 // indirect
github.com/swaggo/files v0.0.0-20220728132757-551d4a08d97a
github.com/swaggo/gin-swagger v1.5.2
)
go.sum
View file @
fc8c061a
This diff is collapsed.
Click to expand it.
router/router.go
View file @
fc8c061a
...
...
@@ -8,6 +8,8 @@ import (
"git.168cad.top/zhengqiuyun/rym-util/util"
"github.com/gin-gonic/gin"
"github.com/gin-gonic/gin/render"
"github.com/swaggo/files"
"github.com/swaggo/gin-swagger"
"net/http"
)
...
...
@@ -20,6 +22,11 @@ func InitGinEngine() *gin.Engine {
})
//自定义验证器
validator
.
RegisterValidate
()
if
conf
.
Env
==
"dev"
||
conf
.
Env
==
"test"
{
//swagger
c
.
GET
(
"/swagger/*any"
,
ginSwagger
.
WrapHandler
(
swaggerFiles
.
Handler
))
log
.
Info
(
"swagger init success"
)
}
return
c
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment