add user role
This commit is contained in:
@@ -8,6 +8,7 @@ type HealthHandler interface {
|
||||
|
||||
type UserHandler interface {
|
||||
ListUsers(c *gin.Context)
|
||||
CreateUser(c *gin.Context)
|
||||
GetProfile(c *gin.Context)
|
||||
GetUserProfile(c *gin.Context)
|
||||
UpdateProfile(c *gin.Context)
|
||||
|
||||
@@ -92,11 +92,12 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
|
||||
users := v1.Group("/users")
|
||||
users.Use(r.authMiddleware.RequireAuth())
|
||||
{
|
||||
users.POST("", r.userHandler.CreateUser)
|
||||
users.GET("", r.userHandler.ListUsers)
|
||||
users.GET("/profile", r.userHandler.GetProfile)
|
||||
users.GET("/:id/profile", r.userHandler.GetUserProfile)
|
||||
users.PUT("/profile", r.userHandler.UpdateProfile)
|
||||
users.PUT(":id/password", r.userHandler.ChangePassword)
|
||||
users.PUT("/:id/password", r.userHandler.ChangePassword)
|
||||
users.GET("/titles", r.userHandler.ListTitles)
|
||||
users.GET("/mention", r.userHandler.GetActiveUsersForMention)
|
||||
users.POST("/profile/avatar", r.fileHandler.UploadProfileAvatar)
|
||||
@@ -212,10 +213,10 @@ func (r *Router) addAppRoutes(rg *gin.Engine) {
|
||||
droutes := v1.Group("/disposition-routes")
|
||||
droutes.Use(r.authMiddleware.RequireAuth())
|
||||
{
|
||||
droutes.POST("", r.dispRouteHandler.Create) // Create with upsert logic
|
||||
droutes.PUT("/bulk", r.dispRouteHandler.BulkCreateOrUpdate) // Explicit bulk create/update
|
||||
droutes.GET("", r.dispRouteHandler.ListAll) // List all routes with details
|
||||
droutes.GET("/grouped", r.dispRouteHandler.ListGrouped) // List grouped by from_department_id
|
||||
droutes.POST("", r.dispRouteHandler.Create) // Create with upsert logic
|
||||
droutes.PUT("/bulk", r.dispRouteHandler.BulkCreateOrUpdate) // Explicit bulk create/update
|
||||
droutes.GET("", r.dispRouteHandler.ListAll) // List all routes with details
|
||||
droutes.GET("/grouped", r.dispRouteHandler.ListGrouped) // List grouped by from_department_id
|
||||
droutes.GET("/department", r.dispRouteHandler.ListByFromDept)
|
||||
droutes.GET("/:id", r.dispRouteHandler.Get)
|
||||
droutes.PUT("/:id", r.dispRouteHandler.Update)
|
||||
|
||||
Reference in New Issue
Block a user