Browse Source

Merge branch 'new_dev' of github.com:deepcloud2048/deep_voice into new_dev

weicu
lxm 9 months ago
parent
commit
e11c2a8740
  1. 7
      android/app/build.gradle.kts
  2. 1
      android/app/src/main/AndroidManifest.xml
  3. 16
      lib/data/services/network/api.dart
  4. 4
      lib/modules/meeting/controllers/meeting_details_controller.dart
  5. 1
      lib/modules/meeting/controllers/meeting_home_controller.dart
  6. 8
      lib/modules/meeting/views/bottomSheet/speaker_all_bottom_sheet.dart
  7. 12
      lib/modules/meeting/views/bottomSheet/speaker_bottom_sheet.dart
  8. 11
      lib/modules/meeting/views/tabs/summary_tab.dart
  9. 3
      local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt
  10. 3
      local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift
  11. 2
      local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt
  12. 2
      local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/AzureAsrHelper.swift
  13. 4
      local_plugins/chat_api/android/src/main/kotlin/com/yunqiinnovation/chat_api/SystemFunctionHandler.kt
  14. 23
      local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationService.kt
  15. 14
      local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationServicePlugin.kt
  16. 17
      local_plugins/location_service/lib/location_service.dart

7
android/app/build.gradle.kts

@ -55,6 +55,9 @@ android {
excludes.add("META-INF/notice.txt")
excludes.add("META-INF/*.kotlin_module")
}
jniLibs {
useLegacyPackaging = true
}
}
defaultConfig {
@ -83,6 +86,8 @@ android {
storePassword = keystoreProperties.getProperty("storePassword")
enableV1Signing = true
enableV2Signing = true
enableV3Signing = false
enableV4Signing = false
}
getByName("debug") {
// debug 使用与 release 相同的签名配置
@ -92,6 +97,8 @@ android {
storePassword = keystoreProperties.getProperty("storePassword")
enableV1Signing = true
enableV2Signing = true
enableV3Signing = false
enableV4Signing = false
}
}

1
android/app/src/main/AndroidManifest.xml

@ -72,6 +72,7 @@
android:networkSecurityConfig="@xml/network_security_config"
android:usesCleartextTraffic="true"
android:extractNativeLibs="true"
android:enableOnBackInvokedCallback="true"
tools:replace="android:label">

16
lib/data/services/network/api.dart

@ -348,4 +348,20 @@ class Api {
params: params,
);
}
static modifyRecordEchomeet([params]) {
Map data = {
'title': 'NULL',
'address': 'NULL',
'personnel': 'NULL',
'translate': 'NULL',
'summary': 'NULL',
};
data.addAll(params);
return DioManager().request(
NWMethod.post,
'/api/home/echomeet_modifyrecords',
params: data,
);
}
}

4
lib/modules/meeting/controllers/meeting_details_controller.dart

@ -238,6 +238,10 @@ class MeetingDetailsController extends GetxController
textList[index] = dataMap;
}
}
await Api.modifyRecordEchomeet({
'id': id,
'translate': jsonEncode(textList),
});
isSpeakerText.value = false;
editSpeakerTextId.value = 0;
editSpeakerTextList = [];

1
lib/modules/meeting/controllers/meeting_home_controller.dart

