From 0453598e3d800b6ac25247b57fb1f59dff6f2ff2 Mon Sep 17 00:00:00 2001 From: Michael Jerger Date: Tue, 16 Jan 2024 09:31:36 +0100 Subject: [PATCH] add some todos --- models/forgefed/federationinfo.go | 3 ++- models/forgefed/federationinfo_repository.go | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/models/forgefed/federationinfo.go b/models/forgefed/federationinfo.go index 90b65dab67..e85a005dfb 100644 --- a/models/forgefed/federationinfo.go +++ b/models/forgefed/federationinfo.go @@ -14,7 +14,8 @@ import ( // FederationInfo data type // swagger:model type FederationInfo struct { - ID int64 `xorm:"pk autoincr"` + ID int64 `xorm:"pk autoincr"` + // TODO: implement a toLower here & add a toLowerValidation HostFqdn string `xorm:"host_fqdn UNIQUE INDEX VARCHAR(255) NOT NULL"` NodeInfo NodeInfo `xorm:"extends NOT NULL"` LatestActivity time.Time `xorm:"NOT NULL"` diff --git a/models/forgefed/federationinfo_repository.go b/models/forgefed/federationinfo_repository.go index 50796a8d50..6db92c2981 100644 --- a/models/forgefed/federationinfo_repository.go +++ b/models/forgefed/federationinfo_repository.go @@ -31,6 +31,7 @@ func GetFederationInfo(ctx context.Context, ID int64) (*FederationInfo, error) { func FindFederationInfoByHostFqdn(ctx context.Context, fqdn string) (*FederationInfo, error) { info := new(FederationInfo) + // TODO: use parameter with toLower has, err := db.GetEngine(ctx).Where("host_fqdn=?", fqdn).Get(info) if err != nil { return nil, err