feat: add oliver elastic support; update db(sqlite)
This commit is contained in:
@ -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{
|
||||
|
Reference in New Issue
Block a user