// Author: fengshengxiong
// Date: 2024/6/18
// Description: TikUsTokApi

import 'package:tone_snap/data/models/base_model.dart';
import 'package:tone_snap/data/network/dio_client.dart';
import 'package:tone_snap/data/sideb/models/isocode_model.dart';

class TikUsTokApi {
  static const String baseUrl = 'https://api.tikustok.com/';

  /// 获取所在区域、ip
  static Future<BaseModel<IosCodeModel>?> getIp() async {
    BaseModel<IosCodeModel>? baseModel;
    await DioClient(baseUrl: baseUrl).request<BaseModel<IosCodeModel>>(
      'app/common/getIPInfo',
      requestMethod: RequestMethod.get,
      formJson: (json) => BaseModel<IosCodeModel>.fromMap(json, IosCodeModel.fromMap),
      success: (model) => baseModel = model,
    );
    return baseModel;
  }
}
