Add entity filters back in for api

This commit is contained in:
Jamie Curnow
2023-05-29 13:53:16 +10:00
parent 1ae247b2a6
commit 4b39ef0eba
20 changed files with 247 additions and 205 deletions

View File

@@ -6,8 +6,8 @@ import (
// ModelBase include common fields for db control
type ModelBase struct {
ID uint `json:"id" gorm:"column:id;primaryKey"`
CreatedAt int64 `json:"created_at" gorm:"<-:create;autoCreateTime:milli;column:created_at"`
UpdatedAt int64 `json:"updated_at" gorm:"<-;autoUpdateTime:milli;column:updated_at"`
ID uint `json:"id" gorm:"column:id;primaryKey" filter:"id,integer"`
CreatedAt int64 `json:"created_at" gorm:"<-:create;autoCreateTime:milli;column:created_at" filter:"created_at,date"`
UpdatedAt int64 `json:"updated_at" gorm:"<-;autoUpdateTime:milli;column:updated_at" filter:"updated_at,date"`
DeletedAt soft_delete.DeletedAt `json:"-" gorm:"column:is_deleted;softDelete:flag"`
}