From 366928b35de36b6ac37b8058faf7ea783afef7e6 Mon Sep 17 00:00:00 2001 From: Shaolong Chen Date: Fri, 18 Oct 2024 13:18:17 +0800 Subject: feat(integration): add cubox integration Signed-off-by: Shaolong Chen --- internal/storage/integration.go | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'internal/storage/integration.go') diff --git a/internal/storage/integration.go b/internal/storage/integration.go index 90c46326..dea3369d 100644 --- a/internal/storage/integration.go +++ b/internal/storage/integration.go @@ -207,7 +207,9 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { ntfy_api_token, ntfy_username, ntfy_password, - ntfy_icon_url + ntfy_icon_url, + cubox_enabled, + cubox_api_link FROM integrations WHERE @@ -314,6 +316,8 @@ func (s *Storage) Integration(userID int64) (*model.Integration, error) { &integration.NtfyUsername, &integration.NtfyPassword, &integration.NtfyIconURL, + &integration.CuboxEnabled, + &integration.CuboxAPILink, ) switch { case err == sql.ErrNoRows: @@ -428,9 +432,11 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { ntfy_api_token=$95, ntfy_username=$96, ntfy_password=$97, - ntfy_icon_url=$98 + ntfy_icon_url=$98, + cubox_enabled=$99, + cubox_api_link=$100 WHERE - user_id=$99 + user_id=$101 ` _, err := s.db.Exec( query, @@ -532,6 +538,8 @@ func (s *Storage) UpdateIntegration(integration *model.Integration) error { integration.NtfyUsername, integration.NtfyPassword, integration.NtfyIconURL, + integration.CuboxEnabled, + integration.CuboxAPILink, integration.UserID, ) @@ -571,7 +579,8 @@ func (s *Storage) HasSaveEntry(userID int64) (result bool) { webhook_enabled='t' OR omnivore_enabled='t' OR raindrop_enabled='t' OR - betula_enabled='t' + betula_enabled='t' OR + cubox_enabled='t' ) ` if err := s.db.QueryRow(query, userID).Scan(&result); err != nil { -- cgit v1.2.3