diff options
author | 2024-10-18 13:18:17 +0800 | |
---|---|---|
committer | 2024-10-18 18:06:09 -0700 | |
commit | 366928b35de36b6ac37b8058faf7ea783afef7e6 (patch) | |
tree | e1fb1ab77852bb28af4b8bf8038172d157e48b45 /internal/storage/integration.go | |
parent | 3b654fefa73908063842fd143b76f1089d0d11ed (diff) | |
download | v2-366928b35de36b6ac37b8058faf7ea783afef7e6.tar.gz v2-366928b35de36b6ac37b8058faf7ea783afef7e6.tar.zst v2-366928b35de36b6ac37b8058faf7ea783afef7e6.zip |
feat(integration): add cubox integration
Signed-off-by: Shaolong Chen <shaolong.chen@outlook.it>
Diffstat (limited to 'internal/storage/integration.go')
-rw-r--r-- | internal/storage/integration.go | 17 |
1 files changed, 13 insertions, 4 deletions
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 { |