From 9c94543742ad786848379effae060055b9b0e88e Mon Sep 17 00:00:00 2001 From: tisfeng Date: Thu, 15 Feb 2024 12:12:20 +0800 Subject: [PATCH] fix: update code with dev --- Easydict/App/Easydict-Bridging-Header.h | 4 ---- Easydict/Feature/Service/OpenAI/OpenAIService.swift | 4 ++-- .../OpenAIService+ConfigurableService.swift | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/Easydict/App/Easydict-Bridging-Header.h b/Easydict/App/Easydict-Bridging-Header.h index 231a2d427..d9f446179 100644 --- a/Easydict/App/Easydict-Bridging-Header.h +++ b/Easydict/App/Easydict-Bridging-Header.h @@ -25,16 +25,12 @@ #import "EZLocalStorage.h" #import "NSString+EZConvenience.h" -#import "EZEnumTypes.h" #import "EZWindowManager.h" #import "NSViewController+EZWindow.h" #import "EZLog.h" #import "EZLanguageManager.h" #import "DarkModeManager.h" #import "EZScriptExecutor.h" -#import "EZOpenAIService.h" #import "EZNiuTransTranslate.h" #import "EZDeepLTranslate.h" #import "EZBingService.h" - - diff --git a/Easydict/Feature/Service/OpenAI/OpenAIService.swift b/Easydict/Feature/Service/OpenAI/OpenAIService.swift index 5674247fd..3b323d1c8 100644 --- a/Easydict/Feature/Service/OpenAI/OpenAIService.swift +++ b/Easydict/Feature/Service/OpenAI/OpenAIService.swift @@ -31,7 +31,7 @@ public class OpenAIService: QueryService { // easydict://writeKeyValue?EZOpenAIAPIKey= var apiKey = UserDefaults.standard.string(forKey: EZOpenAIAPIKey) ?? "" - if apiKey.isEmpty, EZConfiguration.shared().isBeta { + if apiKey.isEmpty, Configuration.shared.beta { apiKey = defaultAPIKey } @@ -125,7 +125,7 @@ public class OpenAIService: QueryService { } override public func intelligentQueryTextType() -> EZQueryTextType { - let type = EZConfiguration.shared().intelligentQueryTextType(forServiceType: serviceType()) + let type = Configuration.shared.intelligentQueryTextTypeForServiceType(serviceType()) return type } diff --git a/Easydict/NewApp/Utility/Extensions/QueryService+ConfigurableService/OpenAIService+ConfigurableService.swift b/Easydict/NewApp/Utility/Extensions/QueryService+ConfigurableService/OpenAIService+ConfigurableService.swift index 091631ed8..785681bfc 100644 --- a/Easydict/NewApp/Utility/Extensions/QueryService+ConfigurableService/OpenAIService+ConfigurableService.swift +++ b/Easydict/NewApp/Utility/Extensions/QueryService+ConfigurableService/OpenAIService+ConfigurableService.swift @@ -11,7 +11,7 @@ import Foundation import SwiftUI @available(macOS 13.0, *) -extension EZOpenAIService: ConfigurableService { +extension OpenAIService: ConfigurableService { func configurationListItems() -> some View { ServiceConfigurationSecretSectionView(service: self, observeKeys: [.openAIAPIKey]) { ServiceConfigurationSecureInputCell(