mirror of
https://github.com/emo2007/block-accounting.git
synced 2025-04-12 08:56:28 +00:00
moved to uuid v7 from uuid v1, pagination bug fixed
This commit is contained in:
parent
160be267c5
commit
3896e5cbfe
2
backend/.vscode/launch.json
vendored
2
backend/.vscode/launch.json
vendored
@ -12,7 +12,7 @@
|
|||||||
"program": "${workspaceRoot}/cmd/main.go",
|
"program": "${workspaceRoot}/cmd/main.go",
|
||||||
"args": [
|
"args": [
|
||||||
"-log-level=debug",
|
"-log-level=debug",
|
||||||
"-log-local=true",
|
"-log-local=false",
|
||||||
"-log-add-source=true",
|
"-log-add-source=true",
|
||||||
"-jwt-secret=local_jwt_secret",
|
"-jwt-secret=local_jwt_secret",
|
||||||
|
|
||||||
|
@ -44,4 +44,7 @@ run.debug: bin.build
|
|||||||
-db-database=blockd \
|
-db-database=blockd \
|
||||||
-db-user=blockd \
|
-db-user=blockd \
|
||||||
-db-secret=blockd \
|
-db-secret=blockd \
|
||||||
-db-enable-tls=false
|
-db-enable-tls=false
|
||||||
|
|
||||||
|
start.d:
|
||||||
|
sudo systemctl start docker
|
@ -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{
|
orgs, err := i.orgRepository.Get(ctx, organizations.GetParams{
|
||||||
UserId: params.UserId,
|
UserId: params.UserId,
|
||||||
Ids: params.Ids,
|
Ids: params.Ids,
|
||||||
@ -179,7 +188,7 @@ func (i *organizationsInteractor) Create(
|
|||||||
}
|
}
|
||||||
|
|
||||||
org := models.Organization{
|
org := models.Organization{
|
||||||
ID: uuid.New(),
|
ID: uuid.Must(uuid.NewV7()),
|
||||||
Name: params.Name,
|
Name: params.Name,
|
||||||
Address: params.Address,
|
Address: params.Address,
|
||||||
WalletSeed: walletSeed,
|
WalletSeed: walletSeed,
|
||||||
|
@ -73,7 +73,7 @@ func (i *usersInteractor) Create(ctx context.Context, params CreateParams) (*mod
|
|||||||
}
|
}
|
||||||
|
|
||||||
user := models.NewUser(
|
user := models.NewUser(
|
||||||
uuid.New(),
|
uuid.Must(uuid.NewV7()),
|
||||||
seed,
|
seed,
|
||||||
params.Activate,
|
params.Activate,
|
||||||
time.Now(),
|
time.Now(),
|
||||||
|
@ -109,7 +109,7 @@ func (r *repositorySQL) Get(ctx context.Context, params GetParams) ([]*models.Or
|
|||||||
}
|
}
|
||||||
|
|
||||||
if params.CursorId != uuid.Nil {
|
if params.CursorId != uuid.Nil {
|
||||||
query = query.Where(sq.Lt{
|
query = query.Where(sq.Gt{
|
||||||
"o.id": params.CursorId,
|
"o.id": params.CursorId,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user