Revert "Add the module name after the path to the repo and simply name it ersteller"
This reverts commit a1b93c0eba.
This commit is contained in:
@@ -8,7 +8,7 @@ import (
|
||||
"encoding/json"
|
||||
"errors"
|
||||
"fmt"
|
||||
"git.gorlug.de/code/golang/ersteller-lib/ersteller"
|
||||
"git.gorlug.de/code/golang/ersteller-lib"
|
||||
"github.com/doug-martin/goqu/v9"
|
||||
_ "github.com/doug-martin/goqu/v9/dialect/postgres"
|
||||
"github.com/doug-martin/goqu/v9/exp"
|
||||
@@ -42,13 +42,13 @@ func (r *GoogleAuthRepository) Create(googleAuth GoogleAuth) (int, error) {
|
||||
Returning("id").
|
||||
ToSQL()
|
||||
if err != nil {
|
||||
ersteller.LogError("error creating create GoogleAuth sql: %v", err)
|
||||
ersteller_lib.LogError("error creating create GoogleAuth sql: %v", err)
|
||||
return -1, err
|
||||
}
|
||||
|
||||
rows, err := r.connPool.Query(context.Background(), sql, args...)
|
||||
if err != nil {
|
||||
ersteller.LogError("error creating GoogleAuth: %v", err)
|
||||
ersteller_lib.LogError("error creating GoogleAuth: %v", err)
|
||||
return -1, err
|
||||
}
|
||||
defer rows.Close()
|
||||
@@ -56,11 +56,11 @@ func (r *GoogleAuthRepository) Create(googleAuth GoogleAuth) (int, error) {
|
||||
if rows.Next() {
|
||||
err = rows.Scan(&id)
|
||||
if err != nil {
|
||||
ersteller.LogError("error scanning User: %v", err)
|
||||
ersteller_lib.LogError("error scanning User: %v", err)
|
||||
return -1, err
|
||||
}
|
||||
} else {
|
||||
ersteller.Error("GoogleAuth already exists")
|
||||
ersteller_lib.Error("GoogleAuth already exists")
|
||||
return -1, GoogleAuthAlreadyExistsError{GoogleAuth: googleAuth}
|
||||
}
|
||||
|
||||
@@ -83,7 +83,7 @@ func (r *GoogleAuthRepository) getSelectColumns() []any {
|
||||
}
|
||||
|
||||
func (r *GoogleAuthRepository) Read(userId int, id int) (GoogleAuth, error) {
|
||||
ersteller.Debug("Getting GoogleAuth by id ", id)
|
||||
ersteller_lib.Debug("Getting GoogleAuth by id ", id)
|
||||
sql, args, _ := r.dialect.From("googleAuth").
|
||||
Prepared(true).
|
||||
Select(r.getSelectColumns()...).
|
||||
@@ -95,7 +95,7 @@ func (r *GoogleAuthRepository) Read(userId int, id int) (GoogleAuth, error) {
|
||||
|
||||
rows, err := r.connPool.Query(context.Background(), sql, args...)
|
||||
if err != nil {
|
||||
ersteller.Error("Failed to get GoogleAuth: ", err)
|
||||
ersteller_lib.Error("Failed to get GoogleAuth: ", err)
|
||||
}
|
||||
defer rows.Close()
|
||||
if rows.Next() {
|
||||
@@ -162,13 +162,13 @@ func (r *GoogleAuthRepository) Update(userId int, googleAuth GoogleAuth) error {
|
||||
}).
|
||||
ToSQL()
|
||||
if err != nil {
|
||||
ersteller.LogError("error creating update GoogleAuth sql: %v", err)
|
||||
ersteller_lib.LogError("error creating update GoogleAuth sql: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = r.connPool.Exec(context.Background(), sql, args...)
|
||||
if err != nil {
|
||||
ersteller.LogError("error updating GoogleAuth: %v", err)
|
||||
ersteller_lib.LogError("error updating GoogleAuth: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -184,13 +184,13 @@ func (r *GoogleAuthRepository) Delete(userId int, id int) error {
|
||||
}).
|
||||
ToSQL()
|
||||
if err != nil {
|
||||
ersteller.LogError("error creating delete GoogleAuth sql: %v", err)
|
||||
ersteller_lib.LogError("error creating delete GoogleAuth sql: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
_, err = r.connPool.Exec(context.Background(), sql, args...)
|
||||
if err != nil {
|
||||
ersteller.LogError("error deleting GoogleAuth: %v", err)
|
||||
ersteller_lib.LogError("error deleting GoogleAuth: %v", err)
|
||||
return err
|
||||
}
|
||||
|
||||
@@ -266,7 +266,7 @@ func (r *GoogleAuthRepository) GetPage(params GoogleAuthPaginationParams) ([]Goo
|
||||
|
||||
rows, err := r.connPool.Query(context.Background(), sql, args...)
|
||||
if err != nil {
|
||||
ersteller.LogError("failed to run sql query: %v", err)
|
||||
ersteller_lib.LogError("failed to run sql query: %v", err)
|
||||
return nil, -1, err
|
||||
}
|
||||
defer rows.Close()
|
||||
|
||||
Reference in New Issue
Block a user