Skip to content

Commit a3ba205

Browse files
committed
初始化路由修改完成
1 parent f085ea0 commit a3ba205

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

src/base/router/router.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,6 @@
11
package router
22

33
import (
4-
"time"
5-
64
ginzap "github.com/gin-contrib/zap"
75
"github.com/gin-gonic/gin"
86
swaggerFiles "github.com/swaggo/files"
@@ -12,7 +10,7 @@ import (
1210
"controller"
1311
)
1412

15-
// 初始化路由
13+
// InitRouter 初始化路由
1614
func InitRouter(port string) {
1715
r := gin.New()
1816

@@ -23,17 +21,12 @@ func InitRouter(port string) {
2321
r.Use(gin.Recovery())
2422

2523
// 将api调用记录全部存放到zap日志中去
26-
r.Use(ginzap.Ginzap(zap.L(), time.RFC3339, false))
24+
r.Use(ginzap.Ginzap(zap.L(), "2006-01-02 15:04:05.000", false))
2725

28-
// 添加用户
2926
r.POST("/gwt/api/v1/user", controller.AddUser)
30-
// 删除用户
3127
r.DELETE("/gwt/api/v1/user", controller.DeleteUser)
32-
// 修改用户
3328
r.PUT("/gwt/api/v1/user", controller.UpdateUser)
34-
// id查询单用户
3529
r.GET("/gwt/api/v1/user/:id", controller.GetUser)
36-
// 多条件分页查询
3730
r.POST("/gwt/api/v1/users")
3831

3932
// swagger

0 commit comments

Comments
 (0)