Browse Source

update community

glglove 2 months ago
parent
commit
fbbca6886c
18 changed files with 704 additions and 179 deletions
  1. 2 2
      packages/cpt_community/lib/components/newsfeed_card_content.dart
  2. 1 1
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_page.dart
  3. 13 2
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.dart
  4. 7 5
      packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_page.dart
  5. 15 8
      packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_vm.dart
  6. 1 1
      packages/cpt_community/lib/modules/my_following/components/item_following.dart
  7. 32 14
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_page.dart
  8. 0 18
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_state.dart
  9. 247 76
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.dart
  10. 5 1
      packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/newsfeed_itemgroup_state.dart
  11. 13 2
      packages/cpt_community/lib/respository/common_newsfeed.dart
  12. 1 1
      packages/cpt_property/lib/modules/rent/page/property_rent_page.dart
  13. 1 1
      packages/cpt_property/lib/modules/sale/page/property_sale_page.dart
  14. 70 0
      packages/cs_domain/lib/entity/myposts_newsfeed_entity.dart
  15. 45 14
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  16. 31 14
      packages/cs_domain/lib/generated/json/facility_book_entity.g.dart
  17. 38 19
      packages/cs_domain/lib/generated/json/facility_page_entity.g.dart
  18. 182 0
      packages/cs_domain/lib/generated/json/myposts_newsfeed_entity.g.dart

+ 2 - 2
packages/cpt_community/lib/components/newsfeed_card_content.dart

