62 lines
1.8 KiB
Dart
62 lines
1.8 KiB
Dart
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<TppSupportResponse> getTppSupport({
|
|
required String model,
|
|
}) async {
|
|
final response = await post(
|
|
_startChartHost + getTppSupportURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'model': model,
|
|
}),
|
|
isUnShowLoading: true,
|
|
isUserBaseUrl: false,
|
|
);
|
|
return TppSupportResponse.fromJson(response.body);
|
|
}
|
|
|
|
// 获取授权码
|
|
Future<ActivateInfoResponse> getAuthorizationCode({
|
|
required String registerKey,
|
|
required String model,
|
|
required String serialNum0,
|
|
required int platform,
|
|
}) async {
|
|
final response = await post(
|
|
_startChartHost + getActivateInfoURL.toUrl,
|
|
jsonEncode(<String, dynamic>{
|
|
'register_key': registerKey,
|
|
'platform': platform,
|
|
'model': model,
|
|
'serial_num0': serialNum0,
|
|
}),
|
|
isUnShowLoading: true,
|
|
isUserBaseUrl: false,
|
|
);
|
|
return ActivateInfoResponse.fromJson(response.body);
|
|
}
|
|
}
|