feat: add oliver elastic support; update db(sqlite)

This commit is contained in:
zhaoyupeng
2024-09-20 15:14:49 +08:00
parent f9d59b99a0
commit c117d363a0
14 changed files with 399 additions and 85 deletions

View File

@ -55,7 +55,7 @@ func (u uc) GetUser(ctx context.Context, id uint64) (*model.User, error) {
}
ByDB:
if err = db.New(tool.Timeout(3)).
if err = db.Default.Session(tool.Timeout(3)).
Model(&model.User{}).
Where("id = ?", id).
Take(target).
@ -146,7 +146,7 @@ func (u uc) DeleteUser(ctx context.Context, id uint64) error {
username = "username || '@del'"
}
if err = db.New(tool.Timeout(5)).
if err = db.Default.Session(tool.Timeout(5)).
Model(&model.User{}).
Where("id = ?", id).
Updates(map[string]any{