|
|
|
@ -9,7 +9,7 @@ part of 'retrofit_api.dart';
|
|
|
|
|
class _ApiService implements ApiService { |
|
|
|
|
_ApiService(this._dio, {this.baseUrl}) { |
|
|
|
|
ArgumentError.checkNotNull(_dio, '_dio'); |
|
|
|
|
baseUrl ??= 'http://192.168.10.236:8766/app/'; |
|
|
|
|
baseUrl ??= 'http://192.168.10.88:8766/app/'; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
final Dio _dio; |
|
|
|
@ -17,22 +17,17 @@ class _ApiService implements ApiService {
|
|
|
|
|
String baseUrl; |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Future<BaseData<UploadResult>> upload(data, folderId,bool isVideo) async { |
|
|
|
|
Future<BaseData<UploadResult>> upload(data, folderId, isVideo) async { |
|
|
|
|
ArgumentError.checkNotNull(data, 'data'); |
|
|
|
|
ArgumentError.checkNotNull(folderId, 'folderId'); |
|
|
|
|
ArgumentError.checkNotNull(isVideo, 'isVideo'); |
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = FormData(); |
|
|
|
|
String fileName = data.path.split(Platform.pathSeparator).last; |
|
|
|
|
if(!isVideo && !fileName.contains(".jpeg") && !fileName.contains(".png")) |
|
|
|
|
fileName += ".jpeg"; |
|
|
|
|
else if(isVideo && !fileName.contains(".mp4")) |
|
|
|
|
fileName += ".mp4"; |
|
|
|
|
_data.files.add(MapEntry( |
|
|
|
|
'file', |
|
|
|
|
MultipartFile.fromFileSync(data.path, |
|
|
|
|
filename: fileName))); |
|
|
|
|
print("filename:$fileName"); |
|
|
|
|
filename: data.path.split(Platform.pathSeparator).last))); |
|
|
|
|
if (folderId != null) { |
|
|
|
|
_data.fields.add(MapEntry('folderId', folderId.toString())); |
|
|
|
|
} |
|
|
|
@ -74,28 +69,6 @@ class _ApiService implements ApiService {
|
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// @override |
|
|
|
|
// Future<BaseData<dynamic>> memberLogin(param) async { |
|
|
|
|
// ArgumentError.checkNotNull(param, 'param'); |
|
|
|
|
// const _extra = <String, dynamic>{}; |
|
|
|
|
// final queryParameters = <String, dynamic>{}; |
|
|
|
|
// final _data = <String, dynamic>{}; |
|
|
|
|
// _data.addAll(param ?? <String, dynamic>{}); |
|
|
|
|
// final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
// '/auth/platform/memberLogin', |
|
|
|
|
// queryParameters: queryParameters, |
|
|
|
|
// options: RequestOptions( |
|
|
|
|
// method: 'POST', |
|
|
|
|
// headers: <String, dynamic>{}, |
|
|
|
|
// extra: _extra, |
|
|
|
|
// baseUrl: baseUrl), |
|
|
|
|
// data: _data); |
|
|
|
|
// final value = BaseData<dynamic>.fromJson( |
|
|
|
|
// _result.data, |
|
|
|
|
// (json) => json as dynamic, |
|
|
|
|
// ); |
|
|
|
|
// return value; |
|
|
|
|
// } |
|
|
|
|
@override |
|
|
|
|
Future<BaseData<LoginInfo>> memberLogin(param) async { |
|
|
|
|
ArgumentError.checkNotNull(param, 'param'); |
|
|
|
@ -374,15 +347,13 @@ class _ApiService implements ApiService {
|
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
final _headers = <String, dynamic>{}; |
|
|
|
|
_headers.addAll({"Environment":"app"}); |
|
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'/creditOrder/create', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'POST', |
|
|
|
|
headers: _headers, |
|
|
|
|
headers: <String, dynamic>{}, |
|
|
|
|
extra: _extra, |
|
|
|
|
baseUrl: baseUrl), |
|
|
|
|
data: _data); |
|
|
|
@ -1037,8 +1008,7 @@ class _ApiService implements ApiService {
|
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'/app-msg/stats', |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/app-msg/stats', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'GET', |
|
|
|
@ -1415,7 +1385,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<CategorySelectList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<CategorySelectList>((i) => CategorySelectList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<CategorySelectList>( |
|
|
|
|
(i) => CategorySelectList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1450,8 +1421,7 @@ class _ApiService implements ApiService {
|
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
_data.addAll(map ?? <String, dynamic>{}); |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'/course/list', |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/course/list', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'POST', |
|
|
|
@ -1486,7 +1456,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<CollectClassList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<CollectClassList>((i) => CollectClassList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<CollectClassList>( |
|
|
|
|
(i) => CollectClassList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1509,7 +1480,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<CourseList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<CourseList>((i) => CourseList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<CourseList>( |
|
|
|
|
(i) => CourseList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1520,8 +1492,7 @@ class _ApiService implements ApiService {
|
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'/course/$id', |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/course/$id', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'GET', |
|
|
|
@ -1559,13 +1530,14 @@ class _ApiService implements ApiService {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Future<BaseData<List<VipBadgesList>>> findBadges(param) async { |
|
|
|
|
ArgumentError.checkNotNull(param, 'param'); |
|
|
|
|
Future<BaseData<List<VipBadgesList>>> findBadges(map) async { |
|
|
|
|
ArgumentError.checkNotNull(map, 'map'); |
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
_data.addAll(param ?? <String, dynamic>{}); |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/app-memberAchievement/findBadges', |
|
|
|
|
_data.addAll(map ?? <String, dynamic>{}); |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'/app-memberAchievement/findBadges', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'POST', |
|
|
|
@ -1576,13 +1548,15 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<VipBadgesList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<VipBadgesList>((i) => VipBadgesList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<VipBadgesList>( |
|
|
|
|
(i) => VipBadgesList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@override |
|
|
|
|
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail(achievementCategoryId) async { |
|
|
|
|
Future<BaseData<List<AchievementDetailList>>> getAchievementDetail( |
|
|
|
|
achievementCategoryId) async { |
|
|
|
|
ArgumentError.checkNotNull(achievementCategoryId, 'achievementCategoryId'); |
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
@ -1599,7 +1573,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<AchievementDetailList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<AchievementDetailList>((i) => AchievementDetailList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<AchievementDetailList>((i) => |
|
|
|
|
AchievementDetailList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1621,7 +1596,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<VipBenefitList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<VipBenefitList>((i) => VipBenefitList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<VipBenefitList>( |
|
|
|
|
(i) => VipBenefitList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1631,8 +1607,7 @@ class _ApiService implements ApiService {
|
|
|
|
|
const _extra = <String, dynamic>{}; |
|
|
|
|
final queryParameters = <String, dynamic>{}; |
|
|
|
|
final _data = <String, dynamic>{}; |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>( |
|
|
|
|
'/home/vipBenefit', |
|
|
|
|
final _result = await _dio.request<Map<String, dynamic>>('/home/vipBenefit', |
|
|
|
|
queryParameters: queryParameters, |
|
|
|
|
options: RequestOptions( |
|
|
|
|
method: 'GET', |
|
|
|
@ -1664,7 +1639,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<SecondCardList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<SecondCardList>((i) => SecondCardList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<SecondCardList>( |
|
|
|
|
(i) => SecondCardList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1774,7 +1750,8 @@ class _ApiService implements ApiService {
|
|
|
|
|
final value = BaseData<List<HeadlinesList>>.fromJson( |
|
|
|
|
_result.data, |
|
|
|
|
(json) => (json as List<dynamic>) |
|
|
|
|
.map<HeadlinesList>((i) => HeadlinesList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.map<HeadlinesList>( |
|
|
|
|
(i) => HeadlinesList.fromJson(i as Map<String, dynamic>)) |
|
|
|
|
.toList()); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
@ -1800,5 +1777,4 @@ class _ApiService implements ApiService {
|
|
|
|
|
); |
|
|
|
|
return value; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|