Files
backend_fiesta/routes/userroutes.go
2026-09-11 11:10:25 +05:30

31 lines
1.2 KiB
Go

package routes
import (
"nearle/facade"
"github.com/gofiber/fiber/v2"
)
func RegisterUserRoutes(api fiber.Router, f *facade.Facade) {
users := api.Group("/v1/web/users")
users.Get("/getallusers", f.UserController.GetAllUsers)
users.Get("/getusers", f.UserController.GetUserInfo)
users.Post("/applogin", f.UserController.AppLogin)
users.Post("/create", f.UserController.CreateUser)
users.Post("/tenant/weblogin", f.UserController.TenantWebLogin)
users.Put("/update", f.UserController.UpdateStaff)
users.Delete("/delete", f.UserController.DeleteUser)
users = api.Group("/v1/mob/users")
// `TenantLogin`, not `Login`. The route is named for the tenant and the app
// needs the shop with it — its name, address, category, branch and the
// superadmin flag — none of which `UserInfo` carries. `TenantUserInfo` now
// also carries the shiftid, shiftname and status that `Login` returned, so
// this response is a superset of the old one and no client loses a field.
users.Post("/tenant/login", f.UserController.TenantLogin)
users.Get("/getusers", f.UserController.GetUserInfo)
users.Post("/create", f.UserController.CreateUser)
users.Put("/update", f.UserController.UpdateStaff)
}