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

com

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