Commit 212193dd authored by 林生雨's avatar 林生雨

com

parent 726779aa
...@@ -36,8 +36,6 @@ class ActivityReportApiImpl { ...@@ -36,8 +36,6 @@ class ActivityReportApiImpl {
return Observable.fromFuture(DioUtil().get('api/v1/survey_question/report', return Observable.fromFuture(DioUtil().get('api/v1/survey_question/report',
data: {'survey_record_id': id, 'template_id': type})).flatMap((value) { data: {'survey_record_id': id, 'template_id': type})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return ActivityReportEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseActivityReportEntity, value.toString())); compute(paseActivityReportEntity, value.toString()));
} else { } else {
......
...@@ -88,6 +88,9 @@ class ServiceGenerator extends GeneratorForAnnotation<ServiceCenter> { ...@@ -88,6 +88,9 @@ class ServiceGenerator extends GeneratorForAnnotation<ServiceCenter> {
//else{ //else{
// throw HttpException("RESPONCE error :\${value}"); // throw HttpException("RESPONCE error :\${value}");
// } // }
// Map map = json.decode(value.toString());
// return ${methodElement.returnType.name}.fromJson(map);
mapBuffer.write("))"); mapBuffer.write("))");
outBuffer.write(""" outBuffer.write("""
${methodElement.returnType.name} pase${methodElement.returnType.name}(String value){ ${methodElement.returnType.name} pase${methodElement.returnType.name}(String value){
...@@ -97,8 +100,6 @@ class ServiceGenerator extends GeneratorForAnnotation<ServiceCenter> { ...@@ -97,8 +100,6 @@ class ServiceGenerator extends GeneratorForAnnotation<ServiceCenter> {
mapBuffer.write(""" mapBuffer.write("""
.flatMap((value){ .flatMap((value){
if(value!=null&&value.statusCode==200){ if(value!=null&&value.statusCode==200){
// Map map = json.decode(value.toString());
// return ${methodElement.returnType.name}.fromJson(map);
return Observable.fromFuture(compute(pase${methodElement.returnType.name}, value.toString())); return Observable.fromFuture(compute(pase${methodElement.returnType.name}, value.toString()));
}else { }else {
return Observable.fromFuture(null); return Observable.fromFuture(null);
......
...@@ -41,8 +41,6 @@ class MessageApiImpl { ...@@ -41,8 +41,6 @@ class MessageApiImpl {
return Observable.fromFuture(DioUtil().get('api/v1/message/my', return Observable.fromFuture(DioUtil().get('api/v1/message/my',
data: {'page': page, 'count': count})).flatMap((value) { data: {'page': page, 'count': count})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return MyMessageEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseMyMessageEntity, value.toString())); compute(paseMyMessageEntity, value.toString()));
} else { } else {
...@@ -56,8 +54,6 @@ class MessageApiImpl { ...@@ -56,8 +54,6 @@ class MessageApiImpl {
DioUtil().get('api/v1/message/unread', data: {'type': type})) DioUtil().get('api/v1/message/unread', data: {'type': type}))
.flatMap((value) { .flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return UnreadMessageEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseUnreadMessageEntity, value.toString())); compute(paseUnreadMessageEntity, value.toString()));
} else { } else {
...@@ -70,8 +66,6 @@ class MessageApiImpl { ...@@ -70,8 +66,6 @@ class MessageApiImpl {
return Observable.fromFuture(DioUtil().get('api/v1/push/newest/info')) return Observable.fromFuture(DioUtil().get('api/v1/push/newest/info'))
.flatMap((value) { .flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return LatestMessageEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseLatestMessageEntity, value.toString())); compute(paseLatestMessageEntity, value.toString()));
} else { } else {
...@@ -84,8 +78,6 @@ class MessageApiImpl { ...@@ -84,8 +78,6 @@ class MessageApiImpl {
return Observable.fromFuture(DioUtil().get('api/v1/message/like', return Observable.fromFuture(DioUtil().get('api/v1/message/like',
data: {'page': page, 'count': count})).flatMap((value) { data: {'page': page, 'count': count})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return LikePageEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseLikePageEntity, value.toString())); compute(paseLikePageEntity, value.toString()));
} else { } else {
...@@ -98,8 +90,6 @@ class MessageApiImpl { ...@@ -98,8 +90,6 @@ class MessageApiImpl {
return Observable.fromFuture(DioUtil().get('api/v1/message/notice', return Observable.fromFuture(DioUtil().get('api/v1/message/notice',
data: {'page': page, 'count': count})).flatMap((value) { data: {'page': page, 'count': count})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return AttentionEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseAttentionEntity, value.toString())); compute(paseAttentionEntity, value.toString()));
} else { } else {
...@@ -112,8 +102,6 @@ class MessageApiImpl { ...@@ -112,8 +102,6 @@ class MessageApiImpl {
return Observable.fromFuture(DioUtil().get('/api/v1/follow/list', return Observable.fromFuture(DioUtil().get('/api/v1/follow/list',
data: {'type': type, 'page': page, 'count': count})).flatMap((value) { data: {'type': type, 'page': page, 'count': count})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return FocusPageEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseFocusPageEntity, value.toString())); compute(paseFocusPageEntity, value.toString()));
} else { } else {
......
...@@ -37,8 +37,6 @@ class PrestigeApiImpl { ...@@ -37,8 +37,6 @@ class PrestigeApiImpl {
DioUtil().get('api/v1/reputations', data: {'user_id': userId})) DioUtil().get('api/v1/reputations', data: {'user_id': userId}))
.flatMap((value) { .flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return PrestigeEntity.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(pasePrestigeEntity, value.toString())); compute(pasePrestigeEntity, value.toString()));
} else { } else {
......
...@@ -24,10 +24,8 @@ class MyApp extends StatefulWidget { ...@@ -24,10 +24,8 @@ class MyApp extends StatefulWidget {
} }
class _MyAppState extends State<MyApp> { class _MyAppState extends State<MyApp> {
var buildOnce = FlutterBoost.init(postPush:
var buildOnce = FlutterBoost.init( (String pageName, String uniqueId, Map params, Route route, Future _) {
postPush: (String pageName, String uniqueId, Map params, Route route,
Future _) {
print("FLUTTER PUSHED $pageName"); print("FLUTTER PUSHED $pageName");
}); });
...@@ -44,7 +42,16 @@ class _MyAppState extends State<MyApp> { ...@@ -44,7 +42,16 @@ class _MyAppState extends State<MyApp> {
.findUserRouter() .findUserRouter()
?.getCommentPage(params["fromPage"]); ?.getCommentPage(params["fromPage"]);
}, },
'message_home': (pageName, params, _) => MessageHomePage(params), 'message_home': (pageName, params, _) {
print("PARAMS!! ${params}");
if (!Api.getInstance().setDioCookie(params) ||
params["fromPage"] == null) {
return ErrorPage("出错:需要传递的参数为空");
}
return RouterCenterImpl()
.findNewMessageRouter()
?.getMessagePage(params["fromPage"]);
},
'album': (pageName, params, _) { 'album': (pageName, params, _) {
if (params == null) { if (params == null) {
return ErrorPage("出错:需要传递的参数为空"); return ErrorPage("出错:需要传递的参数为空");
......
...@@ -41,8 +41,6 @@ class UserApiImpl { ...@@ -41,8 +41,6 @@ class UserApiImpl {
return Observable.fromFuture(DioUtil().get('api/account/user_profile', return Observable.fromFuture(DioUtil().get('api/account/user_profile',
data: {'user_id': userID})).flatMap((value) { data: {'user_id': userID})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return UserResultBean.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseUserResultBean, value.toString())); compute(paseUserResultBean, value.toString()));
} else { } else {
...@@ -55,8 +53,6 @@ class UserApiImpl { ...@@ -55,8 +53,6 @@ class UserApiImpl {
return Observable.fromFuture(DioUtil().post('api/v1/suggestion', return Observable.fromFuture(DioUtil().post('api/v1/suggestion',
data: {'content': content, 'phone': phone})).flatMap((value) { data: {'content': content, 'phone': phone})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return CommentBean.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseCommentBean, value.toString())); compute(paseCommentBean, value.toString()));
} else { } else {
...@@ -69,8 +65,6 @@ class UserApiImpl { ...@@ -69,8 +65,6 @@ class UserApiImpl {
return Observable.fromFuture(DioUtil().get('api/v1/countries')) return Observable.fromFuture(DioUtil().get('api/v1/countries'))
.flatMap((value) { .flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return CountryBean.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseCountryBean, value.toString())); compute(paseCountryBean, value.toString()));
} else { } else {
...@@ -83,8 +77,6 @@ class UserApiImpl { ...@@ -83,8 +77,6 @@ class UserApiImpl {
return Observable.fromFuture(DioUtil().post('api/v1/app/upload_token', return Observable.fromFuture(DioUtil().post('api/v1/app/upload_token',
data: {'token_type': token_type})).flatMap((value) { data: {'token_type': token_type})).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return UploadTokenBean.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseUploadTokenBean, value.toString())); compute(paseUploadTokenBean, value.toString()));
} else { } else {
...@@ -104,8 +96,6 @@ class UserApiImpl { ...@@ -104,8 +96,6 @@ class UserApiImpl {
'age': age 'age': age
})).flatMap((value) { })).flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return SetUserBean.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseSetUserBean, value.toString())); compute(paseSetUserBean, value.toString()));
} else { } else {
...@@ -119,8 +109,6 @@ class UserApiImpl { ...@@ -119,8 +109,6 @@ class UserApiImpl {
DioUtil().post('api/account/logout/', data: {'user_id': user_id})) DioUtil().post('api/account/logout/', data: {'user_id': user_id}))
.flatMap((value) { .flatMap((value) {
if (value != null && value.statusCode == 200) { if (value != null && value.statusCode == 200) {
// Map map = json.decode(value.toString());
// return SimpleResponce.fromJson(map);
return Observable.fromFuture( return Observable.fromFuture(
compute(paseSimpleResponce, value.toString())); compute(paseSimpleResponce, value.toString()));
} else { } else {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment