mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(log): wire log db, metrics, and body toggle
This commit is contained in:
@@ -15,12 +15,23 @@ import (
|
||||
|
||||
type MasterHandler struct {
|
||||
db *gorm.DB
|
||||
logDB *gorm.DB
|
||||
masterService *service.MasterService
|
||||
syncService *service.SyncService
|
||||
}
|
||||
|
||||
func NewMasterHandler(db *gorm.DB, masterService *service.MasterService, syncService *service.SyncService) *MasterHandler {
|
||||
return &MasterHandler{db: db, masterService: masterService, syncService: syncService}
|
||||
func NewMasterHandler(db *gorm.DB, logDB *gorm.DB, masterService *service.MasterService, syncService *service.SyncService) *MasterHandler {
|
||||
if logDB == nil {
|
||||
logDB = db
|
||||
}
|
||||
return &MasterHandler{db: db, logDB: logDB, masterService: masterService, syncService: syncService}
|
||||
}
|
||||
|
||||
func (h *MasterHandler) logDBConn() *gorm.DB {
|
||||
if h == nil || h.logDB == nil {
|
||||
return h.db
|
||||
}
|
||||
return h.logDB
|
||||
}
|
||||
|
||||
type IssueChildKeyRequest struct {
|
||||
|
||||
Reference in New Issue
Block a user