@ -585,6 +585,7 @@ class MeetingHomeController extends GetxController {
void editMeetingTitle(int id) async {
if (titleController.text.isNotEmpty) {
String title = titleController.text + titleCSuffix;
Api.modifyRecordEchomeet({'id': id, 'title': title});
SqfliteApi.editMeetingTitle(id, {'title': title});
int originalIndex =
originalDataList.indexWhere((item) => item['id'] == id);

8
lib/modules/meeting/views/bottomSheet/speaker_all_bottom_sheet.dart

@ -9,6 +9,7 @@ import 'package:get_storage/get_storage.dart';
import 'package:lottie/lottie.dart';
import '../../../../data/services/db/sqflite_api.dart';
import '../../../../data/services/network/api.dart';
import '../../controllers/meeting_details_controller.dart';
class SpeakerAllBottomSheet extends StatefulWidget {
@ -559,6 +560,11 @@ class _SpeakerAllBottomSheetState extends State<SpeakerAllBottomSheet> {
bool isEditSummary = false;
String summaryText = _controller.meetingDetails.value.summary;
_controller.textList.value = newTextList;
Map modifyData = {
'id': _controller.meetingData.value.id,
'translate': jsonEncode(_controller.textList),
'personnel': personnel,
};
for (var element in personnelList) {
if (summaryText.contains('[${element['original']}]')) {
summaryText = summaryText.replaceAll(
@ -571,11 +577,13 @@ class _SpeakerAllBottomSheetState extends State<SpeakerAllBottomSheet> {
'summary': summaryText,
'personnel': personnel,
});
modifyData.addAll({'summary': summaryText});
_controller.meetingDetails.value.summary = summaryText;
_controller.summaryNumberModifications.value++;
} else {
SqfliteApi.editMeeting(_controller.id, {'personnel': personnel});
}
await Api.modifyRecordEchomeet(modifyData);
_controller.meetingDetails.value.personnel = personnel;
_controller.personnelNumberModifications.value++;
_controller.meetingDetails.refresh();

12
lib/modules/meeting/views/bottomSheet/speaker_bottom_sheet.dart

@ -7,6 +7,7 @@ import 'package:get/get.dart';
import 'package:get_storage/get_storage.dart';
import '../../../../data/services/db/sqflite_api.dart';
import '../../../../data/services/network/api.dart';
import '../../controllers/meeting_details_controller.dart';
class SpeakerBottomSheet extends StatefulWidget {
@ -336,6 +337,10 @@ class _SpeakerBottomSheetState extends State<SpeakerBottomSheet> {
dataMap['speaker'] = _speakerController.text;
_controller.textList[index] = dataMap;
}
await Api.modifyRecordEchomeet({
'id': _controller.meetingData.value.id,
'translate': jsonEncode(_controller.textList),
});
_addHistorySpeaker();
Get.back();
}
@ -366,6 +371,11 @@ class _SpeakerBottomSheetState extends State<SpeakerBottomSheet> {
var result = await SqfliteApi.editMeetingSpeaker(editSpeakerList);
if (result != null) {
_controller.textList.value = newTextList;
Map modifyData = {
'id': _controller.meetingData.value.id,
'translate': jsonEncode(_controller.textList),
'personnel': personnel,
};
if (_controller.meetingDetails.value.summary
.contains('[${widget.speakerName}]')) {
String summaryText = _controller.meetingDetails.value.summary
@ -375,11 +385,13 @@ class _SpeakerBottomSheetState extends State<SpeakerBottomSheet> {
'summary': summaryText,
'personnel': personnel,
});
modifyData.addAll({'summary': summaryText});
_controller.meetingDetails.value.summary = summaryText;
_controller.summaryNumberModifications.value++;
} else {
SqfliteApi.editMeeting(_controller.id, {'personnel': personnel});
}
await Api.modifyRecordEchomeet(modifyData);
_controller.meetingDetails.value.personnel = personnel;
_addHistorySpeaker();
Get.back();

11
lib/modules/meeting/views/tabs/summary_tab.dart

@ -6,6 +6,7 @@ import 'package:get/get.dart';
import 'package:parchment/codecs.dart';
import '../../../../data/services/db/sqflite_api.dart';
import '../../../../data/services/network/api.dart';
import '../../controllers/meeting_details_controller.dart';
import '../bottomSheet/ai_bottom_sheet.dart';
import '../bottomSheet/generate_bottom_sheet.dart';
@ -133,6 +134,10 @@ class _SummaryTabState extends State<SummaryTab> {
final markdown =
const ParchmentMarkdownCodec().encode(_fleatherController!.document);
if (markdown != _controller.meetingDetails.value.summary) {
Api.modifyRecordEchomeet({
'id': _controller.id,
'summary': markdown,
});
SqfliteApi.editMeeting(
_controller.id,
{'summary': markdown},
@ -272,6 +277,12 @@ class _SummaryTabState extends State<SummaryTab> {
isEdit = true;
}
if (isEdit) {
Api.modifyRecordEchomeet({
'id': _controller.id,
'address': _controller.meetingDetails.value.address,
'personnel':
_controller.meetingDetails.value.personnel,
});
SqfliteApi.editMeeting(
_controller.id,
{

3
local_plugins/agent_service/android/src/main/kotlin/com/yunqiinnovation/agent_service/AgentService.kt

@ -746,7 +746,8 @@ object AgentService : CoroutineScope {
// 执行打断
lastInterruptTime = currentTime
interruptCurrentResponse()
stopTts()
// interruptCurrentResponse()
}
}
}

3
local_plugins/agent_service/ios/agent_service/Sources/agent_service/AgentServiceImpl.swift

@ -2332,7 +2332,8 @@ extension AgentServiceImpl: AzureAsrHelper.ContinuousRecognizeCallback {
sendEvent(name: "recognizing", data: data)
if isSpeaking || isAiStreaming {
interruptCurrentResponse()
stopTts()
// interruptCurrentResponse()
}
}
}

2
local_plugins/azure_speech/android/src/main/kotlin/com/yunqiinnovation/azure_speech/AzureAsrHelper.kt

@ -130,7 +130,7 @@ class AzureAsrHelper(private val context: Context) {
val xunfeiConfigReady = this.xunfeiAppId.isNotBlank() &&
this.xunfeiAccessKeyId.isNotBlank() &&
this.xunfeiAccessKeySecret.isNotBlank()
this.useXunfei = supportedLanguages.all { it == "zh-CN" || it == "en-US" } && xunfeiConfigReady
this.useXunfei = supportedLanguages.all { it == "zh-CN" || it == "en-US" || it == "zh-HK"|| it == "en-TW" } && xunfeiConfigReady
// 根据支持的语言数量决定是否启用自动语言检测
this.isAutoDetectLanguage = supportedLanguages.size >= 2

2
local_plugins/azure_speech/ios/azure_speech/Sources/azure_speech/AzureAsrHelper.swift

@ -132,7 +132,7 @@ public class AzureAsrHelper: NSObject {
let xunfeiConfigReady = !self.xunfeiAppId.isEmpty &&
!self.xunfeiAccessKeyId.isEmpty &&
!self.xunfeiAccessKeySecret.isEmpty
self.useXunfei = supportedLanguages.allSatisfy { $0 == "zh-CN" || $0 == "en-US" } && xunfeiConfigReady
self.useXunfei = supportedLanguages.allSatisfy { $0 == "zh-CN" || $0 == "en-US" || $0 == "zh-HK" || $0 == "en-TW" } && xunfeiConfigReady
// 根据支持的语言数量决定是否启用自动语言检测
self.isAutoDetectLanguage = supportedLanguages.count >= 2

4
local_plugins/chat_api/android/src/main/kotlin/com/yunqiinnovation/chat_api/SystemFunctionHandler.kt

@ -152,8 +152,8 @@ class SystemFunctionHandler(private val context: Context? = null) {
// 注册获取当前位置函数
client.registerLocalFunction(
name = "get_current_location",
description = "获取当前地理位置",
name = "get_user_current_location",
description = "获取用户当前地理位置",
parameters = mapOf(
"type" to "object",
"properties" to emptyMap<String, Any>(),

23
local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationService.kt

@ -5,6 +5,7 @@ import android.app.Activity
import android.app.ActivityManager
import android.content.Context
import android.content.pm.PackageManager
import android.location.LocationManager
import android.os.Build
import android.os.Handler
import android.os.Looper
@ -150,6 +151,10 @@ object LocationService {
callback.onLocationError(-2, "后台定位权限需要打开始终定位权限才可,请打开app重新设置权限后再使用")
return
}
if (!isLocationServiceEnabled(ctx)) {
callback.onLocationError(-6, "定位服务未开启,请在系统设置中打开位置服务开关")
return
}
if (!initialized) {
callback.onLocationError(-3, "定位服务未初始化")
return
@ -287,6 +292,24 @@ object LocationService {
return 0
}
/**
* 检查系统位置服务开关状态
* @param context 应用上下文
* @return true:位置服务已开启;false:位置服务关闭或检测失败
* @throws 无显式抛出异常(内部捕获并记录日志)
*/
fun isLocationServiceEnabled(context: Context): Boolean {
try {
val lm = context.getSystemService(Context.LOCATION_SERVICE) as? LocationManager
val gpsOn = lm?.isProviderEnabled(LocationManager.GPS_PROVIDER) == true
val networkOn = lm?.isProviderEnabled(LocationManager.NETWORK_PROVIDER) == true
return gpsOn || networkOn
} catch (e: Exception) {
Log.e(TAG, "检测位置服务开关失败: ${e.message}", e)
return false
}
}
private fun hasForegroundLocationPermission(context: Context): Boolean {
return ContextCompat.checkSelfPermission(
context,

14
local_plugins/location_service/android/src/main/kotlin/com/yunqiinnovation/location_service/LocationServicePlugin.kt

@ -25,7 +25,19 @@ class LocationServicePlugin: FlutterPlugin, MethodCallHandler {
override fun onMethodCall(call: MethodCall, result: MethodChannel.Result) {
Log.d(TAG, "Method call: ${call.method}")
when (call.method) {
"isLocationServiceEnabled" -> {
try {
val enabled = LocationService.isLocationServiceEnabled(context)
result.success(enabled)
} catch (e: Exception) {
result.error("CHECK_SERVICE_FAILED", e.message, null)
}
}
else -> {
result.notImplemented()
}
}
}
override fun onDetachedFromEngine(binding: FlutterPlugin.FlutterPluginBinding) {

17
local_plugins/location_service/lib/location_service.dart

@ -12,7 +12,7 @@ class LocationService {
);
// 内部构造函数
LocationService._internal() {}
LocationService._internal();
/// 检查定位权限
Future<Map<String, bool>> checkPermission() async {
@ -40,6 +40,21 @@ class LocationService {
}
}
/// 检查系统位置服务是否开启
/// 参数:无
/// 返回值:true 表示已开启;false 表示未开启或检测失败
/// 异常:抛出 Exception,表示方法通道调用失败或平台异常
Future<bool> isLocationServiceEnabled() async {
try {
final enabled = await _methodChannel.invokeMethod<bool>(
'isLocationServiceEnabled',
);
return enabled ?? false;
} catch (e) {
throw Exception('检查位置服务失败: $e');
}
}
/// 获取当前位置(按需获取)
Future<Map<String, dynamic>> location() async {
try {

Loading…
Cancel
Save