feat: add im tenant db routing and chapter seven flows
This commit is contained in:
@@ -215,6 +215,12 @@ type TenantAdapter interface {
|
||||
TenantGetByCode(code string) (*t.Tenant, error)
|
||||
}
|
||||
|
||||
// TenantRoutedAdapter can return a tenant-specific adapter, e.g. for the
|
||||
// "one tenant, one database" deployment model.
|
||||
type TenantRoutedAdapter interface {
|
||||
TenantAdapterFor(t.TenantID) (TenantBusinessAdapter, TenantAuthAdapter, error)
|
||||
}
|
||||
|
||||
// TenantAuthAdapter is the tenant-aware authentication and credential capability.
|
||||
// It is separate from Adapter while the remaining persistence domains are migrated.
|
||||
type TenantAuthAdapter interface {
|
||||
@@ -281,6 +287,12 @@ type TenantBusinessAdapter interface {
|
||||
TenantMessageGetAll(t.TenantID, string, t.Uid, *t.QueryOpt) ([]t.Message, error)
|
||||
TenantMessageDeleteList(t.TenantID, string, *t.DelMessage) error
|
||||
TenantMessageGetDeleted(t.TenantID, string, t.Uid, *t.QueryOpt) ([]t.DelMessage, error)
|
||||
TenantMessageSearch(t.TenantID, string, t.Uid, string, string, string, int) ([]t.Message, string, error)
|
||||
|
||||
TenantFavoriteCreate(t.TenantID, *t.FavoriteItem) (*t.FavoriteItem, error)
|
||||
TenantFavoriteList(t.TenantID, t.Uid, string, string, string, int) ([]t.FavoriteItem, string, error)
|
||||
TenantFavoriteGet(t.TenantID, t.Uid, string) (*t.FavoriteItem, error)
|
||||
TenantFavoriteDelete(t.TenantID, t.Uid, string) error
|
||||
|
||||
TenantDeviceUpsert(t.TenantID, t.Uid, *t.DeviceDef) error
|
||||
TenantDeviceGetAll(t.TenantID, ...t.Uid) (map[t.Uid][]t.DeviceDef, int, error)
|
||||
@@ -291,6 +303,7 @@ type TenantBusinessAdapter interface {
|
||||
TenantFileGet(t.TenantID, string) (*t.FileDef, error)
|
||||
TenantFileDeleteUnused(t.TenantID, time.Time, int) ([]string, error)
|
||||
TenantFileLinkAttachments(t.TenantID, string, t.Uid, t.Uid, []string) error
|
||||
TenantFileUserHasAccess(t.TenantID, string, t.Uid) (bool, error)
|
||||
|
||||
TenantPCacheGet(t.TenantID, string) (string, error)
|
||||
TenantPCacheUpsert(t.TenantID, string, string, bool) error
|
||||
@@ -326,8 +339,11 @@ type TenantBusinessAdapter interface {
|
||||
TenantFriendshipUpsertPair(t.TenantID, t.Uid, t.Uid, string, time.Time) error
|
||||
TenantFriendshipList(t.TenantID, t.Uid, string, string, string, int) ([]t.FriendListItem, string, error)
|
||||
TenantFriendshipGet(t.TenantID, t.Uid, t.Uid) (*t.Friendship, error)
|
||||
TenantFriendshipUpdateRemark(t.TenantID, t.Uid, t.Uid, string, time.Time) (*t.Friendship, error)
|
||||
TenantFriendshipDeletePair(t.TenantID, t.Uid, t.Uid, time.Time) error
|
||||
TenantUserBlockGet(t.TenantID, t.Uid, t.Uid) (*t.UserBlock, error)
|
||||
TenantUserBlockList(t.TenantID, t.Uid, string, int) ([]t.BlockListItem, string, error)
|
||||
TenantUserBlockUpsert(t.TenantID, t.Uid, t.Uid, time.Time) (*t.UserBlock, error)
|
||||
TenantUserBlockDelete(t.TenantID, t.Uid, t.Uid) error
|
||||
TenantUserSearch(t.TenantID, t.Uid, string, string, string, int) ([]t.User, string, error)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user