mirror of
https://github.com/EZ-Api/ez-api.git
synced 2026-01-13 17:47:51 +00:00
feat(arch): add log partitioning and provider delete sync
This commit is contained in:
@@ -14,17 +14,18 @@ import (
|
||||
)
|
||||
|
||||
type MasterHandler struct {
|
||||
db *gorm.DB
|
||||
logDB *gorm.DB
|
||||
masterService *service.MasterService
|
||||
syncService *service.SyncService
|
||||
db *gorm.DB
|
||||
logDB *gorm.DB
|
||||
masterService *service.MasterService
|
||||
syncService *service.SyncService
|
||||
logPartitioner *service.LogPartitioner
|
||||
}
|
||||
|
||||
func NewMasterHandler(db *gorm.DB, logDB *gorm.DB, masterService *service.MasterService, syncService *service.SyncService) *MasterHandler {
|
||||
func NewMasterHandler(db *gorm.DB, logDB *gorm.DB, masterService *service.MasterService, syncService *service.SyncService, partitioner *service.LogPartitioner) *MasterHandler {
|
||||
if logDB == nil {
|
||||
logDB = db
|
||||
}
|
||||
return &MasterHandler{db: db, logDB: logDB, masterService: masterService, syncService: syncService}
|
||||
return &MasterHandler{db: db, logDB: logDB, masterService: masterService, syncService: syncService, logPartitioner: partitioner}
|
||||
}
|
||||
|
||||
func (h *MasterHandler) logDBConn() *gorm.DB {
|
||||
@@ -34,6 +35,10 @@ func (h *MasterHandler) logDBConn() *gorm.DB {
|
||||
return h.logDB
|
||||
}
|
||||
|
||||
func (h *MasterHandler) logBaseQuery() *gorm.DB {
|
||||
return logBaseQuery(h.logDBConn(), h.logPartitioner)
|
||||
}
|
||||
|
||||
type IssueChildKeyRequest struct {
|
||||
Group string `json:"group"`
|
||||
Scopes string `json:"scopes"`
|
||||
|
||||
Reference in New Issue
Block a user