refactor: clean code

This commit is contained in:
Fu Diwei
2025-01-05 00:08:12 +08:00
parent 3b9a7fe805
commit 61843a4997
69 changed files with 972 additions and 839 deletions

View File

@@ -14,11 +14,13 @@ func NewCertificateRepository() *CertificateRepository {
}
func (c *CertificateRepository) ListExpireSoon(ctx context.Context) ([]domain.Certificate, error) {
rs := []domain.Certificate{}
if err := app.GetApp().Dao().DB().
certificates := []domain.Certificate{}
err := app.GetApp().Dao().DB().
NewQuery("SELECT * FROM certificate WHERE expireAt > DATETIME('now') AND expireAt < DATETIME('now', '+20 days')").
All(&rs); err != nil {
All(&certificates)
if err != nil {
return nil, err
}
return rs, nil
return certificates, nil
}