新增用户管理和个人信息功能,支持CRUD操作和密码修改

This commit is contained in:
2026-07-03 10:18:08 +08:00
parent ca9b1e751c
commit e65b31abb0
8 changed files with 801 additions and 4 deletions
+10
View File
@@ -20,6 +20,16 @@ func Setup(r *gin.Engine) {
auth.Use(middleware.AuthMiddleware())
{
auth.GET("/me", handler.Me)
auth.PUT("/me/password", handler.ChangePassword)
}
admin := r.Group("/api/admin")
admin.Use(middleware.AuthMiddleware(), middleware.AdminMiddleware())
{
admin.GET("/users", handler.ListUsers)
admin.POST("/users", handler.CreateUser)
admin.PUT("/users/:id", handler.UpdateUser)
admin.DELETE("/users/:id", handler.DeleteUser)
}
fs := http.FileServer(http.Dir("./dist"))