Working arrays

This commit is contained in:
Eden Kirin
2024-06-22 21:59:39 +02:00
parent 14bc29d7e3
commit b67bc14e5e
8 changed files with 171 additions and 170 deletions

View File

@ -8,7 +8,6 @@ import (
"repo-pattern/app/models"
"repo-pattern/app/repository"
"repo-pattern/app/repository/smartfilter"
"time"
"gorm.io/gorm"
)
@ -25,19 +24,19 @@ func doMagic(db *gorm.DB) {
// id := "6dc096ab-5c03-427e-b808-c669f7446131"
// serialNumber := "222"
// serialNumberContains := "323"
issuer := "FINA"
location, _ := time.LoadLocation("UTC")
createdTime := time.Date(2024, 5, 26, 16, 8, 0, 0, location)
// issuer := "FINA"
// location, _ := time.LoadLocation("UTC")
// createdTime := time.Date(2024, 5, 26, 16, 8, 0, 0, location)
ids := []string{"eb2bcac6-5173-4dbb-93b7-e7c03b924a03", "db9fb837-3483-4736-819d-f427dc8cda23", "1fece5e7-8e8d-4828-8298-3b1f07fd29ff"}
filter := smartfilter.CertFilter{
Alive: &FALSE,
// Alive: &FALSE,
// Id: &id,
// SerialNumber: &serialNumber,
// SerialNumberContains: &serialNumberContains,
Ids: &ids,
IssuerContains: &issuer,
CreatedAt_Lt: &createdTime,
Ids: &ids,
// IssuerContains: &issuer,
// CreatedAt_Lt: &createdTime,
}
query, err = smartfilter.ToQuery(models.Cert{}, filter, query)
@ -113,9 +112,9 @@ func main() {
db := db.InitDB()
repository.Dao = repository.CreateDAO(db)
// doMagic(db)
doMagic(db)
// doList(db)
// doGet(db)
doExists(db)
// doExists(db)
// inheritance.DoInheritanceTest()
}