use uuid for everything
This commit is contained in:
@@ -1,8 +1,12 @@
|
||||
package main
|
||||
|
||||
import "context"
|
||||
import (
|
||||
"context"
|
||||
|
||||
func GetUserById(ctx context.Context, userId uint32) (*User, error) {
|
||||
"github.com/google/uuid"
|
||||
)
|
||||
|
||||
func GetUserById(ctx context.Context, userId uuid.UUID) (*User, error) {
|
||||
user, err := CacheGetUserById(userId)
|
||||
if err != nil {
|
||||
user = &User{Id: userId}
|
||||
@@ -23,7 +27,7 @@ func GetUserByToken(ctx context.Context, token string) (*User, error) {
|
||||
return GetUserById(ctx, userId)
|
||||
}
|
||||
|
||||
func GetGroup(ctx context.Context, groupId uint32) (*Group, error) {
|
||||
func GetGroup(ctx context.Context, groupId uuid.UUID) (*Group, error) {
|
||||
group, err := CacheGetGroup(groupId)
|
||||
if err != nil {
|
||||
group = &Group{Id: groupId}
|
||||
|
||||
Reference in New Issue
Block a user