[MM-55096] Introduce generic StoreResult (#25086)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
6dda6e3540
Коммит
b4c9eddca8
@@ -15,6 +15,7 @@ import (
|
||||
"github.com/mattermost/mattermost/server/v8/channels/product"
|
||||
)
|
||||
|
||||
// Deprecated: Use GenericStoreResult instead.
|
||||
type StoreResult struct {
|
||||
Data any
|
||||
|
||||
@@ -22,6 +23,15 @@ type StoreResult struct {
|
||||
NErr error
|
||||
}
|
||||
|
||||
// GenericStoreResult is a type safe version of StoreResult.
|
||||
// Once all the code is migrated to use GenericStoreResult, it should be renamed to StoreResult.
|
||||
type GenericStoreResult[T any] struct {
|
||||
Data T
|
||||
|
||||
// NErr a temporary field used by the new code for the AppError migration. This will later become Err when the entire store is migrated.
|
||||
NErr error
|
||||
}
|
||||
|
||||
type Store interface {
|
||||
Team() TeamStore
|
||||
Channel() ChannelStore
|
||||
|
||||
Ссылка в новой задаче
Block a user