@@ -104,9 +104,9 @@ class NewsFeedCardContent extends StatelessWidget {
               imageUrls.length,
               (index) => Container(
                 height: 87,
-                width: maxWidth/imageCount - 16,
+                  width: (totalImageCount < rowMaxImageNum)? maxWidth/rowMaxImageNum - 16 : maxWidth/imageCount - 16,
                 margin: EdgeInsets.only(right: (index!=imageCount-1) ? 16 : 0 ),
-                // color: ColorUtils.string2Color("#F2F3F6"),
+                color: ColorUtils.string2Color("#F2F3F6"),
                 child:Stack(
                     children: [
                       MyLoadImage(

+ 1 - 1
packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_page.dart

@@ -30,7 +30,7 @@ import 'newsfeed_detail_vm.dart';
 @RoutePage()
 class NewsfeedDetailPage extends HookConsumerWidget {
   final int? id;
-  final String? type;  // news  following foryou
+  final String? type;  // news  following foryou  mypostsNews
 
   const NewsfeedDetailPage({Key? key, @PathParam('id') required this.id, @PathParam('type') required this.type}) : super(key: key);
   // 启动当前页面

+ 13 - 2
packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.dart

@@ -1,6 +1,7 @@
 
 import 'package:cpt_community/modules/community/following/following_vm.dart';
 import 'package:cpt_community/modules/community/foryou/foryou_vm.dart';
+import 'package:cpt_community/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.dart';
 import 'package:cpt_community/respository/common_newsfeed.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
@@ -43,7 +44,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   );
 
   int? _detailId;
-  String? _detailType = 'news';
+  String? _detailType = 'news';  // news  following foryou  mypostsNews
 
 
   NewsfeedDetailState initState() {
@@ -221,7 +222,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
 
   // 点击了 关注/取消关注按钮
   Future<bool> handlerFollow(BuildContext? context, int to_user_id,int cardId, bool isFollow) async{
-    Log.d("newsfeed_detail_vm 中 当前的 _detailType $_detailType 点击了 关注/取消关注");
+    Log.d("newsfeed_detail_vm 中 当前的 _detailType $_detailType to_user_id:$to_user_id cardId:$cardId isFollow:$isFollow  点击了 关注/取消关注");
     bool result = false;
     if(_detailType == 'news'){
       Log.d("调用 newvm 中的关注/取消关注方法");
@@ -238,6 +239,11 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
       // 调用列表中的 点赞方法
       final forYouVm = ref.read(foryouVmProvider.notifier);
       result = await forYouVm.handlerFollow(context, to_user_id, cardId, isFollow);
+    }else if(_detailType == 'mypostsNews'){
+      Log.d("调用 mypostsNews 中的关注/取消关注方法");
+      // 调用列表中的 点赞方法
+      final myPostsNewsVm = ref.read(myPostsNewsfeedVmProvider.notifier);
+      result = await myPostsNewsVm.handlerFollow(context, to_user_id, cardId, isFollow);
     }
 
     if(result){
@@ -391,6 +397,11 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
       // 调用列表中的 点赞方法
       final forYouVm = ref.read(foryouVmProvider.notifier);
       result = await forYouVm.handlerLikeClick(id, isLike, null);
+    }else if(_detailType == 'mypostsNews'){
+      Log.d("调用 myPostsVm 中的点赞方法");
+      // 调用列表中的 点赞方法
+      final myPostsVm = ref.read(myPostsNewsfeedVmProvider.notifier);
+      result = await myPostsVm.handlerLikeClick(id, isLike, null, null);
     }
 
     if(result){

+ 7 - 5
packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_page.dart

@@ -109,11 +109,13 @@ class NewsfeedPostPage extends HookConsumerWidget {
                         textColor: Colors.white,
                         fontWeight: FontWeight.w500,
                         fontSize: 16,
-                        onPressed: (){
-                          vm.submitNewsfeedPost(context, sCallback: sCallback, fCallback: fCallback);
-                          // final communitVm = ref.read(communityVmProvider.notifier);
-                          // communitVm.getCurrentPageViewVm(null).initPageData();
-                          // Navigator.pop(context);
+                        onPressed: () async{
+                          final asyncResult = await vm.submitNewsfeedPost(context, sCallback: sCallback, fCallback: fCallback);
+                          if(asyncResult){
+                            final communitVm = ref.read(communityVmProvider.notifier);
+                            communitVm.getCurrentPageViewVm(null).initPageData();
+                            Navigator.pop(context);
+                          }
                         },
                       ),
                     ),

+ 15 - 8
packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_vm.dart

@@ -109,8 +109,8 @@ class NewsfeedPostVm extends _$NewsfeedPostVm {
     }
   }
 
-  ///提交反馈
-  void submitNewsfeedPost(BuildContext? context, {VoidCallback? sCallback, VoidCallback? fCallback}) {
+  ///newsfeed 发布提交
+  Future<bool> submitNewsfeedPost(BuildContext? context, {VoidCallback? sCallback, VoidCallback? fCallback}) async {
     state = state.copyWith(mindFieldErrorText: null);
 
     _dismissKeyboard(keyStr: 'mind');
@@ -124,26 +124,33 @@ class NewsfeedPostVm extends _$NewsfeedPostVm {
     if (Utils.isEmpty(mindValue)) {
       state = state.copyWith(mindFieldErrorText: "Mind cannot be empty!");
       ToastEngine.show("${state.mindFieldErrorText}");
-      return;
+      return false;
     }
 
-    handlerSubmitPostNewsfeed(sCallback: sCallback, fCallback: fCallback);
+    if(state.imgList.isEmpty){
+      ToastEngine.show("ImgList cannot be empty");
+      return false;
+    }
 
+    return await handlerSubmitPostNewsfeed(mindValue, state.imgList,  sCallback: sCallback, fCallback: fCallback);
   }
 
-  Future handlerSubmitPostNewsfeed({VoidCallback? sCallback, VoidCallback? fCallback}) async{
+  Future<bool> handlerSubmitPostNewsfeed(String mindValue,List<String> imgList,{VoidCallback? sCallback, VoidCallback? fCallback}) async{
     try {
       final result = await repositoryInstance.fetchNewsfeedPublish({
-        "content ": "test",
-        "resources": []
+        "content": mindValue,
+        "resources": imgList
       });
       if (result.isSuccess) {
         sCallback?.call();
+        return true;
       }else {
         fCallback?.call();
+        return false;
       }
     }catch(e){
-
+      Log.d("发布newsfeed 失败 $e");
+      return false;
     }
   }
 

+ 1 - 1
packages/cpt_community/lib/modules/my_following/components/item_following.dart

@@ -30,7 +30,7 @@ class MyFollowingListItem extends StatelessWidget {
 
   @override
   Widget build(BuildContext context) {
-    String avator = itemObj?['avator']??'';
+    String avator = itemObj?['avatar']??'';
     String name = itemObj?['name']??'';
     return Column(
       children: [

+ 32 - 14
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_page.dart

@@ -2,6 +2,7 @@ import 'package:cpt_community/components/comments_dialog.dart';
 import 'package:cpt_community/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.dart';
 import 'package:cpt_community/router/page/community_page_router.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:domain/entity/myposts_newsfeed_entity.dart';
 import 'package:flutter/material.dart';
 import 'package:auto_route/auto_route.dart';
 import 'package:flutter_hooks/flutter_hooks.dart';
@@ -9,6 +10,7 @@ import 'package:hooks_riverpod/hooks_riverpod.dart';
 import 'package:plugin_basic/provider/app_config/app_config_service.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/ext/ex_widget.dart';
 import 'package:widgets/load_state_layout.dart';
@@ -113,7 +115,7 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
                       return StickyHeader(
                         header: _buildHeaderContent(state.list![index], context),
                         content: Column(
-                          children: _buildGroupContent(state.list![index].itemgroupDatas , index, vm, context),
+                          children: _buildGroupItemContent((state.list![index] as NewsFeedItemGroupState).itemgroupDatas as List<MypostsNewsfeedList>, index, vm, context),
                         ),
                       );
                     },
@@ -136,10 +138,26 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
     );
   }
 
-  List<Widget> _buildGroupContent(List<Map<String, dynamic>> list, int groupIndex,  vm, BuildContext context) {
-    return list.asMap().entries.map((entry) {
+  List<Widget> _buildGroupItemContent(List<MypostsNewsfeedList> groupList, int groupIndex,  vm, BuildContext context) {
+    return groupList.asMap().entries.map((entry) {
       int childIndex = entry.key;
-      Map<String, dynamic> item = entry.value;
+      MypostsNewsfeedList item = entry.value;
+      Map<String, dynamic> itemJson = entry.value.toJson();
+
+      // String card_title = item.getValue("title", "");
+      int card_id = itemJson.getValue("id", null);
+      String card_created_at = itemJson.getValue("created_at", "");
+      // Map<String, dynamic>? card_account = itemJson.getValue<Map<String,dynamic>>("account", null);
+      // String card_avator = card_account?['avator']?? "";
+      // String card_count_name = card_account?['name']?? "";
+      // bool card_followed = card_account?['followed']??false;
+      // int card_count_id = card_account?['id']?? null;
+      String card_content = itemJson.getValue("content", "");
+      List? card_resources = itemJson.getValue<List>("resources", [])?? [];
+      bool card_liked = itemJson.getValue("liked", false);
+      int card_likes_count = itemJson.getValue("likes_count", 0);
+      int card_comments_count = itemJson.getValue("comments_count", 0);
+
       return Container(
         margin: const EdgeInsets.only(left: 15, right: 15,top: 14,bottom: 14),
         padding: const EdgeInsets.only(left: 15, right: 15,top: 17,bottom: 0),
@@ -160,7 +178,7 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
           crossAxisAlignment: CrossAxisAlignment.start,
           children: [
             MyTextView(
-              item['time'],
+              card_created_at,
               textColor: context.appColors.textDarkGray,
               fontSize: 12,
               paddingLeft: 15,
@@ -170,8 +188,8 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
             // 卡片中间 (文字和图片)
             NewsFeedCardContent(
               key: UniqueKey(),
-              content: item['content'],
-              imageUrls: item["imageUrls"],
+              content: card_content,
+              imageUrls: card_resources,
             ),
             const SizedBox(height: 16),
             // 卡片底部 (点赞 评论 分享)
@@ -185,17 +203,17 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
               ),
               child: NewsFeedCardFooter(
                 key: UniqueKey(),
-                isLike: true,
-                likes_count: item['likes_count']?? 0,
-                comments_count: item['comments_count']?? 0,
+                isLike: card_liked,
+                likes_count: card_likes_count,
+                comments_count: card_comments_count,
                 onLike: () {
-                  vm.handlerClickActionBtn('like', item);
+                  vm.handlerClickActionBtn('like', item.toJson(), groupIndex, childIndex);
                 },
                 onComment: () {
-                  vm.handlerClickActionBtn('comments', item);
+                  vm.handlerClickActionBtn('comments', item.toJson(), groupIndex, childIndex);
                 },
                 onShare: () {
-                  vm.handlerClickActionBtn('share', item);
+                  vm.handlerClickActionBtn('share', item.toJson(), groupIndex, childIndex);
                 },
               ),
             ),
@@ -203,7 +221,7 @@ class MyPostsNewsfeedPage extends HookConsumerWidget {
         ),
       ).onTap((){
         // 跳转到 详情页
-        vm.handlerGotoDetail(item['id']);
+        vm.handlerGotoDetail(context, card_id);
       });
     }).toList();
   }

+ 0 - 18
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_state.dart

@@ -7,9 +7,6 @@ class MyPostsNewsfeedState {
   String? errorMessage;
 
   int? activeTabIndex =0;
-  int? page =0;
-  int? limit =10;
-  int? count =1;
   List<Map<String, dynamic>>? tabsList;
   List<NewsFeedItemGroupState>? list = [];
 
@@ -17,9 +14,6 @@ class MyPostsNewsfeedState {
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
     this.activeTabIndex,
-    this.page,
-    this.limit,
-    this.count = 1,
     List<Map<String, dynamic>>? tabsList,
     this.list,
   }): tabsList = tabsList ?? [
@@ -44,9 +38,6 @@ class MyPostsNewsfeedState {
     LoadState? loadingState,
     String? errorMessage,
     int? activeTabIndex,
-    int? page,
-    int? limit,
-    int? count,
     List<Map<String, dynamic>>? tabsList,
     List<NewsFeedItemGroupState>? list,
   }) {
@@ -54,9 +45,6 @@ class MyPostsNewsfeedState {
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
-      page: page ?? this.page,
-      limit: limit ?? this.limit,
-      count: count ?? this.count,
       tabsList: tabsList ?? this.tabsList,
       list: list ?? this.list,
     );
@@ -67,9 +55,6 @@ class MyPostsNewsfeedState {
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
       'activeTabIndex': this.activeTabIndex,
-      'page': this.page,
-      'limit': this.limit,
-      'count': this.count,
       'tabsList': this.tabsList,
       'list': this.list,
     };
@@ -80,9 +65,6 @@ class MyPostsNewsfeedState {
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
       activeTabIndex: map['activeTabIndex'] as int,
-      page: map['page'] as int,
-      limit: map['limit'] as int,
-      count: map['count'] as int,
       tabsList: map['tabsList'] as List<Map<String, dynamic>>,
       list: map['list'] as List<NewsFeedItemGroupState>,
     );

+ 247 - 76
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/my_posts_newsfeed_vm.dart

@@ -1,13 +1,16 @@
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/myposts_newsfeed_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
 import 'package:router/ext/auto_router_extensions.dart';
+import 'package:shared/utils/ext_dart.dart';
 import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 import 'package:auto_route/auto_route.dart';
 
+import '../../../respository/common_newsfeed.dart';
 import '../../../router/page/community_page_router.dart';
 
 import '../../community/newsfeed_detail/newsfeed_detail_page.dart';
@@ -19,9 +22,14 @@ part 'my_posts_newsfeed_vm.g.dart';
 
 @riverpod
 class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
-  // late MyPostsRepository MyPostsRepositoryInstance;
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
 
   bool _needShowPlaceholder = false; //是否展示LoadingView
+
+  int _page = 1;
+  int _limit = 10;
+  int _count = 0;
+
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
     controlFinishRefresh: true,  //允许刷新
@@ -37,7 +45,7 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
   @override
   MyPostsNewsfeedState build(){
     // 引入数据仓库
-    // MyPostsNewsfeedRepositoryInstance = ref.read(newsRepositoryProvider);
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -70,17 +78,7 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
   // 上拉加载 更多
   Future loadMore() async {
     Log.d("----for_sale_vm-----loadMore");
-    // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= state.count){
-    //   return;
-    // }else {
-    //   int page = state.page + 1;
-    //   state = state.copyWith(page: page,);
-    //   getListData();
-    // }
-    // 检查 page 是否为 null,并初始化为 1
-    int newCurPage = state.page ?? 1;
-    state = state.copyWith(page: ++newCurPage);
+    _page++;
     getListData();
   }
 
@@ -90,31 +88,31 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
     Log.d("----forsale_vm-----onRefresh ");
 
     // await Future.delayed(const Duration(seconds: 2));
-    state = state.copyWith(page: 1);
+    _page = 1;
     getListData();
   }
 
   // 重试请求
   Future retryRequest() async {
-    state = state.copyWith(page: 1);
+    _page = 1;
     _needShowPlaceholder = true;
     getListData();
   }
 
   // 获取list 列表数据
-  Future getListData<T>() async {
+  Future getListData<T>({bool? isLoadMore = false}) async {
     Log.d("加载listData数据---------------start-----");
 
     if (_needShowPlaceholder) {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.page}---");
+    Log.d("for_sale加载listData数据---------------start--${_page}---");
     //   try {
     //     //请求网络
     //     Map<String, dynamic>  params = {
-    //       "page": state.page,
-    //       "limit": state.limit,
+    //       "page": _page,
+    //       "limit": _limit,
     //     };
     //     Log.d("请求参数------$params");
     //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
@@ -136,91 +134,264 @@ class MyPostsNewsfeedVm extends _$MyPostsNewsfeedVm {
 
     await Future.delayed(const Duration(milliseconds: 1500));
 
-    final List<NewsFeedItemGroupState> listData = [];
-
-    listData.add(
-        NewsFeedItemGroupState(
-        groupId: "June 17,2024",
-        itemgroupDatas: [
-          {
-            'id': 1,
-            'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-            'title': 'William Jefferson',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': true,
-            'likeno': 12
-          },
-          {
-            'id': 2,
-            'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
-            'title': 'William Jefferson',
-            'isFollow': false,
-            'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
-            'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
-            'time': 'June 17,2016 at 7:23 p.m.',
-            'isLike': true,
-            'likeno': 12
-          },
-        ]
-    ));
-
-
-
-
-    if (state.page == 1) {
-      //刷新的方式
-      state = state.copyWith(list: listData);
-      refreshController.finishRefresh();
-      // //更新展示的状态
-      changeLoadingState(LoadState.State_Success, null);
+    // final List<NewsFeedItemGroupState> listData = [];
+    //
+    // listData.add(
+    //     NewsFeedItemGroupState(
+    //     groupId: "June 17,2024",
+    //     itemgroupDatas: [
+    //       {
+    //         'id': 1,
+    //         'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //         'title': 'William Jefferson',
+    //         'isFollow': false,
+    //         'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //         'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //         'time': 'June 17,2016 at 7:23 p.m.',
+    //         'isLike': true,
+    //         'likeno': 12
+    //       },
+    //       {
+    //         'id': 2,
+    //         'avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500',
+    //         'title': 'William Jefferson',
+    //         'isFollow': false,
+    //         'content': 'She said YES and our lives changed.Thank you all for coming to my propose today.We hope everyone can ……[More]',
+    //         'imageUrls': ['https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500','https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500'],
+    //         'time': 'June 17,2016 at 7:23 p.m.',
+    //         'isLike': true,
+    //         'likeno': 12
+    //       },
+    //     ]
+    // ));
+
+
+
+
+    // if (_page == 1) {
+    //   //刷新的方式
+    //   state = state.copyWith(list: listData);
+    //   refreshController.finishRefresh();
+    //   // //更新展示的状态
+    //   changeLoadingState(LoadState.State_Success, null);
+    // } else {
+    //   //加载更多
+    //   final allList = state.list;
+    //   allList?.addAll(listData);
+    //   state = state.copyWith(list: allList);
+    //   refreshController.finishLoad();
+    // }
+
+    // // 最后赋值
+    // _needShowPlaceholder = false;
+
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "page": _page,
+        "limit": _limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await commonNewsFeedRespositoryInstance.fetchMyPostNewsfeedList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.data  as MypostsNewsfeedEntity).list as List<MypostsNewsfeedList>, isLoadMore ?? false);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
+    }
+
+    updateMyPostsTabsNum('newsFeed', state.list!.length, 0);
+  }
+
+
+  void handlerResultList(List<MypostsNewsfeedList>? list, bool isLoadMore) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+
+        state.list!.addAll(groupList(list));
+        refreshController.finishRefresh();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        allList!.addAll(groupList(list));
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
     } else {
-      //加载更多
-      final allList = state.list;
-      allList?.addAll(listData);
-      state = state.copyWith(list: allList);
-      refreshController.finishLoad();
+      if (_page == 1) {
+        //展示无数据的布局
+        state.list!.clear();
+        changeLoadingState(LoadState.State_Empty, null);
+        refreshController.finishRefresh();
+      } else {
+        //展示加载完成,没有更多数据了
+        if(state.list!.length == 0){
+          changeLoadingState(LoadState.State_Empty, null);
+          refreshController.finishLoad();
+        }else {
+          if(_needShowPlaceholder){
+            changeLoadingState(LoadState.State_Success, null);
+          }
+        }
+        //更新展示的状态
+        refreshController.finishLoad(IndicatorResult.noMore);
+      }
+    }
+  }
+
+  // 根据created_at 将 list 进行分组
+  List<NewsFeedItemGroupState> groupList(List<MypostsNewsfeedList> list) {
+    if (list == null || list.isEmpty) {
+      return [];
     }
 
-    // 最后赋值
-    _needShowPlaceholder = false;
+    Map<String, List<MypostsNewsfeedList>> groupedMap = {};
 
+    for (var item in list) {
+      groupedMap.putIfAbsent(item.createdAt!, () => []).add(item);
+    }
+
+    return groupedMap.entries.map((entry) {
+      return NewsFeedItemGroupState(
+        groupId: entry.key,
+        itemgroupDatas: entry.value,
+      );
+    }).toList();
+  }
+
+
+
+  // 更新 my_posts_tabs 里面的数字
+  updateMyPostsTabsNum(String key, int num, int activeTabIdx){
     WidgetsBinding.instance.addPostFrameCallback((_) {
       // 需要更新 my_posts_tabs 里面的数字
       ref.read(myPostsVmProvider.notifier)
-          .updateMyPostsTabsNum( 'newsFeed', state.list!.length, 0);
+          .updateMyPostsTabsNum(key, num, activeTabIdx );
     });
   }
 
+  // 点赞/取消点赞
+  Future handlerLikeClick(int id, bool isLike, int? groupIndex, int? childIndex) async {
+    Log.d("99999   id:$id   isLike:$isLike groupIndex:$groupIndex  childIndex:$childIndex");
+    try {
+      final result = await commonNewsFeedRespositoryInstance.fetchLikeClick({
+        "id": id,
+      });
+      List<NewsFeedItemGroupState> listCopyDta =  List.from(state.list!);
+      if (result.isSuccess) {
+        if(groupIndex != null){
+          MypostsNewsfeedList currentGroupItem = listCopyDta[groupIndex!].itemgroupDatas[childIndex!];
+          Map<String, dynamic> currentGroupItemJson = currentGroupItem.toJson();
+          Log.d("77777  $currentGroupItemJson");
+          // 修改 listCopyDta[itemIdx] 中的 like 状态 和 likes_count
+          currentGroupItemJson['liked'] = !isLike;
+
+          if(isLike){
+            // 取消点赞
+            if(currentGroupItemJson['likes_count']>0){
+              currentGroupItemJson['likes_count'] = currentGroupItemJson['likes_count'] - 1;
+            }
+          }else {
+            currentGroupItemJson['likes_count'] = currentGroupItemJson['likes_count'] + 1;
+          }
+
+
+          listCopyDta[groupIndex!].itemgroupDatas[childIndex] = MypostsNewsfeedList.fromJson(currentGroupItemJson);
+        }else {
+          Log.d("88888");
+          // 详情中的点赞 需要找到对应的 item 进行 修改 like 和 likes_count
+          listCopyDta!.forEach((groupitem) {
+            List<MypostsNewsfeedList> groupItemGroupDatas = groupitem.itemgroupDatas;
+            if(groupItemGroupDatas!=null && groupItemGroupDatas.isNotEmpty){
+              for (var value in groupItemGroupDatas) {
+
+                if(value.id == id){
+                  value.liked = !isLike;
+                  if(isLike){
+                    // 取消点赞
+                    if(value.likesCount!>0){
+                      value.likesCount =value.likesCount! - 1;
+                    }
+                  }else {
+                    value.likesCount = value.likesCount! + 1;
+                  }
+                }
+              }
+            }
+
+          });
+        }
+
+        state = state.copyWith(list: listCopyDta);
+
+        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
+        ToastEngine.show(toastMsg);
+
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error) {
+      Log.d("my_posts_newsfeed_vm handlerLikeClick 发生错误: $error");
+      return false;
+    }
+  }
 
 
   // 点击 like comments  share
-  void handlerClickActionBtn(String? actionStr, item){
+  Future<bool?> handlerClickActionBtn(String? actionStr, Map<String, dynamic> item, int? groupIndex, int? childIndex) async{
     final id = item['id'];
+    final liked = item.getValue('liked', false);
     switch (actionStr) {
       case 'like':
-        Log.d("点击了 点赞");
-        handlerGotoDetail(id);
-        break;
+        return await handlerLikeClick(id, liked, groupIndex, childIndex!);
       case 'comments':
         Log.d("点击了 评论");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       case 'share':
         Log.d("点击了 分享");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
       default:
         Log.d("点击了卡片");
-        handlerGotoDetail(id);
+        handlerGotoDetail(null, id);
         break;
     }
   }
+
+
+  // 关注/取消关注
+  Future<bool> handlerFollow(BuildContext? context, int to_user_id, int cardId, bool isFollow) async{
+    Log.d("点击了 关注");
+    try {
+      final result = await commonNewsFeedRespositoryInstance.handlerFollowOrCancel({
+        "to_user_id": to_user_id,
+      });
+      if(result.isSuccess){
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      Log.d("error: $error");
+      return false;
+    }
+  }
+
   // 去详情页面
-  void handlerGotoDetail(id){
+  void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");
-    appRouter.push(NewsfeedDetailPageRoute(id: id, type:'news'));
+    appRouter.push(NewsfeedDetailPageRoute(id: id, type: 'mypostsNews'));
   }
 }

+ 5 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_newsfeed/newsfeed_itemgroup_state.dart

@@ -1,7 +1,11 @@
 
+import 'package:domain/entity/myposts_newsfeed_entity.dart';
+
 class NewsFeedItemGroupState {
   String groupId;  // 分组id
-  List<Map<String, dynamic>> itemgroupDatas;  // 组数据
+  List<MypostsNewsfeedList> itemgroupDatas;  // 组数据
 
   NewsFeedItemGroupState({required this.groupId, required this.itemgroupDatas});
+
+
 }

+ 13 - 2
packages/cpt_community/lib/respository/common_newsfeed.dart

@@ -1,5 +1,6 @@
 import 'package:domain/constants/api_constants.dart';
 import 'package:domain/entity/myfollowing_list_entity.dart';
+import 'package:domain/entity/myposts_newsfeed_entity.dart';
 import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
 import 'package:domain/entity/newsfeed_detail_entity.dart';
 import 'package:domain/entity/newsfeed_following_entity.dart';
@@ -226,13 +227,23 @@ class CommonNewsFeedRespository {
     Map<String, dynamic> params = {};
     params = data!;
     Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Content-Type"] = "multipart/form-data";
     headers["Accept"] = "application/x.yyjobs-api.v1+json";
 
+    List<String> paths = data!["resources"] as List<String>;
+
+    Map<String, String> files = {};
+    if (paths != null && paths.isNotEmpty) {
+      paths.asMap().forEach((index, path) {
+        files["resources[$index]"] = path;
+      });
+    }
+
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
       '/api/v1/user/news-feed/index/publish', // api 地址
       params: params,
+      paths: files,
       headers: headers,
       method: HttpMethod.POST,
       isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
@@ -427,7 +438,7 @@ class CommonNewsFeedRespository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      // var data = NewsfeedDetailEntity.fromJson(json!);
+      var data = MypostsNewsfeedEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
     }else {

+ 1 - 1
packages/cpt_property/lib/modules/rent/page/property_rent_page.dart

@@ -117,7 +117,7 @@ class PropertyRentPage extends HookConsumerWidget {
         ],
       ).onTap((){
         // 去详情
-        _vm.goNewsDetail(item);
+        // _vm.goNewsDetail(item);
       }),
     ).border(color: context.appColors.dividerDefault, bottom: 0.5);
   }

+ 1 - 1
packages/cpt_property/lib/modules/sale/page/property_sale_page.dart

@@ -102,7 +102,7 @@ class PropertySalePage extends HookConsumerWidget {
         ],
       ).onTap((){
         // 去详情
-        _vm.goNewsDetail(item);
+        // _vm.goNewsDetail(item);
       }),
     ).border(color: context.appColors.dividerDefault, bottom: 0.5);
   }

+ 70 - 0
packages/cs_domain/lib/entity/myposts_newsfeed_entity.dart

@@ -0,0 +1,70 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/myposts_newsfeed_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/myposts_newsfeed_entity.g.dart';
+
+@JsonSerializable()
+class MypostsNewsfeedEntity {
+	int? count;
+	int? page;
+	int? limit;
+	@JSONField(name: "count_page")
+	int? countPage;
+	List<MypostsNewsfeedList>? list;
+
+	MypostsNewsfeedEntity();
+
+	factory MypostsNewsfeedEntity.fromJson(Map<String, dynamic> json) => $MypostsNewsfeedEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $MypostsNewsfeedEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class MypostsNewsfeedList {
+	int? id;
+	String? content;
+	List<String>? resources;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+	@JSONField(name: "comments_count")
+	int? commentsCount;
+	bool? liked;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	MypostsNewsfeedListAccount? account;
+
+	MypostsNewsfeedList();
+
+	factory MypostsNewsfeedList.fromJson(Map<String, dynamic> json) => $MypostsNewsfeedListFromJson(json);
+
+	Map<String, dynamic> toJson() => $MypostsNewsfeedListToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class MypostsNewsfeedListAccount {
+	int? id;
+	String? name;
+	String? avatar;
+	bool? followed;
+
+	MypostsNewsfeedListAccount();
+
+	factory MypostsNewsfeedListAccount.fromJson(Map<String, dynamic> json) => $MypostsNewsfeedListAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $MypostsNewsfeedListAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 45 - 14
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -20,6 +20,7 @@ import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
 import 'package:domain/entity/id_name_entity.dart';
 import 'package:domain/entity/myfollowing_list_entity.dart';
+import 'package:domain/entity/myposts_newsfeed_entity.dart';
 import 'package:domain/entity/myposts_sale_rent_entity.dart';
 import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
 import 'package:domain/entity/newsfeed_detail_entity.dart';
@@ -176,37 +177,48 @@ class JsonConvert {
           CaptchaImgEntity.fromJson(e)).toList() as M;
     }
     if (<FacilityBookEntity>[] is M) {
-      return data.map<FacilityBookEntity>((Map<String, dynamic> e) => FacilityBookEntity.fromJson(e)).toList() as M;
+      return data.map<FacilityBookEntity>((Map<String, dynamic> e) =>
+          FacilityBookEntity.fromJson(e)).toList() as M;
     }
     if (<FacilityBookFacilityType>[] is M) {
-      return data.map<FacilityBookFacilityType>((Map<String, dynamic> e) => FacilityBookFacilityType.fromJson(e)).toList() as M;
+      return data.map<FacilityBookFacilityType>((Map<String, dynamic> e) =>
+          FacilityBookFacilityType.fromJson(e)).toList() as M;
     }
     if (<FacilityBookFacilities>[] is M) {
-      return data.map<FacilityBookFacilities>((Map<String, dynamic> e) => FacilityBookFacilities.fromJson(e)).toList() as M;
+      return data.map<FacilityBookFacilities>((Map<String, dynamic> e) =>
+          FacilityBookFacilities.fromJson(e)).toList() as M;
     }
     if (<FacilityBookFacilitiesPeriods>[] is M) {
-      return data.map<FacilityBookFacilitiesPeriods>((Map<String, dynamic> e) => FacilityBookFacilitiesPeriods.fromJson(e)).toList() as M;
+      return data.map<FacilityBookFacilitiesPeriods>((Map<String, dynamic> e) =>
+          FacilityBookFacilitiesPeriods.fromJson(e)).toList() as M;
     }
     if (<FacilityPageEntity>[] is M) {
-      return data.map<FacilityPageEntity>((Map<String, dynamic> e) => FacilityPageEntity.fromJson(e)).toList() as M;
+      return data.map<FacilityPageEntity>((Map<String, dynamic> e) =>
+          FacilityPageEntity.fromJson(e)).toList() as M;
     }
     if (<FacilityPageList>[] is M) {
-      return data.map<FacilityPageList>((Map<String, dynamic> e) => FacilityPageList.fromJson(e)).toList() as M;
+      return data.map<FacilityPageList>((Map<String, dynamic> e) =>
+          FacilityPageList.fromJson(e)).toList() as M;
     }
     if (<FacilityPageListBooking>[] is M) {
-      return data.map<FacilityPageListBooking>((Map<String, dynamic> e) => FacilityPageListBooking.fromJson(e)).toList() as M;
+      return data.map<FacilityPageListBooking>((Map<String, dynamic> e) =>
+          FacilityPageListBooking.fromJson(e)).toList() as M;
     }
     if (<FacilityPageListFacility>[] is M) {
-      return data.map<FacilityPageListFacility>((Map<String, dynamic> e) => FacilityPageListFacility.fromJson(e)).toList() as M;
+      return data.map<FacilityPageListFacility>((Map<String, dynamic> e) =>
+          FacilityPageListFacility.fromJson(e)).toList() as M;
     }
     if (<FacilityPageListFacilityType>[] is M) {
-      return data.map<FacilityPageListFacilityType>((Map<String, dynamic> e) => FacilityPageListFacilityType.fromJson(e)).toList() as M;
+      return data.map<FacilityPageListFacilityType>((Map<String, dynamic> e) =>
+          FacilityPageListFacilityType.fromJson(e)).toList() as M;
     }
     if (<FacilityPageListTimePeriod>[] is M) {
-      return data.map<FacilityPageListTimePeriod>((Map<String, dynamic> e) => FacilityPageListTimePeriod.fromJson(e)).toList() as M;
+      return data.map<FacilityPageListTimePeriod>((Map<String, dynamic> e) =>
+          FacilityPageListTimePeriod.fromJson(e)).toList() as M;
     }
     if (<FacilityPageListAccount>[] is M) {
-      return data.map<FacilityPageListAccount>((Map<String, dynamic> e) => FacilityPageListAccount.fromJson(e)).toList() as M;
+      return data.map<FacilityPageListAccount>((Map<String, dynamic> e) =>
+          FacilityPageListAccount.fromJson(e)).toList() as M;
     }
     if (<FeedbackDetailEntity>[] is M) {
       return data.map<FeedbackDetailEntity>((Map<String, dynamic> e) =>
@@ -276,6 +288,18 @@ class JsonConvert {
       return data.map<MyfollowingListEntity>((Map<String, dynamic> e) =>
           MyfollowingListEntity.fromJson(e)).toList() as M;
     }
+    if (<MypostsNewsfeedEntity>[] is M) {
+      return data.map<MypostsNewsfeedEntity>((Map<String, dynamic> e) =>
+          MypostsNewsfeedEntity.fromJson(e)).toList() as M;
+    }
+    if (<MypostsNewsfeedList>[] is M) {
+      return data.map<MypostsNewsfeedList>((Map<String, dynamic> e) =>
+          MypostsNewsfeedList.fromJson(e)).toList() as M;
+    }
+    if (<MypostsNewsfeedListAccount>[] is M) {
+      return data.map<MypostsNewsfeedListAccount>((Map<String, dynamic> e) =>
+          MypostsNewsfeedListAccount.fromJson(e)).toList() as M;
+    }
     if (<MypostsSaleRentEntity>[] is M) {
       return data.map<MypostsSaleRentEntity>((Map<String, dynamic> e) =>
           MypostsSaleRentEntity.fromJson(e)).toList() as M;
@@ -415,13 +439,16 @@ class JsonConvertClassCollection {
     (FacilityBookEntity).toString(): FacilityBookEntity.fromJson,
     (FacilityBookFacilityType).toString(): FacilityBookFacilityType.fromJson,
     (FacilityBookFacilities).toString(): FacilityBookFacilities.fromJson,
-    (FacilityBookFacilitiesPeriods).toString(): FacilityBookFacilitiesPeriods.fromJson,
+    (FacilityBookFacilitiesPeriods).toString(): FacilityBookFacilitiesPeriods
+        .fromJson,
     (FacilityPageEntity).toString(): FacilityPageEntity.fromJson,
     (FacilityPageList).toString(): FacilityPageList.fromJson,
     (FacilityPageListBooking).toString(): FacilityPageListBooking.fromJson,
     (FacilityPageListFacility).toString(): FacilityPageListFacility.fromJson,
-    (FacilityPageListFacilityType).toString(): FacilityPageListFacilityType.fromJson,
-    (FacilityPageListTimePeriod).toString(): FacilityPageListTimePeriod.fromJson,
+    (FacilityPageListFacilityType).toString(): FacilityPageListFacilityType
+        .fromJson,
+    (FacilityPageListTimePeriod).toString(): FacilityPageListTimePeriod
+        .fromJson,
     (FacilityPageListAccount).toString(): FacilityPageListAccount.fromJson,
     (FeedbackDetailEntity).toString(): FeedbackDetailEntity.fromJson,
     (FeedbackDetailReplies).toString(): FeedbackDetailReplies.fromJson,
@@ -443,6 +470,10 @@ class JsonConvertClassCollection {
     (GarageSaleRentAccount).toString(): GarageSaleRentAccount.fromJson,
     (IdNameEntity).toString(): IdNameEntity.fromJson,
     (MyfollowingListEntity).toString(): MyfollowingListEntity.fromJson,
+    (MypostsNewsfeedEntity).toString(): MypostsNewsfeedEntity.fromJson,
+    (MypostsNewsfeedList).toString(): MypostsNewsfeedList.fromJson,
+    (MypostsNewsfeedListAccount).toString(): MypostsNewsfeedListAccount
+        .fromJson,
     (MypostsSaleRentEntity).toString(): MypostsSaleRentEntity.fromJson,
     (NewsfeedCommentPublishEntity).toString(): NewsfeedCommentPublishEntity
         .fromJson,

+ 31 - 14
packages/cs_domain/lib/generated/json/facility_book_entity.g.dart

@@ -7,16 +7,22 @@ FacilityBookEntity $FacilityBookEntityFromJson(Map<String, dynamic> json) {
   if (remainQuota != null) {
     facilityBookEntity.remainQuota = remainQuota;
   }
-  final String? quotaResetOn = jsonConvert.convert<String>(json['quota_reset_on']);
+  final String? quotaResetOn = jsonConvert.convert<String>(
+      json['quota_reset_on']);
   if (quotaResetOn != null) {
     facilityBookEntity.quotaResetOn = quotaResetOn;
   }
-  final FacilityBookFacilityType? facilityType = jsonConvert.convert<FacilityBookFacilityType>(json['facility_type']);
+  final FacilityBookFacilityType? facilityType = jsonConvert.convert<
+      FacilityBookFacilityType>(json['facility_type']);
   if (facilityType != null) {
     facilityBookEntity.facilityType = facilityType;
   }
-  final List<FacilityBookFacilities>? facilities = (json['facilities'] as List<dynamic>?)?.map(
-          (e) => jsonConvert.convert<FacilityBookFacilities>(e) as FacilityBookFacilities).toList();
+  final List<FacilityBookFacilities>? facilities = (json['facilities'] as List<
+      dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<FacilityBookFacilities>(e) as FacilityBookFacilities)
+      .toList();
   if (facilities != null) {
     facilityBookEntity.facilities = facilities;
   }
@@ -47,9 +53,11 @@ extension FacilityBookEntityExtension on FacilityBookEntity {
   }
 }
 
-FacilityBookFacilityType $FacilityBookFacilityTypeFromJson(Map<String, dynamic> json) {
+FacilityBookFacilityType $FacilityBookFacilityTypeFromJson(
+    Map<String, dynamic> json) {
   final FacilityBookFacilityType facilityBookFacilityType = FacilityBookFacilityType();
-  final int? bookAdvanceDays = jsonConvert.convert<int>(json['book_advance_days']);
+  final int? bookAdvanceDays = jsonConvert.convert<int>(
+      json['book_advance_days']);
   if (bookAdvanceDays != null) {
     facilityBookFacilityType.bookAdvanceDays = bookAdvanceDays;
   }
@@ -57,14 +65,16 @@ FacilityBookFacilityType $FacilityBookFacilityTypeFromJson(Map<String, dynamic>
   if (quota != null) {
     facilityBookFacilityType.quota = quota;
   }
-  final String? quotaResetType = jsonConvert.convert<String>(json['quota_reset_type']);
+  final String? quotaResetType = jsonConvert.convert<String>(
+      json['quota_reset_type']);
   if (quotaResetType != null) {
     facilityBookFacilityType.quotaResetType = quotaResetType;
   }
   return facilityBookFacilityType;
 }
 
-Map<String, dynamic> $FacilityBookFacilityTypeToJson(FacilityBookFacilityType entity) {
+Map<String, dynamic> $FacilityBookFacilityTypeToJson(
+    FacilityBookFacilityType entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['book_advance_days'] = entity.bookAdvanceDays;
   data['quota'] = entity.quota;
@@ -85,7 +95,8 @@ extension FacilityBookFacilityTypeExtension on FacilityBookFacilityType {
   }
 }
 
-FacilityBookFacilities $FacilityBookFacilitiesFromJson(Map<String, dynamic> json) {
+FacilityBookFacilities $FacilityBookFacilitiesFromJson(
+    Map<String, dynamic> json) {
   final FacilityBookFacilities facilityBookFacilities = FacilityBookFacilities();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -95,15 +106,19 @@ FacilityBookFacilities $FacilityBookFacilitiesFromJson(Map<String, dynamic> json
   if (name != null) {
     facilityBookFacilities.name = name;
   }
-  final List<FacilityBookFacilitiesPeriods>? periods = (json['periods'] as List<dynamic>?)?.map(
-          (e) => jsonConvert.convert<FacilityBookFacilitiesPeriods>(e) as FacilityBookFacilitiesPeriods).toList();
+  final List<FacilityBookFacilitiesPeriods>? periods = (json['periods'] as List<
+      dynamic>?)?.map(
+          (e) =>
+      jsonConvert.convert<FacilityBookFacilitiesPeriods>(
+          e) as FacilityBookFacilitiesPeriods).toList();
   if (periods != null) {
     facilityBookFacilities.periods = periods;
   }
   return facilityBookFacilities;
 }
 
-Map<String, dynamic> $FacilityBookFacilitiesToJson(FacilityBookFacilities entity) {
+Map<String, dynamic> $FacilityBookFacilitiesToJson(
+    FacilityBookFacilities entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;
@@ -124,7 +139,8 @@ extension FacilityBookFacilitiesExtension on FacilityBookFacilities {
   }
 }
 
-FacilityBookFacilitiesPeriods $FacilityBookFacilitiesPeriodsFromJson(Map<String, dynamic> json) {
+FacilityBookFacilitiesPeriods $FacilityBookFacilitiesPeriodsFromJson(
+    Map<String, dynamic> json) {
   final FacilityBookFacilitiesPeriods facilityBookFacilitiesPeriods = FacilityBookFacilitiesPeriods();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -157,7 +173,8 @@ FacilityBookFacilitiesPeriods $FacilityBookFacilitiesPeriodsFromJson(Map<String,
   return facilityBookFacilitiesPeriods;
 }
 
-Map<String, dynamic> $FacilityBookFacilitiesPeriodsToJson(FacilityBookFacilitiesPeriods entity) {
+Map<String, dynamic> $FacilityBookFacilitiesPeriodsToJson(
+    FacilityBookFacilitiesPeriods entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['start'] = entity.start;

+ 38 - 19
packages/cs_domain/lib/generated/json/facility_page_entity.g.dart

@@ -19,12 +19,15 @@ FacilityPageEntity $FacilityPageEntityFromJson(Map<String, dynamic> json) {
   if (countPage != null) {
     facilityPageEntity.countPage = countPage;
   }
-  final String? totalDeposit = jsonConvert.convert<String>(json['total_deposit']);
+  final String? totalDeposit = jsonConvert.convert<String>(
+      json['total_deposit']);
   if (totalDeposit != null) {
     facilityPageEntity.totalDeposit = totalDeposit;
   }
-  final List<FacilityPageList>? list = (json['list'] as List<dynamic>?)?.map(
-          (e) => jsonConvert.convert<FacilityPageList>(e) as FacilityPageList).toList();
+  final List<FacilityPageList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) => jsonConvert.convert<FacilityPageList>(e) as FacilityPageList)
+      .toList();
   if (list != null) {
     facilityPageEntity.list = list;
   }
@@ -63,19 +66,23 @@ extension FacilityPageEntityExtension on FacilityPageEntity {
 
 FacilityPageList $FacilityPageListFromJson(Map<String, dynamic> json) {
   final FacilityPageList facilityPageList = FacilityPageList();
-  final FacilityPageListBooking? booking = jsonConvert.convert<FacilityPageListBooking>(json['booking']);
+  final FacilityPageListBooking? booking = jsonConvert.convert<
+      FacilityPageListBooking>(json['booking']);
   if (booking != null) {
     facilityPageList.booking = booking;
   }
-  final FacilityPageListFacility? facility = jsonConvert.convert<FacilityPageListFacility>(json['facility']);
+  final FacilityPageListFacility? facility = jsonConvert.convert<
+      FacilityPageListFacility>(json['facility']);
   if (facility != null) {
     facilityPageList.facility = facility;
   }
-  final FacilityPageListTimePeriod? timePeriod = jsonConvert.convert<FacilityPageListTimePeriod>(json['time_period']);
+  final FacilityPageListTimePeriod? timePeriod = jsonConvert.convert<
+      FacilityPageListTimePeriod>(json['time_period']);
   if (timePeriod != null) {
     facilityPageList.timePeriod = timePeriod;
   }
-  final FacilityPageListAccount? account = jsonConvert.convert<FacilityPageListAccount>(json['account']);
+  final FacilityPageListAccount? account = jsonConvert.convert<
+      FacilityPageListAccount>(json['account']);
   if (account != null) {
     facilityPageList.account = account;
   }
@@ -106,7 +113,8 @@ extension FacilityPageListExtension on FacilityPageList {
   }
 }
 
-FacilityPageListBooking $FacilityPageListBookingFromJson(Map<String, dynamic> json) {
+FacilityPageListBooking $FacilityPageListBookingFromJson(
+    Map<String, dynamic> json) {
   final FacilityPageListBooking facilityPageListBooking = FacilityPageListBooking();
   final String? date = jsonConvert.convert<String>(json['date']);
   if (date != null) {
@@ -124,14 +132,16 @@ FacilityPageListBooking $FacilityPageListBookingFromJson(Map<String, dynamic> js
   if (depositPaid != null) {
     facilityPageListBooking.depositPaid = depositPaid;
   }
-  final String? depositRefund = jsonConvert.convert<String>(json['deposit_refund']);
+  final String? depositRefund = jsonConvert.convert<String>(
+      json['deposit_refund']);
   if (depositRefund != null) {
     facilityPageListBooking.depositRefund = depositRefund;
   }
   return facilityPageListBooking;
 }
 
-Map<String, dynamic> $FacilityPageListBookingToJson(FacilityPageListBooking entity) {
+Map<String, dynamic> $FacilityPageListBookingToJson(
+    FacilityPageListBooking entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['date'] = entity.date;
   data['start'] = entity.start;
@@ -158,7 +168,8 @@ extension FacilityPageListBookingExtension on FacilityPageListBooking {
   }
 }
 
-FacilityPageListFacility $FacilityPageListFacilityFromJson(Map<String, dynamic> json) {
+FacilityPageListFacility $FacilityPageListFacilityFromJson(
+    Map<String, dynamic> json) {
   final FacilityPageListFacility facilityPageListFacility = FacilityPageListFacility();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -168,14 +179,16 @@ FacilityPageListFacility $FacilityPageListFacilityFromJson(Map<String, dynamic>
   if (name != null) {
     facilityPageListFacility.name = name;
   }
-  final FacilityPageListFacilityType? type = jsonConvert.convert<FacilityPageListFacilityType>(json['type']);
+  final FacilityPageListFacilityType? type = jsonConvert.convert<
+      FacilityPageListFacilityType>(json['type']);
   if (type != null) {
     facilityPageListFacility.type = type;
   }
   return facilityPageListFacility;
 }
 
-Map<String, dynamic> $FacilityPageListFacilityToJson(FacilityPageListFacility entity) {
+Map<String, dynamic> $FacilityPageListFacilityToJson(
+    FacilityPageListFacility entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;
@@ -196,7 +209,8 @@ extension FacilityPageListFacilityExtension on FacilityPageListFacility {
   }
 }
 
-FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson(Map<String, dynamic> json) {
+FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson(
+    Map<String, dynamic> json) {
   final FacilityPageListFacilityType facilityPageListFacilityType = FacilityPageListFacilityType();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -209,7 +223,8 @@ FacilityPageListFacilityType $FacilityPageListFacilityTypeFromJson(Map<String, d
   return facilityPageListFacilityType;
 }
 
-Map<String, dynamic> $FacilityPageListFacilityTypeToJson(FacilityPageListFacilityType entity) {
+Map<String, dynamic> $FacilityPageListFacilityTypeToJson(
+    FacilityPageListFacilityType entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;
@@ -227,7 +242,8 @@ extension FacilityPageListFacilityTypeExtension on FacilityPageListFacilityType
   }
 }
 
-FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson(Map<String, dynamic> json) {
+FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson(
+    Map<String, dynamic> json) {
   final FacilityPageListTimePeriod facilityPageListTimePeriod = FacilityPageListTimePeriod();
   final String? price = jsonConvert.convert<String>(json['price']);
   if (price != null) {
@@ -240,7 +256,8 @@ FacilityPageListTimePeriod $FacilityPageListTimePeriodFromJson(Map<String, dynam
   return facilityPageListTimePeriod;
 }
 
-Map<String, dynamic> $FacilityPageListTimePeriodToJson(FacilityPageListTimePeriod entity) {
+Map<String, dynamic> $FacilityPageListTimePeriodToJson(
+    FacilityPageListTimePeriod entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['price'] = entity.price;
   data['deposit'] = entity.deposit;
@@ -258,7 +275,8 @@ extension FacilityPageListTimePeriodExtension on FacilityPageListTimePeriod {
   }
 }
 
-FacilityPageListAccount $FacilityPageListAccountFromJson(Map<String, dynamic> json) {
+FacilityPageListAccount $FacilityPageListAccountFromJson(
+    Map<String, dynamic> json) {
   final FacilityPageListAccount facilityPageListAccount = FacilityPageListAccount();
   final String? id = jsonConvert.convert<String>(json['id']);
   if (id != null) {
@@ -271,7 +289,8 @@ FacilityPageListAccount $FacilityPageListAccountFromJson(Map<String, dynamic> js
   return facilityPageListAccount;
 }
 
-Map<String, dynamic> $FacilityPageListAccountToJson(FacilityPageListAccount entity) {
+Map<String, dynamic> $FacilityPageListAccountToJson(
+    FacilityPageListAccount entity) {
   final Map<String, dynamic> data = <String, dynamic>{};
   data['id'] = entity.id;
   data['name'] = entity.name;

+ 182 - 0
packages/cs_domain/lib/generated/json/myposts_newsfeed_entity.g.dart

@@ -0,0 +1,182 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/myposts_newsfeed_entity.dart';
+
+MypostsNewsfeedEntity $MypostsNewsfeedEntityFromJson(
+    Map<String, dynamic> json) {
+  final MypostsNewsfeedEntity mypostsNewsfeedEntity = MypostsNewsfeedEntity();
+  final int? count = jsonConvert.convert<int>(json['count']);
+  if (count != null) {
+    mypostsNewsfeedEntity.count = count;
+  }
+  final int? page = jsonConvert.convert<int>(json['page']);
+  if (page != null) {
+    mypostsNewsfeedEntity.page = page;
+  }
+  final int? limit = jsonConvert.convert<int>(json['limit']);
+  if (limit != null) {
+    mypostsNewsfeedEntity.limit = limit;
+  }
+  final int? countPage = jsonConvert.convert<int>(json['count_page']);
+  if (countPage != null) {
+    mypostsNewsfeedEntity.countPage = countPage;
+  }
+  final List<MypostsNewsfeedList>? list = (json['list'] as List<dynamic>?)
+      ?.map(
+          (e) =>
+      jsonConvert.convert<MypostsNewsfeedList>(e) as MypostsNewsfeedList)
+      .toList();
+  if (list != null) {
+    mypostsNewsfeedEntity.list = list;
+  }
+  return mypostsNewsfeedEntity;
+}
+
+Map<String, dynamic> $MypostsNewsfeedEntityToJson(
+    MypostsNewsfeedEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['count'] = entity.count;
+  data['page'] = entity.page;
+  data['limit'] = entity.limit;
+  data['count_page'] = entity.countPage;
+  data['list'] = entity.list?.map((v) => v.toJson()).toList();
+  return data;
+}
+
+extension MypostsNewsfeedEntityExtension on MypostsNewsfeedEntity {
+  MypostsNewsfeedEntity copyWith({
+    int? count,
+    int? page,
+    int? limit,
+    int? countPage,
+    List<MypostsNewsfeedList>? list,
+  }) {
+    return MypostsNewsfeedEntity()
+      ..count = count ?? this.count
+      ..page = page ?? this.page
+      ..limit = limit ?? this.limit
+      ..countPage = countPage ?? this.countPage
+      ..list = list ?? this.list;
+  }
+}
+
+MypostsNewsfeedList $MypostsNewsfeedListFromJson(Map<String, dynamic> json) {
+  final MypostsNewsfeedList mypostsNewsfeedList = MypostsNewsfeedList();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    mypostsNewsfeedList.id = id;
+  }
+  final String? content = jsonConvert.convert<String>(json['content']);
+  if (content != null) {
+    mypostsNewsfeedList.content = content;
+  }
+  final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (resources != null) {
+    mypostsNewsfeedList.resources = resources;
+  }
+  final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
+  if (likesCount != null) {
+    mypostsNewsfeedList.likesCount = likesCount;
+  }
+  final int? commentsCount = jsonConvert.convert<int>(json['comments_count']);
+  if (commentsCount != null) {
+    mypostsNewsfeedList.commentsCount = commentsCount;
+  }
+  final bool? liked = jsonConvert.convert<bool>(json['liked']);
+  if (liked != null) {
+    mypostsNewsfeedList.liked = liked;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    mypostsNewsfeedList.createdAt = createdAt;
+  }
+  final MypostsNewsfeedListAccount? account = jsonConvert.convert<
+      MypostsNewsfeedListAccount>(json['account']);
+  if (account != null) {
+    mypostsNewsfeedList.account = account;
+  }
+  return mypostsNewsfeedList;
+}
+
+Map<String, dynamic> $MypostsNewsfeedListToJson(MypostsNewsfeedList entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['content'] = entity.content;
+  data['resources'] = entity.resources;
+  data['likes_count'] = entity.likesCount;
+  data['comments_count'] = entity.commentsCount;
+  data['liked'] = entity.liked;
+  data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  return data;
+}
+
+extension MypostsNewsfeedListExtension on MypostsNewsfeedList {
+  MypostsNewsfeedList copyWith({
+    int? id,
+    String? content,
+    List<String>? resources,
+    int? likesCount,
+    int? commentsCount,
+    bool? liked,
+    String? createdAt,
+    MypostsNewsfeedListAccount? account,
+  }) {
+    return MypostsNewsfeedList()
+      ..id = id ?? this.id
+      ..content = content ?? this.content
+      ..resources = resources ?? this.resources
+      ..likesCount = likesCount ?? this.likesCount
+      ..commentsCount = commentsCount ?? this.commentsCount
+      ..liked = liked ?? this.liked
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account;
+  }
+}
+
+MypostsNewsfeedListAccount $MypostsNewsfeedListAccountFromJson(
+    Map<String, dynamic> json) {
+  final MypostsNewsfeedListAccount mypostsNewsfeedListAccount = MypostsNewsfeedListAccount();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    mypostsNewsfeedListAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    mypostsNewsfeedListAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    mypostsNewsfeedListAccount.avatar = avatar;
+  }
+  final bool? followed = jsonConvert.convert<bool>(json['followed']);
+  if (followed != null) {
+    mypostsNewsfeedListAccount.followed = followed;
+  }
+  return mypostsNewsfeedListAccount;
+}
+
+Map<String, dynamic> $MypostsNewsfeedListAccountToJson(
+    MypostsNewsfeedListAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  data['followed'] = entity.followed;
+  return data;
+}
+
+extension MypostsNewsfeedListAccountExtension on MypostsNewsfeedListAccount {
+  MypostsNewsfeedListAccount copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+    bool? followed,
+  }) {
+    return MypostsNewsfeedListAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar
+      ..followed = followed ?? this.followed;
+  }
+}