Added reset password route
This commit is contained in:
32
main.go
32
main.go
@@ -37,22 +37,35 @@ func main() {
|
||||
Admin := admin.New(&admin.AdminConfig{DB: shared.GetDb()})
|
||||
Admin.RegisterViewPath("app/views/qor")
|
||||
fmt.Printf("Admin instance: %+v\n", Admin)
|
||||
|
||||
// Allow Admin to manage User resource
|
||||
company := Admin.AddResource(&models.Company{})
|
||||
company.Meta(&admin.Meta{Name: "Users", Config: &admin.SelectManyConfig{SelectMode: "bottom_sheet"}})
|
||||
company.Meta(&admin.Meta{Name: "Devices", Config: &admin.SelectManyConfig{SelectMode: "bottom_sheet"}})
|
||||
// company.Meta(&admin.Meta{Name: "DeviceInfos", Config: &admin.SelectManyConfig{SelectMode: "bottom_sheet"}})
|
||||
|
||||
// Add User and Device resources
|
||||
Admin.AddResource(&models.User{})
|
||||
Admin.AddResource(&models.Device{})
|
||||
Admin.AddResource(&models.Company{})
|
||||
Admin.AddResource(&models.ProductTemplate{})
|
||||
// Initialize HTTP request multiplexer
|
||||
company.Meta(&admin.Meta{Name: "Users", Config: &admin.SelectManyConfig{SelectMode: "select"}})
|
||||
company.Meta(&admin.Meta{Name: "Devices", Config: &admin.SelectManyConfig{SelectMode: "bottom_sheet"}})
|
||||
// // Initialize HTTP request multiplexe
|
||||
mux := http.NewServeMux()
|
||||
// Mount admin interface to mux
|
||||
// // Mount admin interface to mux
|
||||
Admin.MountTo("/admin", mux)
|
||||
|
||||
// // Setup Admin
|
||||
// Admin := admin.New(&admin.AdminConfig{DB: shared.GetDb()})
|
||||
// Admin.AddResource(&models.Student{})
|
||||
// school := Admin.AddResource(&models.School{})
|
||||
// school.Meta(&admin.Meta{Name: "Students", Config: &admin.SelectManyConfig{SelectMode: "select"}})
|
||||
// Admin.MountTo("/admin", mux)
|
||||
|
||||
// school.SaveHandler = func(value interface{}, ctx *qor.Context) error {
|
||||
// schoolRecord := value.(*models.School)
|
||||
// log.Printf("Executed handler %v", schoolRecord)
|
||||
// log.Printf("Executed handler %v", schoolRecord.Students)
|
||||
|
||||
// return ctx.GetDB().Save(schoolRecord).Error
|
||||
// }
|
||||
|
||||
// Start the admin server in a separate goroutine
|
||||
go func() {
|
||||
port := config.AppConfig.Service.Port
|
||||
@@ -66,10 +79,13 @@ func main() {
|
||||
|
||||
// Start services and pass the respective channels
|
||||
notificationCh := make(chan models.Notification, 100)
|
||||
// Start services and pass the respective channels
|
||||
emailCh := make(chan models.EmailNotification, 100)
|
||||
// Create a new messaging service
|
||||
messagingService := messaging.NewService(notificationCh, shared.GetDb())
|
||||
messagingService := messaging.NewService(notificationCh, emailCh, shared.GetDb())
|
||||
// Run the messaging service
|
||||
go messagingService.MessagingService()
|
||||
go messagingService.SendEmailService()
|
||||
go erp.ERPService(erpChannel)
|
||||
|
||||
// Sending messages via channels
|
||||
|
||||
Reference in New Issue
Block a user