feat: administrator (#271)

* feat: get views and failed events

* feat: get views and failed events

* feat: get views and failed events

* Update internal/view/repository/sequence.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

* Update internal/view/repository/general_query.go

Co-authored-by: Livio Amstutz <livio.a@gmail.com>

Co-authored-by: Livio Amstutz <livio.a@gmail.com>
This commit is contained in:
Fabi
2020-06-25 08:01:13 +02:00
committed by GitHub
parent b88f200434
commit 8bfa1a083c
90 changed files with 3555 additions and 1661 deletions

View File

@@ -1,17 +1,17 @@
package view
import (
"github.com/caos/zitadel/internal/view"
"github.com/caos/zitadel/internal/view/repository"
)
const (
errTable = "notification.failed_event"
)
func (v *View) saveFailedEvent(failedEvent *view.FailedEvent) error {
return view.SaveFailedEvent(v.Db, errTable, failedEvent)
func (v *View) saveFailedEvent(failedEvent *repository.FailedEvent) error {
return repository.SaveFailedEvent(v.Db, errTable, failedEvent)
}
func (v *View) latestFailedEvent(viewName string, sequence uint64) (*view.FailedEvent, error) {
return view.LatestFailedEvent(v.Db, errTable, viewName, sequence)
func (v *View) latestFailedEvent(viewName string, sequence uint64) (*repository.FailedEvent, error) {
return repository.LatestFailedEvent(v.Db, errTable, viewName, sequence)
}

View File

@@ -1,7 +1,7 @@
package view
import (
global_view "github.com/caos/zitadel/internal/view"
"github.com/caos/zitadel/internal/view/repository"
)
const (
@@ -16,10 +16,10 @@ func (v *View) ProcessedNotificationSequence(eventSequence uint64) error {
return v.saveCurrentSequence(notificationTable, eventSequence)
}
func (v *View) GetLatestNotificationFailedEvent(sequence uint64) (*global_view.FailedEvent, error) {
func (v *View) GetLatestNotificationFailedEvent(sequence uint64) (*repository.FailedEvent, error) {
return v.latestFailedEvent(notificationTable, sequence)
}
func (v *View) ProcessedNotificationFailedEvent(failedEvent *global_view.FailedEvent) error {
func (v *View) ProcessedNotificationFailedEvent(failedEvent *repository.FailedEvent) error {
return v.saveFailedEvent(failedEvent)
}

View File

@@ -3,7 +3,7 @@ package view
import (
"github.com/caos/zitadel/internal/user/repository/view"
"github.com/caos/zitadel/internal/user/repository/view/model"
global_view "github.com/caos/zitadel/internal/view"
"github.com/caos/zitadel/internal/view/repository"
)
const (
@@ -38,10 +38,10 @@ func (v *View) ProcessedNotifyUserSequence(eventSequence uint64) error {
return v.saveCurrentSequence(notifyUserTable, eventSequence)
}
func (v *View) GetLatestNotifyUserFailedEvent(sequence uint64) (*global_view.FailedEvent, error) {
func (v *View) GetLatestNotifyUserFailedEvent(sequence uint64) (*repository.FailedEvent, error) {
return v.latestFailedEvent(notifyUserTable, sequence)
}
func (v *View) ProcessedNotifyUserFailedEvent(failedEvent *global_view.FailedEvent) error {
func (v *View) ProcessedNotifyUserFailedEvent(failedEvent *repository.FailedEvent) error {
return v.saveFailedEvent(failedEvent)
}

View File

@@ -1,7 +1,7 @@
package view
import (
"github.com/caos/zitadel/internal/view"
"github.com/caos/zitadel/internal/view/repository"
)
const (
@@ -9,9 +9,9 @@ const (
)
func (v *View) saveCurrentSequence(viewName string, sequence uint64) error {
return view.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence)
return repository.SaveCurrentSequence(v.Db, sequencesTable, viewName, sequence)
}
func (v *View) latestSequence(viewName string) (uint64, error) {
return view.LatestSequence(v.Db, sequencesTable, viewName)
return repository.LatestSequence(v.Db, sequencesTable, viewName)
}