feat: implement SpaceService for OAuth handling and user management, refactor UserService to utilize new service methods

This commit is contained in:
Junyan Qin
2025-12-29 22:43:19 +08:00
parent 9c82eeddeb
commit 19f417174c
7 changed files with 219 additions and 110 deletions
@@ -66,6 +66,18 @@ class DBMigrateSpaceAccountSupport(migration.DBMigration):
sqlalchemy.text('ALTER TABLE users ADD COLUMN space_refresh_token TEXT')
)
# Add space_access_token_expires_at column
if 'space_access_token_expires_at' not in columns:
if self.ap.persistence_mgr.db.name == 'postgresql':
await self.ap.persistence_mgr.execute_async(
sqlalchemy.text('ALTER TABLE users ADD COLUMN space_access_token_expires_at TIMESTAMP')
)
else:
await self.ap.persistence_mgr.execute_async(
sqlalchemy.text('ALTER TABLE users ADD COLUMN space_access_token_expires_at DATETIME')
)
# Add space_api_key column
if 'space_api_key' not in columns:
if self.ap.persistence_mgr.db.name == 'postgresql':