Commit de780466 authored by 杜欣's avatar 杜欣

add new message

parent 8725a994
sdk.dir=/Users/apple/Library/Android/sdk sdk.dir=/Users/gengmei/Library/Android/sdk
flutter.sdk=/Users/apple/Downloads/flutter flutter.sdk=/Users/gengmei/flutter
flutter.buildMode=debug flutter.buildMode=debug
flutter.versionName=1.0.0 flutter.versionName=1.0.0
flutter.versionCode=1 flutter.versionCode=1
\ No newline at end of file
/Users/apple/Downloads/flutter/bin/cache/artifacts/engine /Users/gengmei/flutter/bin/cache/artifacts/engine
\ No newline at end of file \ No newline at end of file
/Users/apple/Downloads/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_boost-0.0.420 /Users/gengmei/flutter/.pub-cache/hosted/pub.flutter-io.cn/flutter_boost-0.0.420
\ No newline at end of file \ No newline at end of file
/Users/apple/Downloads/flutter/.pub-cache/git/flutter_plugin-4e7c15a7f1e1b7c17655e87ab3ad3434bbe5cdae /Users/gengmei/flutter/.pub-cache/git/flutter_plugin-4e7c15a7f1e1b7c17655e87ab3ad3434bbe5cdae
\ No newline at end of file \ No newline at end of file
/Users/apple/Downloads/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.3.0 /Users/gengmei/flutter/.pub-cache/hosted/pub.flutter-io.cn/path_provider-1.3.0
\ No newline at end of file \ No newline at end of file
/Users/apple/Downloads/flutter/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.1.6+5 /Users/gengmei/flutter/.pub-cache/hosted/pub.flutter-io.cn/sqflite-1.1.6+5
\ No newline at end of file \ No newline at end of file
/Users/apple/Downloads/flutter/.pub-cache/hosted/pub.flutter-io.cn/xservice_kit-0.0.29 /Users/gengmei/flutter/.pub-cache/hosted/pub.flutter-io.cn/xservice_kit-0.0.29
\ No newline at end of file \ No newline at end of file
...@@ -2,6 +2,7 @@ analyzer ...@@ -2,6 +2,7 @@ analyzer
args args
csslib csslib
logging logging
protobuf
Copyright 2013, the Dart project authors. All rights reserved. Copyright 2013, the Dart project authors. All rights reserved.
Redistribution and use in source and binary forms, with or without Redistribution and use in source and binary forms, with or without
...@@ -35,6 +36,7 @@ async ...@@ -35,6 +36,7 @@ async
collection collection
convert convert
crypto crypto
http2
mime mime
package_config package_config
package_resolver package_resolver
...@@ -3266,6 +3268,7 @@ charcode ...@@ -3266,6 +3268,7 @@ charcode
dart_style dart_style
fixnum fixnum
glob glob
googleapis_auth
http http
http_multi_server http_multi_server
http_parser http_parser
...@@ -6284,6 +6287,186 @@ freely, subject to the following restrictions: ...@@ -6284,6 +6287,186 @@ freely, subject to the following restrictions:
3. This notice may not be removed or altered from any source 3. This notice may not be removed or altered from any source
distribution. distribution.
-------------------------------------------------------------------------------- --------------------------------------------------------------------------------
grpc
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
--------------------------------------------------------------------------------
harfbuzz harfbuzz
Copyright (C) 2012 Grigori Goronzy <greg@kinoho.net> Copyright (C) 2012 Grigori Goronzy <greg@kinoho.net>
......
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
File mode changed from 100644 to 100755
// This is a generated file; do not edit or check into version control. // This is a generated file; do not edit or check into version control.
FLUTTER_ROOT=/Users/apple/Downloads/flutter FLUTTER_ROOT=/Users/gengmei/flutter
FLUTTER_APPLICATION_PATH=/Users/apple/lsy/gmalpha_flutter FLUTTER_APPLICATION_PATH=/Users/gengmei/Documents/workspace/gmalpha_flutter
FLUTTER_TARGET=/Users/apple/lsy/gmalpha_flutter/lib/main.dart FLUTTER_TARGET=/Users/gengmei/Documents/workspace/gmalpha_flutter/lib/main.dart
FLUTTER_BUILD_DIR=build FLUTTER_BUILD_DIR=build
SYMROOT=${SOURCE_ROOT}/../build/ios SYMROOT=${SOURCE_ROOT}/../build/ios
FLUTTER_FRAMEWORK_DIR=/Users/apple/Downloads/flutter/bin/cache/artifacts/engine/ios FLUTTER_FRAMEWORK_DIR=/Users/gengmei/flutter/bin/cache/artifacts/engine/ios
FLUTTER_BUILD_NAME=1.0.0 FLUTTER_BUILD_NAME=1.0.0
FLUTTER_BUILD_NUMBER=1 FLUTTER_BUILD_NUMBER=1
TRACK_WIDGET_CREATION=true
...@@ -44,13 +44,13 @@ EXTERNAL SOURCES: ...@@ -44,13 +44,13 @@ EXTERNAL SOURCES:
SPEC CHECKSUMS: SPEC CHECKSUMS:
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
flutter_boost: dd4635cb5672549d64a0a9e47accd1e9ee1c4de8 flutter_boost: 0e85ea37c74ed39ee7b91a35612afa1605557484
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
gengmei_flutter_plugin: 9461e8644c06c4a0e38292ddcca1cc55e6ac6156 gengmei_flutter_plugin: 9461e8644c06c4a0e38292ddcca1cc55e6ac6156
path_provider: d6b45f2abd6d46082316e15beadf67eeb95adb2a path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
sqflite: 5ba50d7e98116c306c2d9c67067d2c963bdb4c9e sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a
xservice_kit: 076aa63eef6fad67a8fd1542f7b1cabb5a8b23fc xservice_kit: a2f1b35addc126fce8687aeb183ab0c1ada5b7f3
PODFILE CHECKSUM: 35a37ac9f50a31e3627f8c9992b49120478cca1a PODFILE CHECKSUM: 35a37ac9f50a31e3627f8c9992b49120478cca1a
COCOAPODS: 1.7.4 COCOAPODS: 1.7.5
...@@ -32,6 +32,6 @@ ...@@ -32,6 +32,6 @@
}, },
"libraries": "c++", "libraries": "c++",
"platforms": { "platforms": {
"ios": "9.0" "ios": "8.0"
} }
} }
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
] ]
}, },
"platforms": { "platforms": {
"ios": "9.0" "ios": "8.0"
} }
} }
...@@ -24,6 +24,6 @@ ...@@ -24,6 +24,6 @@
] ]
}, },
"platforms": { "platforms": {
"ios": "9.0" "ios": "8.0"
} }
} }
...@@ -21,6 +21,6 @@ ...@@ -21,6 +21,6 @@
] ]
}, },
"platforms": { "platforms": {
"ios": "9.0" "ios": "8.0"
} }
} }
PODS:
- Flutter (1.0.0)
- flutter_boost (0.0.1):
- Flutter
- xservice_kit
- FMDB (2.7.5):
- FMDB/standard (= 2.7.5)
- FMDB/standard (2.7.5)
- gengmei_flutter_plugin (0.0.1):
- Flutter
- path_provider (0.0.1):
- Flutter
- sqflite (0.0.1):
- Flutter
- FMDB (~> 2.7.2)
- xservice_kit (0.0.1):
- Flutter
DEPENDENCIES:
- Flutter (from `.symlinks/flutter/ios`)
- flutter_boost (from `.symlinks/plugins/flutter_boost/ios`)
- gengmei_flutter_plugin (from `.symlinks/plugins/gengmei_flutter_plugin/ios`)
- path_provider (from `.symlinks/plugins/path_provider/ios`)
- sqflite (from `.symlinks/plugins/sqflite/ios`)
- xservice_kit (from `.symlinks/plugins/xservice_kit/ios`)
SPEC REPOS:
https://github.com/cocoapods/specs.git:
- FMDB
EXTERNAL SOURCES:
Flutter:
:path: ".symlinks/flutter/ios"
flutter_boost:
:path: ".symlinks/plugins/flutter_boost/ios"
gengmei_flutter_plugin:
:path: ".symlinks/plugins/gengmei_flutter_plugin/ios"
path_provider:
:path: ".symlinks/plugins/path_provider/ios"
sqflite:
:path: ".symlinks/plugins/sqflite/ios"
xservice_kit:
:path: ".symlinks/plugins/xservice_kit/ios"
SPEC CHECKSUMS:
Flutter: 58dd7d1b27887414a370fcccb9e645c08ffd7a6a
flutter_boost: 0e85ea37c74ed39ee7b91a35612afa1605557484
FMDB: 2ce00b547f966261cd18927a3ddb07cb6f3db82a
gengmei_flutter_plugin: 9461e8644c06c4a0e38292ddcca1cc55e6ac6156
path_provider: f96fff6166a8867510d2c25fdcc346327cc4b259
sqflite: ff1d9da63c06588cc8d1faf7256d741f16989d5a
xservice_kit: a2f1b35addc126fce8687aeb183ab0c1ada5b7f3
PODFILE CHECKSUM: 35a37ac9f50a31e3627f8c9992b49120478cca1a
COCOAPODS: 1.7.5
This source diff could not be displayed because it is too large. You can view the blob instead.
...@@ -4,8 +4,12 @@ ...@@ -4,8 +4,12 @@
// RouterCenterGenerator // RouterCenterGenerator
// ************************************************************************** // **************************************************************************
import "package:gmalpha_flutter/NewMessageModel/NewMessageRouterImpl.dart";
import "package:gmalpha_flutter/NewMessageModel/NewMessageRouter.dart";
import "package:gmalpha_flutter/PrestigeModel/PrestigeImpl.dart"; import "package:gmalpha_flutter/PrestigeModel/PrestigeImpl.dart";
import "package:gmalpha_flutter/PrestigeModel/PrestigeRouter.dart"; import "package:gmalpha_flutter/PrestigeModel/PrestigeRouter.dart";
import "package:gmalpha_flutter/BuriedLib/BuriedImpl.dart";
import "package:gmalpha_flutter/BuriedLib/BuriedRouter.dart";
import "package:gmalpha_flutter/AlbumModel/AlbumRouterImpl.dart"; import "package:gmalpha_flutter/AlbumModel/AlbumRouterImpl.dart";
import "package:gmalpha_flutter/AlbumModel/AlbumRouter.dart"; import "package:gmalpha_flutter/AlbumModel/AlbumRouter.dart";
import "package:gmalpha_flutter/ActivityReportModel/ActivityReportRouterImpl.dart"; import "package:gmalpha_flutter/ActivityReportModel/ActivityReportRouterImpl.dart";
...@@ -42,7 +46,9 @@ class RouterCenterImpl { ...@@ -42,7 +46,9 @@ class RouterCenterImpl {
} }
void init() { void init() {
map.putIfAbsent("NewMessageModel", () => NewMessageRouterImpl());
map.putIfAbsent("prestigeModel", () => PrestigeImpl()); map.putIfAbsent("prestigeModel", () => PrestigeImpl());
map.putIfAbsent("buried_router", () => BuriedImpl());
map.putIfAbsent("albumModel", () => AlbumRouterImpl()); map.putIfAbsent("albumModel", () => AlbumRouterImpl());
map.putIfAbsent("ActivityReportModel", () => ActivityReportRouterImpl()); map.putIfAbsent("ActivityReportModel", () => ActivityReportRouterImpl());
map.putIfAbsent("messageModel", () => MessageRouterImpl()); map.putIfAbsent("messageModel", () => MessageRouterImpl());
...@@ -53,6 +59,13 @@ class RouterCenterImpl { ...@@ -53,6 +59,13 @@ class RouterCenterImpl {
return map[modelName]; return map[modelName];
} }
NewMessageRouter findNewMessageRouter() {
if (map["NewMessageModel"] == null) {
return null;
}
return map["NewMessageModel"] as NewMessageRouter;
}
PrestigeRouter findPrestigeRouter() { PrestigeRouter findPrestigeRouter() {
if (map["prestigeModel"] == null) { if (map["prestigeModel"] == null) {
return null; return null;
...@@ -60,6 +73,13 @@ class RouterCenterImpl { ...@@ -60,6 +73,13 @@ class RouterCenterImpl {
return map["prestigeModel"] as PrestigeRouter; return map["prestigeModel"] as PrestigeRouter;
} }
BuriedRouter findBuriedRouter() {
if (map["buried_router"] == null) {
return null;
}
return map["buried_router"] as BuriedRouter;
}
AlbumRouter findAlbumRouter() { AlbumRouter findAlbumRouter() {
if (map["albumModel"] == null) { if (map["albumModel"] == null) {
return null; return null;
......
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/Annotations/RouterBaser.dart';
import 'package:gmalpha_flutter/Annotations/anno/Router.dart';
import 'package:gmalpha_flutter/NewMessageModel/NewMessageRouterImpl.dart';
@Router("NewMessageModel", NewMessageRouterImpl)
abstract class NewMessageRouter implements RouterBaser {
Widget getMessagePage();
}
\ No newline at end of file
import 'package:flutter/widgets.dart';
import 'package:gmalpha_flutter/NewMessageModel/NewMessageRouter.dart';
import 'package:gmalpha_flutter/newMessageModel/page/MessagePage.dart';
class NewMessageRouterImpl implements NewMessageRouter {
@override
Widget getMessagePage() {
return MessagePage();
}
}
\ No newline at end of file
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/MessageRepository.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LatestMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/UnreadMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/MyMessageEntity.dart';
import 'package:gmalpha_flutter/commonModel/live/BaseModel.dart';
import 'package:gmalpha_flutter/commonModel/live/LiveData.dart';
import 'package:gmalpha_flutter/commonModel/toast/toast.dart';
class MessageModel extends BaseModel {
final int page;
final int count;
LiveData<MyMessageEntity> myMessageLive = new LiveData();
LiveData<UnreadMessageEntity> likeUnreadMessageLive = new LiveData();
LiveData<UnreadMessageEntity> followUnreadMessageLive = new LiveData();
LiveData<LatestMessageEntity> latestMessageLive = new LiveData();
MessageModel(this.page, this.count);
init(BuildContext context) {
MessageRepository.getInstance()
.getMyMessage(page, count)
.listen((value) {
if (value != null) {
myMessageLive.notifyView(value);
}
}).onError((error) {
Toast.show(context, "${error.toString()}");
print(error);
});
MessageRepository.getInstance()
.getUnreadMessage(0)
.listen((value) {
if (value != null) {
likeUnreadMessageLive.notifyView(value);
}
}).onError((error) {
Toast.show(context, "${error.toString()}");
print(error);
});
MessageRepository.getInstance()
.getUnreadMessage(1)
.listen((value) {
if (value != null) {
followUnreadMessageLive.notifyView(value);
}
}).onError((error) {
Toast.show(context, "${error.toString()}");
print(error);
});
MessageRepository.getInstance()
.getLatestMessage()
.listen((value) {
if (value != null) {
latestMessageLive.notifyView(value);
}
}).onError((error) {
Toast.show(context, "${error.toString()}");
print(error);
});
}
@override
void dispose() {
myMessageLive.dispost();
likeUnreadMessageLive.dispost();
followUnreadMessageLive.dispost();
latestMessageLive.dispost();
}
}
import 'package:flutter/material.dart';
import 'package:gmalpha_flutter/NewMessageModel/page/MessageModel.dart';
class MessagePage extends StatefulWidget {
MessageModel _messageModel;
MessagePage() {
_messageModel = new MessageModel(1, 10);
}
@override
_MessagePageState createState() => _MessagePageState(_messageModel);
}
class _MessagePageState extends State<MessagePage> {
MessageModel _messageModel;
_MessagePageState(this._messageModel);
@override
void initState() {
super.initState();
_messageModel.init(context);
}
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text('')
),
body: Column(),
);
}
}
\ No newline at end of file
import 'package:gmalpha_flutter/NewMessageModel/service/local/MessageLocal.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/MessageRemote.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LatestMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/MyMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/UnreadMessageEntity.dart';
import 'package:rxdart/rxdart.dart';
class MessageRepository {
MessageRemote _remote;
MessageLocal _local;
static MessageRepository _userRepository;
MessageRepository._() {
_remote = MessageRemote.getInstance();
_local = MessageLocal.getInstance();
}
static MessageRepository getInstance() {
if (_userRepository == null) {
_userRepository = MessageRepository._();
}
return _userRepository;
}
Observable<MyMessageEntity> getMyMessage(int page, int count) {
return _remote.getMyMessage(page, count).map((value) {
if (value != null) {
}
return value;
});
}
Observable<UnreadMessageEntity> getUnreadMessage(int type) {
return _remote.getUnreadMessage(type).map((value) {
if (value != null) {
}
return value;
});
}
Observable<LatestMessageEntity> getLatestMessage() {
return _remote.getLatestMessage().map((value) {
if (value != null) {
}
return value;
});
}
}
\ No newline at end of file
class MessageLocal {
static MessageLocal _userRemote;
MessageLocal._() {}
static MessageLocal getInstance() {
if (_userRemote == null) {
_userRemote = new MessageLocal._();
}
return _userRemote;
}
}
import 'package:gmalpha_flutter/NewMessageModel/service/remote/api/MessageApi.serv.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LatestMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/MyMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/UnreadMessageEntity.dart';
import 'package:rxdart/rxdart.dart';
class MessageRemote {
static MessageRemote _userRemote;
MessageRemote._() {}
static MessageRemote getInstance() {
if (_userRemote == null) {
_userRemote = new MessageRemote._();
}
return _userRemote;
}
Observable<MyMessageEntity> getMyMessage(int page, int count) {
return MessageApiImpl().getMyMessage(page, count);
}
Observable<UnreadMessageEntity> getUnreadMessage(int type) {
return MessageApiImpl().getUnreadMessage(type);
}
Observable<LatestMessageEntity> getLatestMessage() {
return MessageApiImpl().getLatestMessage();
}
}
import 'package:gmalpha_flutter/Annotations/anno/Get.dart';
import 'package:gmalpha_flutter/Annotations/anno/Query.dart';
import 'package:gmalpha_flutter/Annotations/anno/ServiceCenter.dart';
import 'package:gmalpha_flutter/newMessageModel/service/remote/entity/LatestMessageEntity.dart';
import 'package:gmalpha_flutter/newMessageModel/service/remote/entity/MyMessageEntity.dart';
import 'package:gmalpha_flutter/newMessageModel/service/remote/entity/UnreadMessageEntity.dart';
@ServiceCenter()
abstract class MessageApi{
@Get("api/v1/message/my")
MyMessageEntity getMyMessage(@Query('page') int page, @Query('count') int count);
@Get("api/v1/message/unread")
UnreadMessageEntity getUnreadMessage(@Query('type') int type);
@Get('api/v1/push/newest/info')
LatestMessageEntity getLatestMessage();
}
\ No newline at end of file
// GENERATED CODE - DO NOT MODIFY BY HAND
// **************************************************************************
// ServiceGenerator
// **************************************************************************
import 'dart:convert';
import 'dart:io';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/LatestMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/MyMessageEntity.dart';
import 'package:gmalpha_flutter/NewMessageModel/service/remote/entity/UnreadMessageEntity.dart';
import 'package:rxdart/rxdart.dart';
import 'package:gmalpha_flutter/commonModel/net/DioUtil.dart';
class MessageApiImpl {
factory MessageApiImpl() => _sharedInstance();
static MessageApiImpl _instance;
MessageApiImpl._() {}
static MessageApiImpl _sharedInstance() {
if (_instance == null) {
_instance = MessageApiImpl._();
}
return _instance;
}
Observable<MyMessageEntity> getMyMessage(int page, int count) {
return Observable.fromFuture(DioUtil().get('api/v1/message/my',
data: {'page': page, 'count': count})).map((value) {
if (value != null && value.statusCode == 200) {
Map map = json.decode(value.toString());
return MyMessageEntity.fromJson(map);
}
});
}
Observable<UnreadMessageEntity> getUnreadMessage(int type) {
return Observable.fromFuture(
DioUtil().get('api/v1/message/unread', data: {'type': type}))
.map((value) {
if (value != null && value.statusCode == 200) {
Map map = json.decode(value.toString());
return UnreadMessageEntity.fromJson(map);
}
});
}
Observable<LatestMessageEntity> getLatestMessage() {
return Observable.fromFuture(DioUtil().get('api/v1/push/newest/info'))
.map((value) {
if (value != null && value.statusCode == 200) {
Map map = json.decode(value.toString());
return LatestMessageEntity.fromJson(map);
}
});
}
}
class LatestMessageEntity {
int error;
String message;
Null extra;
Data data;
LatestMessageEntity({this.error, this.message, this.extra, this.data});
LatestMessageEntity.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
if (this.data != null) {
data['data'] = this.data.toJson();
}
return data;
}
}
class Data {
int id;
String title;
String content;
String icon;
int pushTime;
String url;
String pushTimeStr;
User user;
Data(
{this.id,
this.title,
this.content,
this.icon,
this.pushTime,
this.url,
this.pushTimeStr,
this.user});
Data.fromJson(Map<String, dynamic> json) {
id = json['id'];
title = json['title'];
content = json['content'];
icon = json['icon'];
pushTime = json['push_time'];
url = json['url'];
pushTimeStr = json['push_time_str'];
user = json['user'] != null ? new User.fromJson(json['user']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['title'] = this.title;
data['content'] = this.content;
data['icon'] = this.icon;
data['push_time'] = this.pushTime;
data['url'] = this.url;
data['push_time_str'] = this.pushTimeStr;
if (this.user != null) {
data['user'] = this.user.toJson();
}
return data;
}
}
class User {
int id;
String name;
User({this.id, this.name});
User.fromJson(Map<String, dynamic> json) {
id = json['id'];
name = json['name'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['name'] = this.name;
return data;
}
}
\ No newline at end of file
class MyMessageEntity {
int error;
String message;
Null extra;
List<Data> data;
MyMessageEntity({this.error, this.message, this.extra, this.data});
MyMessageEntity.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra'];
if (json['data'] != null) {
data = new List<Data>();
json['data'].forEach((v) {
data.add(new Data.fromJson(v));
});
}
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
if (this.data != null) {
data['data'] = this.data.map((v) => v.toJson()).toList();
}
return data;
}
}
class Data {
int userId;
String name;
String icon;
int id;
bool isLike;
double time;
String content;
RepliedContent repliedContent;
Data(
{this.userId,
this.name,
this.icon,
this.id,
this.isLike,
this.time,
this.content,
this.repliedContent});
Data.fromJson(Map<String, dynamic> json) {
userId = json['user_id'];
name = json['name'];
icon = json['icon'];
id = json['id'];
isLike = json['is_like'];
time = json['time'];
content = json['content'];
repliedContent = json['replied_content'] != null
? new RepliedContent.fromJson(json['replied_content'])
: null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['user_id'] = this.userId;
data['name'] = this.name;
data['icon'] = this.icon;
data['id'] = this.id;
data['is_like'] = this.isLike;
data['time'] = this.time;
data['content'] = this.content;
if (this.repliedContent != null) {
data['replied_content'] = this.repliedContent.toJson();
}
return data;
}
}
class RepliedContent {
int id;
int type;
int topicId;
int contentType;
String content;
RepliedContent(
{this.id, this.type, this.topicId, this.contentType, this.content});
RepliedContent.fromJson(Map<String, dynamic> json) {
id = json['id'];
type = json['type'];
topicId = json['topic_id'];
contentType = json['content_type'];
content = json['content'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['id'] = this.id;
data['type'] = this.type;
data['topic_id'] = this.topicId;
data['content_type'] = this.contentType;
data['content'] = this.content;
return data;
}
}
\ No newline at end of file
class UnreadMessageEntity {
int error;
String message;
Null extra;
Data data;
UnreadMessageEntity({this.error, this.message, this.extra, this.data});
UnreadMessageEntity.fromJson(Map<String, dynamic> json) {
error = json['error'];
message = json['message'];
extra = json['extra'];
data = json['data'] != null ? new Data.fromJson(json['data']) : null;
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['error'] = this.error;
data['message'] = this.message;
data['extra'] = this.extra;
if (this.data != null) {
data['data'] = this.data.toJson();
}
return data;
}
}
class Data {
int count;
int voteCount;
int urgeCount;
Data({this.count, this.voteCount, this.urgeCount});
Data.fromJson(Map<String, dynamic> json) {
count = json['count'];
voteCount = json['vote_count'];
urgeCount = json['urge_count'];
}
Map<String, dynamic> toJson() {
final Map<String, dynamic> data = new Map<String, dynamic>();
data['count'] = this.count;
data['vote_count'] = this.voteCount;
data['urge_count'] = this.urgeCount;
return data;
}
}
\ No newline at end of file
...@@ -90,17 +90,18 @@ class _MyAppState extends State<MyApp> { ...@@ -90,17 +90,18 @@ class _MyAppState extends State<MyApp> {
routes: { routes: {
// '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}), // '/': (context) => CommentSuggest({"Cookie":" _gm_token=7e48641558699683; sessionid=nb3ze4ur7ucosln8sd8pzwojddenv9ym; _gtid=a1bc0a387e1911e996b9525400fa516d4094"}),
'/': (context) { '/': (context) {
// Api.getInstance().initBuildConfig({ Api.getInstance().initBuildConfig({
// 'Cookie': 'Cookie':
// '_gm_token=72ee1c1569466411; _gtid=58d3cc14df8711e99736525400e82fab81; sessionid=vhksn66854pejzjwi8ljhrmcew3domh2', '_gm_token=72ee1c1569466411; _gtid=58d3cc14df8711e99736525400e82fab81; sessionid=vhksn66854pejzjwi8ljhrmcew3domh2',
// "buildConfig": "debug" "buildConfig": "debug"
// }); });
// return RouterCenterImpl() // return RouterCenterImpl()
// .findActivityReportRouter() // .findActivityReportRouter()
// ?.getActivityReportPage(279, 1, ''); // ?.getActivityReportPage(279, 1, '');
return RouterCenterImpl() // return RouterCenterImpl()
.findAlbumRouter() // .findAlbumRouter()
.getAlbumPage("com.example.gengmei_flutter_plugin_example",true, 2, null); // .getAlbumPage("com.example.gengmei_flutter_plugin_example",true, 2, null);
return RouterCenterImpl().findNewMessageRouter().getMessagePage();
}, },
}, },
......
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