moved to uuid v7 from uuid v1, pagination bug fixed

This commit is contained in:
r8zavetr8v 2024-05-12 23:25:51 +03:00
parent 160be267c5
commit 3896e5cbfe
5 changed files with 17 additions and 5 deletions

View File

@ -12,7 +12,7 @@
"program": "${workspaceRoot}/cmd/main.go",
"args": [
"-log-level=debug",
"-log-local=true",
"-log-local=false",
"-log-add-source=true",
"-jwt-secret=local_jwt_secret",

View File

@ -44,4 +44,7 @@ run.debug: bin.build
-db-database=blockd \
-db-user=blockd \
-db-secret=blockd \
-db-enable-tls=false
-db-enable-tls=false
start.d:
sudo systemctl start docker

View File

@ -129,6 +129,15 @@ func (i *organizationsInteractor) List(
}
}
i.log.Debug(
"organizations_list",
slog.String("cursor", params.Cursor),
slog.Int("limit", int(params.Limit)),
slog.Any("cursor-id", cursor.Id),
slog.Any("ids", params.Ids),
slog.Any("user_id", params.UserId),
)
orgs, err := i.orgRepository.Get(ctx, organizations.GetParams{
UserId: params.UserId,
Ids: params.Ids,
@ -179,7 +188,7 @@ func (i *organizationsInteractor) Create(
}
org := models.Organization{
ID: uuid.New(),
ID: uuid.Must(uuid.NewV7()),
Name: params.Name,
Address: params.Address,
WalletSeed: walletSeed,

View File

@ -73,7 +73,7 @@ func (i *usersInteractor) Create(ctx context.Context, params CreateParams) (*mod
}
user := models.NewUser(
uuid.New(),
uuid.Must(uuid.NewV7()),
seed,
params.Activate,
time.Now(),

View File

@ -109,7 +109,7 @@ func (r *repositorySQL) Get(ctx context.Context, params GetParams) ([]*models.Or
}
if params.CursorId != uuid.Nil {
query = query.Where(sq.Lt{
query = query.Where(sq.Gt{
"o.id": params.CursorId,
})
}