Commit 0407ff8385788f2aa34c39beb01fad4cf875642a

Authored by 权海
1 parent 21621828

feat(ta):增加app_region属性

... ... @@ -48,19 +48,20 @@ void registerCoreDeps({
void registerUserSessionDeps() {
final dioClient = Get.find<DioClient>();
final userPrefs = Get.find<UserPreferencesStorage>();
final environmentConfig = Get.find<AppEnvironmentConfig>();
Get.put(UserApi(dioClient), permanent: true);
Get.put(VipApi(dioClient), permanent: true);
Get.put(FriendApi(dioClient), permanent: true);
Get.put<ImService>(ImServiceStub(), permanent: true);
Get.put(
ThinkingDataService(Get.find<AppEnvironmentConfig>()),
ThinkingDataService(environmentConfig),
permanent: true,
);
Get.put(PushService(Get.find<UserApi>()), permanent: true);
Get.put(
HealthRawDataCoreService(
environmentConfig: Get.find<AppEnvironmentConfig>(),
environmentConfig: environmentConfig,
userIdProvider: () => userPrefs.preferences.value.meUserInfo?.id ?? 0,
serverHealthApi: HealthApi(dioClient),
),
... ... @@ -68,6 +69,7 @@ void registerUserSessionDeps() {
);
Get.put(
UserStateService(
environmentConfig,
userPrefs,
Get.find<UserApi>(),
Get.find<ImService>(),
... ...
import 'package:doublefeel_flutter/core/config/app_environment_config.dart';
import 'package:doublefeel_flutter/core/services/raw_data_service/health_raw_data_core_service.dart';
import 'package:doublefeel_flutter/pigeon/platform_api.g.dart';
... ... @@ -11,6 +12,7 @@ import 'thinking_data_service.dart';
/// Login lifecycle and SDK initialization.
class UserStateService {
UserStateService(
this._environmentConfig,
this._userPrefs,
this._userApi,
this._imService,
... ... @@ -19,6 +21,7 @@ class UserStateService {
this._healthRawDataCoreService,
);
final AppEnvironmentConfig _environmentConfig;
final UserPreferencesStorage _userPrefs;
final UserApi _userApi;
final ImService _imService;
... ... @@ -88,6 +91,13 @@ class UserStateService {
props['account_create_time'] = me!.createTime;
}
props['vip_status'] = isVip ? '会员' : '非会员';
// 设置账号地区归属
props['app_region'] = _environmentConfig.region.value == AppRegion.china
? 'mainland'
: 'overseas';
if (props.isNotEmpty) {
_thinkingDataService.setSuperProperties(props);
}
... ...