From 7d88c2cabacf13ccfdfeb4909ee7c6971ed060ae Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Wed, 16 Apr 2025 14:58:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0=E9=9F=B3=E4=B9=90=E6=92=AD?= =?UTF-8?q?=E6=94=BE=E5=92=8Cfacntion=20call=20=E7=9A=84=E7=BB=93=E6=9E=9C?= =?UTF-8?q?=E8=A1=A5=E5=85=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- android/app/build.gradle.kts | 11 +- android/app/src/main/AndroidManifest.xml | 4 + .../deepsound/VoiceInteractionHandler.kt | 4 +- android/settings.gradle.kts | 7 +- lib/data/services/deapsound_ai_service.dart | 2 +- lib/data/services/network/nw_api.dart | 2 +- .../services/open_ai_service_adapter.dart | 147 +-- .../chat/controllers/chat_controller.dart | 44 +- .../controllers/profile_controller.dart | 35 +- .../open_ai_service/MCPClient.kt | 27 +- .../open_ai_service/OpenAIService.kt | 15 +- .../open_ai_service/OpenAIServicePlugin.kt | 27 +- .../mcp/CustomSseClientTransport.kt | 2 +- .../open_ai_service/lib/open_ai_service.dart | 130 +- .../.github/ISSUE_TEMPLATE/bug_report.md | 62 + .../.github/ISSUE_TEMPLATE/config.yml | 1 + .../.github/ISSUE_TEMPLATE/feature_request.md | 20 + .../publish_flutter_package/action.yaml | 41 + .../spotify_sdk/.github/dependabot.yml | 42 + .../.github/scripts/verify_pub_score.sh | 16 + .../.github/workflows/pull_request.yml | 38 + .../spotify_sdk/.github/workflows/release.yml | 34 + local_plugins/spotify_sdk/.gitignore | 50 + local_plugins/spotify_sdk/.metadata | 10 + local_plugins/spotify_sdk/CHANGELOG.md | 184 +++ local_plugins/spotify_sdk/CODE_OF_CONDUCT.md | 76 ++ local_plugins/spotify_sdk/CONTRIBUTING.md | 48 + local_plugins/spotify_sdk/LICENSE | 201 +++ local_plugins/spotify_sdk/README.md | 257 ++++ .../spotify_sdk/analysis_options.yaml | 12 + local_plugins/spotify_sdk/android/.gitignore | 8 + .../spotify_sdk/android/build.gradle | 74 ++ .../spotify_sdk/android/gradle.properties | 3 + .../gradle/wrapper/gradle-wrapper.properties | 7 + .../libs/spotify-app-remote-release-0.8.0.aar | Bin 0 -> 132749 bytes .../spotify_sdk/android/settings.gradle | 1 + .../android/src/main/AndroidManifest.xml | 10 + .../minimalme/spotify_sdk/BaseSpotifyApi.kt | 13 + .../spotify_sdk/SpotifyConnectApi.kt | 25 + .../minimalme/spotify_sdk/SpotifyImagesApi.kt | 35 + .../minimalme/spotify_sdk/SpotifyPlayerApi.kt | 210 +++ .../minimalme/spotify_sdk/SpotifySdkPlugin.kt | 381 ++++++ .../minimalme/spotify_sdk/SpotifyUserApi.kt | 59 + .../subscriptions/CapabilitiesChannel.kt | 23 + .../subscriptions/ConnectionStatusChannel.kt | 27 + .../subscriptions/PlayerContextChannel.kt | 22 + .../subscriptions/PlayerStateChannel.kt | 22 + .../subscriptions/UserStatusChannel.kt | 23 + .../spotify_sdk/bin/android_cleanup.dart | 39 + .../bin/android_module_creator.dart | 96 ++ .../spotify_sdk/bin/android_setup.dart | 91 ++ local_plugins/spotify_sdk/bin/github_api.dart | 100 ++ .../spotify_sdk/bin/precondition_checker.dart | 52 + local_plugins/spotify_sdk/ios/.gitignore | 37 + local_plugins/spotify_sdk/ios/Assets/.gitkeep | 0 .../ios/Classes/ConnectionStatusHandler.swift | 45 + .../ios/Classes/Extension/Dictionary.swift | 13 + .../ios/Classes/PlayerDelegate.swift | 14 + .../PlayerState/PlayerContextHandler.swift | 18 + .../ios/Classes/PlayerState/PlayerState.swift | 85 ++ .../PlayerState/PlayerStateHandler.swift | 22 + .../ios/Classes/SpotifyError.swift | 4 + .../ios/Classes/SpotifySdkConstants.swift | 46 + .../ios/Classes/SpotifySdkPlugin.h | 4 + .../ios/Classes/SpotifySdkPlugin.m | 18 + .../ios/Classes/StatusHandler.swift | 17 + .../ios/Classes/SwiftSpotifySdkPlugin.swift | 416 ++++++ .../spotify_sdk/ios/prepare-iOS-SDK.sh | 10 + .../spotify_sdk/ios/spotify_sdk.podspec | 26 + .../lib/enums/image_dimension_enum.dart | 17 + .../lib/enums/podcast_playback_speed.dart | 23 + .../lib/enums/repeat_mode_enum.dart | 11 + .../extensions/image_dimension_extension.dart | 19 + .../podcast_playback_speed_extension.dart | 21 + .../lib/logging/custom_log_filter.dart | 8 + .../spotify_sdk/lib/models/album.dart | 15 + .../spotify_sdk/lib/models/album.g.dart | 17 + .../spotify_sdk/lib/models/artist.dart | 15 + .../spotify_sdk/lib/models/artist.g.dart | 17 + .../spotify_sdk/lib/models/capabilities.dart | 18 + .../lib/models/capabilities.g.dart | 16 + .../lib/models/connection_status.dart | 31 + .../lib/models/connection_status.g.dart | 23 + .../lib/models/crossfade_state.dart | 19 + .../lib/models/crossfade_state.g.dart | 19 + .../spotify_sdk/lib/models/image_uri.dart | 15 + .../spotify_sdk/lib/models/image_uri.g.dart | 15 + .../spotify_sdk/lib/models/library_state.dart | 24 + .../lib/models/library_state.g.dart | 20 + .../lib/models/player_context.dart | 18 + .../lib/models/player_context.g.dart | 23 + .../lib/models/player_options.dart | 30 + .../lib/models/player_options.g.dart | 25 + .../lib/models/player_restrictions.dart | 33 + .../lib/models/player_restrictions.g.dart | 27 + .../spotify_sdk/lib/models/player_state.dart | 36 + .../lib/models/player_state.g.dart | 29 + .../spotify_sdk/lib/models/track.dart | 43 + .../spotify_sdk/lib/models/track.g.dart | 35 + .../spotify_sdk/lib/models/user_status.dart | 26 + .../spotify_sdk/lib/models/user_status.g.dart | 20 + .../spotify_sdk/lib/platform_channels.dart | 161 +++ .../spotify_sdk/lib/spotify_sdk.dart | 660 ++++++++++ .../spotify_sdk/lib/spotify_sdk_web.dart | 1137 +++++++++++++++++ local_plugins/spotify_sdk/pubspec.yaml | 82 ++ .../spotify_sdk/test/spotify_sdk_test.dart | 28 + pubspec.yaml | 3 +- 107 files changed, 6214 insertions(+), 210 deletions(-) create mode 100644 local_plugins/spotify_sdk/.github/ISSUE_TEMPLATE/bug_report.md create mode 100644 local_plugins/spotify_sdk/.github/ISSUE_TEMPLATE/config.yml create mode 100644 local_plugins/spotify_sdk/.github/ISSUE_TEMPLATE/feature_request.md create mode 100644 local_plugins/spotify_sdk/.github/actions/publish_flutter_package/action.yaml create mode 100644 local_plugins/spotify_sdk/.github/dependabot.yml create mode 100755 local_plugins/spotify_sdk/.github/scripts/verify_pub_score.sh create mode 100644 local_plugins/spotify_sdk/.github/workflows/pull_request.yml create mode 100644 local_plugins/spotify_sdk/.github/workflows/release.yml create mode 100644 local_plugins/spotify_sdk/.gitignore create mode 100644 local_plugins/spotify_sdk/.metadata create mode 100644 local_plugins/spotify_sdk/CHANGELOG.md create mode 100644 local_plugins/spotify_sdk/CODE_OF_CONDUCT.md create mode 100644 local_plugins/spotify_sdk/CONTRIBUTING.md create mode 100644 local_plugins/spotify_sdk/LICENSE create mode 100644 local_plugins/spotify_sdk/README.md create mode 100644 local_plugins/spotify_sdk/analysis_options.yaml create mode 100644 local_plugins/spotify_sdk/android/.gitignore create mode 100644 local_plugins/spotify_sdk/android/build.gradle create mode 100644 local_plugins/spotify_sdk/android/gradle.properties create mode 100644 local_plugins/spotify_sdk/android/gradle/wrapper/gradle-wrapper.properties create mode 100644 local_plugins/spotify_sdk/android/libs/spotify-app-remote-release-0.8.0.aar create mode 100644 local_plugins/spotify_sdk/android/settings.gradle create mode 100644 local_plugins/spotify_sdk/android/src/main/AndroidManifest.xml create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/BaseSpotifyApi.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/SpotifyConnectApi.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/SpotifyImagesApi.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/SpotifyPlayerApi.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/SpotifySdkPlugin.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/SpotifyUserApi.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/subscriptions/CapabilitiesChannel.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/subscriptions/ConnectionStatusChannel.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/subscriptions/PlayerContextChannel.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/subscriptions/PlayerStateChannel.kt create mode 100644 local_plugins/spotify_sdk/android/src/main/kotlin/de/minimalme/spotify_sdk/subscriptions/UserStatusChannel.kt create mode 100644 local_plugins/spotify_sdk/bin/android_cleanup.dart create mode 100644 local_plugins/spotify_sdk/bin/android_module_creator.dart create mode 100644 local_plugins/spotify_sdk/bin/android_setup.dart create mode 100644 local_plugins/spotify_sdk/bin/github_api.dart create mode 100644 local_plugins/spotify_sdk/bin/precondition_checker.dart create mode 100644 local_plugins/spotify_sdk/ios/.gitignore create mode 100644 local_plugins/spotify_sdk/ios/Assets/.gitkeep create mode 100644 local_plugins/spotify_sdk/ios/Classes/ConnectionStatusHandler.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/Extension/Dictionary.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/PlayerDelegate.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/PlayerState/PlayerContextHandler.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/PlayerState/PlayerState.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/PlayerState/PlayerStateHandler.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/SpotifyError.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/SpotifySdkConstants.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/SpotifySdkPlugin.h create mode 100644 local_plugins/spotify_sdk/ios/Classes/SpotifySdkPlugin.m create mode 100644 local_plugins/spotify_sdk/ios/Classes/StatusHandler.swift create mode 100644 local_plugins/spotify_sdk/ios/Classes/SwiftSpotifySdkPlugin.swift create mode 100755 local_plugins/spotify_sdk/ios/prepare-iOS-SDK.sh create mode 100644 local_plugins/spotify_sdk/ios/spotify_sdk.podspec create mode 100644 local_plugins/spotify_sdk/lib/enums/image_dimension_enum.dart create mode 100644 local_plugins/spotify_sdk/lib/enums/podcast_playback_speed.dart create mode 100644 local_plugins/spotify_sdk/lib/enums/repeat_mode_enum.dart create mode 100644 local_plugins/spotify_sdk/lib/extensions/image_dimension_extension.dart create mode 100644 local_plugins/spotify_sdk/lib/extensions/podcast_playback_speed_extension.dart create mode 100644 local_plugins/spotify_sdk/lib/logging/custom_log_filter.dart create mode 100644 local_plugins/spotify_sdk/lib/models/album.dart create mode 100644 local_plugins/spotify_sdk/lib/models/album.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/artist.dart create mode 100644 local_plugins/spotify_sdk/lib/models/artist.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/capabilities.dart create mode 100644 local_plugins/spotify_sdk/lib/models/capabilities.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/connection_status.dart create mode 100644 local_plugins/spotify_sdk/lib/models/connection_status.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/crossfade_state.dart create mode 100644 local_plugins/spotify_sdk/lib/models/crossfade_state.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/image_uri.dart create mode 100644 local_plugins/spotify_sdk/lib/models/image_uri.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/library_state.dart create mode 100644 local_plugins/spotify_sdk/lib/models/library_state.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_context.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_context.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_options.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_options.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_restrictions.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_restrictions.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_state.dart create mode 100644 local_plugins/spotify_sdk/lib/models/player_state.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/track.dart create mode 100644 local_plugins/spotify_sdk/lib/models/track.g.dart create mode 100644 local_plugins/spotify_sdk/lib/models/user_status.dart create mode 100644 local_plugins/spotify_sdk/lib/models/user_status.g.dart create mode 100644 local_plugins/spotify_sdk/lib/platform_channels.dart create mode 100644 local_plugins/spotify_sdk/lib/spotify_sdk.dart create mode 100644 local_plugins/spotify_sdk/lib/spotify_sdk_web.dart create mode 100644 local_plugins/spotify_sdk/pubspec.yaml create mode 100644 local_plugins/spotify_sdk/test/spotify_sdk_test.dart diff --git a/android/app/build.gradle.kts b/android/app/build.gradle.kts index e388c263b..883dea602 100644 --- a/android/app/build.gradle.kts +++ b/android/app/build.gradle.kts @@ -3,6 +3,9 @@ import java.io.FileInputStream repositories { google() mavenCentral() + flatDir { + dirs(project(":spotify_sdk").projectDir.resolve("libs")) + } } plugins { @@ -54,6 +57,12 @@ android { } defaultConfig { + manifestPlaceholders.putAll( + mapOf( + "redirectSchemeName" to "spotify-sdk", + "redirectHostName" to "auth" + ) + ) // TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html). applicationId = "com.yunqiinnovation.deepsound" // You can update the following values to match your application needs. @@ -110,6 +119,7 @@ dependencies { implementation(project(":volcano_speech")) implementation(project(":chat_storage")) // 添加新创建的SQLite聊天存储插件 implementation(project(":jieli")) // 添加新创建的SQLite聊天存储插件 + implementation(project(":spotify_sdk")) // 添加OkHttp依赖 implementation("com.squareup.okhttp3:okhttp:4.9.3") @@ -126,7 +136,6 @@ dependencies { // 添加 AndroidX Security 加密 SharedPreferences 依赖 implementation("androidx.security:security-crypto:1.1.0-alpha06") - } flutter { diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 23c380fb0..fe1f5f245 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -92,6 +92,10 @@ + + + +