fix:增加第三方协议平台设置的查询ttp接口
This commit is contained in:
parent
2bfc84e428
commit
b0bd6515ac
@ -1,5 +1,8 @@
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/app_settings/app_settings.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockSet/thirdPartyPlatform/third_party_platform_state.dart';
|
||||
import 'package:star_lock/network/api_repository.dart';
|
||||
import 'package:star_lock/network/start_company_api.dart';
|
||||
import 'package:star_lock/tools/baseGetXController.dart';
|
||||
|
||||
class ThirdPartyPlatformLogic extends BaseGetXController {
|
||||
@ -11,6 +14,24 @@ class ThirdPartyPlatformLogic extends BaseGetXController {
|
||||
// dismissEasyLoading();
|
||||
}
|
||||
|
||||
/// 查询TPP支持
|
||||
void getActivateInfo() async {
|
||||
final model = state.lockSetInfoData.value.lockBasicInfo?.model;
|
||||
if (model != null && model != '') {
|
||||
final response = await StartCompanyApi.to.getActivateInfo(model: model);
|
||||
if (response.errorCode!.codeIsSuccessful) {
|
||||
AppLog.log('${response.data}');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
void onReady() async {
|
||||
// TODO: implement onReady
|
||||
super.onReady();
|
||||
getActivateInfo();
|
||||
}
|
||||
|
||||
@override
|
||||
void dispose() {
|
||||
dismissEasyLoading();
|
||||
|
||||
@ -305,4 +305,6 @@ abstract class Api {
|
||||
'/lockSetting/updateLockSetting'; // 设置语音包
|
||||
final String reportBuyRequestURL =
|
||||
'/service/reportBuyRequest'; // 上报增值服务购买请求
|
||||
final String getActivateInfoURL =
|
||||
'/api/authCode/getTppSupport'; // 查询ttp
|
||||
}
|
||||
|
||||
41
lib/network/start_company_api.dart
Normal file
41
lib/network/start_company_api.dart
Normal file
@ -0,0 +1,41 @@
|
||||
import 'dart:convert';
|
||||
|
||||
import 'package:get/get.dart';
|
||||
import 'package:star_lock/main/lockDetail/lockDetail/ActivateInfoResponse.dart';
|
||||
import 'package:star_lock/network/api_provider.dart';
|
||||
import 'package:star_lock/network/api_provider_base.dart';
|
||||
import 'package:star_lock/talk/starChart/entity/relay_info_entity.dart';
|
||||
import 'package:star_lock/talk/starChart/entity/report_information_data.dart';
|
||||
import 'package:star_lock/talk/starChart/entity/star_chart_register_node_entity.dart';
|
||||
import 'package:star_lock/tools/storage.dart';
|
||||
|
||||
class StartCompanyApi extends BaseProvider {
|
||||
// 星图url
|
||||
String _startChartHost = 'https://company.skychip.top';
|
||||
|
||||
static StartCompanyApi get to => Get.put(StartCompanyApi());
|
||||
|
||||
// 设置星图host
|
||||
set startChartHost(String value) {
|
||||
_startChartHost = value;
|
||||
}
|
||||
|
||||
// 获取星图host
|
||||
String get startChartHost => _startChartHost;
|
||||
|
||||
// ttp查询
|
||||
Future<ActivateInfoResponse> getActivateInfo({
|
||||
required String model,
|
||||
}) async {
|
||||
final response = await post(
|
||||
_startChartHost + getActivateInfoURL.toUrl,
|
||||
jsonEncode(<String, dynamic>{
|
||||
'model': model,
|
||||
|
||||
}),
|
||||
isUnShowLoading: true,
|
||||
isUserBaseUrl: false,
|
||||
);
|
||||
return ActivateInfoResponse.fromJson(response.body);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user