mirror of
https://gitlab.com/mbugroup/lti-api.git
synced 2026-05-20 21:41:55 +00:00
c9633d1308
- Created database migration for production standards and related tables. - Implemented entities for ProductionStandard, ProductionStandardDetail, and StandardGrowthDetail. - Developed controller for handling production standard requests. - Added DTOs for data transfer between layers. - Implemented service layer for business logic related to production standards. - Created repository interfaces and implementations for data access. - Added validation for production standard requests. - Registered routes for production standards in the main application.
34 lines
1.3 KiB
Go
34 lines
1.3 KiB
Go
package productionstandards
|
|
|
|
import (
|
|
"github.com/go-playground/validator/v10"
|
|
"github.com/gofiber/fiber/v2"
|
|
"gorm.io/gorm"
|
|
|
|
rProductionStandard "gitlab.com/mbugroup/lti-api.git/internal/modules/master/production-standards/repositories"
|
|
sProductionStandard "gitlab.com/mbugroup/lti-api.git/internal/modules/master/production-standards/services"
|
|
|
|
rUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/repositories"
|
|
sUser "gitlab.com/mbugroup/lti-api.git/internal/modules/users/services"
|
|
)
|
|
|
|
type ProductionStandardModule struct{}
|
|
|
|
func (ProductionStandardModule) RegisterRoutes(router fiber.Router, db *gorm.DB, validate *validator.Validate) {
|
|
productionStandardRepo := rProductionStandard.NewProductionStandardRepository(db)
|
|
productionStandardDetailRepo := rProductionStandard.NewProductionStandardDetailRepository(db)
|
|
standardGrowthDetailRepo := rProductionStandard.NewStandardGrowthDetailRepository(db)
|
|
userRepo := rUser.NewUserRepository(db)
|
|
|
|
productionStandardService := sProductionStandard.NewProductionStandardService(
|
|
productionStandardRepo,
|
|
productionStandardDetailRepo,
|
|
standardGrowthDetailRepo,
|
|
validate,
|
|
)
|
|
userService := sUser.NewUserService(userRepo, validate)
|
|
|
|
ProductionStandardRoutes(router, userService, productionStandardService)
|
|
}
|
|
|