Re-migrate code

This commit is contained in:
2026-03-02 10:05:12 +08:00
parent d1e6f15745
commit 51025195a5
7 changed files with 177 additions and 0 deletions

View File

@@ -25,6 +25,7 @@ func SetupAPIRoutes(r *gin.RouterGroup) {
authRoutes := r.Group("/auth")
{
authRoutes.POST("/login", authController.Login)
authRoutes.POST("/logout", middleware.JWTAuthMiddleware(), authController.Logout)
authRoutes.GET("/profile", middleware.JWTAuthMiddleware(), authController.GetProfile)
authRoutes.PUT("/profile", middleware.JWTAuthMiddleware(), authController.UpdateProfile)
authRoutes.POST("/change-password", middleware.JWTAuthMiddleware(), authController.ChangePassword)
@@ -47,6 +48,7 @@ func SetupAPIRoutes(r *gin.RouterGroup) {
companiesController := controllers.NewCompaniesController()
companiesRoutes := r.Group("/companies")
{
companiesRoutes.GET("/stats/overview", middleware.JWTAuthMiddleware(), companiesController.StatsOverview)
companiesRoutes.GET("/", middleware.JWTAuthMiddleware(), companiesController.FindAll)
companiesRoutes.POST("/", middleware.JWTAuthMiddleware(), middleware.AdminMiddleware(), companiesController.Create)
companiesRoutes.PUT("/:companyName", middleware.JWTAuthMiddleware(), middleware.AdminMiddleware(), companiesController.Update)