feat(arch): add log partitioning and provider delete sync

This commit is contained in:
zenfun
2025-12-21 20:45:16 +08:00
parent f819f89ba2
commit 816ea93339
23 changed files with 582 additions and 69 deletions

View File

@@ -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"`