Fix swagger doc and rename references for time db fields

This commit is contained in:
Jamie Curnow
2023-05-29 08:50:27 +10:00
parent a2f192280b
commit 1ae247b2a6
45 changed files with 236 additions and 316 deletions

View File

@ -21,67 +21,3 @@ func GetByUserIDType(userID uint, authType string) (Model, error) {
First(&auth)
return auth, result.Error
}
/*
// Create will create a Auth from this model
func Create(auth *Model) (int, error) {
if auth.ID != 0 {
return 0, eris.New("Cannot create auth when model already has an ID")
}
auth.Touch(true)
db := database.GetInstance()
// nolint: gosec
result, err := db.NamedExec(`INSERT INTO `+fmt.Sprintf("`%s`", tableName)+` (
created_on,
modified_on,
user_id,
type,
secret,
is_deleted
) VALUES (
:created_on,
:modified_on,
:user_id,
:type,
:secret,
:is_deleted
)`, auth)
if err != nil {
return 0, err
}
last, lastErr := result.LastInsertId()
if lastErr != nil {
return 0, lastErr
}
return int(last), nil
}
*/
/*
// Update will Update a Auth from this model
func Update(auth *Model) error {
if auth.ID == 0 {
return eris.New("Cannot update auth when model doesn't have an ID")
}
auth.Touch(false)
db := database.GetInstance()
// nolint: gosec
_, err := db.NamedExec(`UPDATE `+fmt.Sprintf("`%s`", tableName)+` SET
created_on = :created_on,
modified_on = :modified_on,
user_id = :user_id,
type = :type,
secret = :secret,
is_deleted = :is_deleted
WHERE id = :id`, auth)
return err
}
*/

View File

@ -17,7 +17,7 @@ func List(pageInfo model.PageInfo, filters []model.Filter) (entity.ListResponse,
var result entity.ListResponse
defaultSort := model.Sort{
Field: "created_on",
Field: "created_at",
Direction: "ASC",
}