refactor: split memo service

This commit is contained in:
johnnyjoy
2024-12-26 20:13:05 +08:00
parent a78bfffb17
commit 3220adbff9
4 changed files with 420 additions and 393 deletions

View File

@ -10,6 +10,11 @@ import (
"github.com/usememos/memos/store"
)
const (
// DefaultPageSize is the default page size for requests.
DefaultPageSize = 10
)
func convertRowStatusFromStore(rowStatus store.RowStatus) v1pb.RowStatus {
switch rowStatus {
case store.Normal:
@ -57,3 +62,7 @@ func unmarshalPageToken(s string, pageToken *v1pb.PageToken) error {
}
return nil
}
func isSuperUser(user *store.User) bool {
return user.Role == store.RoleAdmin || user.Role == store.RoleHost
}