use uuid for everything

This commit is contained in:
2026-04-12 14:19:46 +02:00
parent 18ebfd0416
commit 3be9619cca
9 changed files with 72 additions and 68 deletions
+7 -3
View File
@@ -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}