Browse Source

update community

glglove 2 months ago
parent
commit
22baab12fa
92 changed files with 2218 additions and 2023 deletions
  1. 2 5
      packages/cpt_community/lib/components/garage_card.dart
  2. 5 1
      packages/cpt_community/lib/components/newsfeed_card_content.dart
  3. 22 5
      packages/cpt_community/lib/modules/community/community_vm.dart
  4. 1 1
      packages/cpt_community/lib/modules/community/community_vm.g.dart
  5. 2 1
      packages/cpt_community/lib/modules/community/following/following_page.dart
  6. 64 42
      packages/cpt_community/lib/modules/community/following/following_vm.dart
  7. 1 1
      packages/cpt_community/lib/modules/community/following/following_vm.g.dart
  8. 2 1
      packages/cpt_community/lib/modules/community/foryou/foryou_page.dart
  9. 65 42
      packages/cpt_community/lib/modules/community/foryou/foryou_vm.dart
  10. 1 1
      packages/cpt_community/lib/modules/community/foryou/foryou_vm.g.dart
  11. 43 29
      packages/cpt_community/lib/modules/community/news/news_page.dart
  12. 32 24
      packages/cpt_community/lib/modules/community/news/news_vm.dart
  13. 1 1
      packages/cpt_community/lib/modules/community/news/news_vm.g.dart
  14. 2 0
      packages/cpt_community/lib/modules/community/newsfeed_detail/comments_input.dart
  15. 171 126
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_page.dart
  16. 171 32
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.dart
  17. 1 1
      packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.g.dart
  18. 3 3
      packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_vm.dart
  19. 1 1
      packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_vm.g.dart
  20. 4 4
      packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.dart
  21. 1 1
      packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.g.dart
  22. 4 4
      packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.dart
  23. 1 1
      packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.g.dart
  24. 47 22
      packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_page.dart
  25. 3 2
      packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_state.dart
  26. 36 4
      packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.dart
  27. 1 1
      packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.g.dart
  28. 3 3
      packages/cpt_community/lib/modules/garage/garagesale_post/garagesale_post_vm.dart
  29. 1 1
      packages/cpt_community/lib/modules/garage/garagesale_post/garagesale_post_vm.g.dart
  30. 27 20
      packages/cpt_community/lib/modules/my_following/components/item_following.dart
  31. 54 0
      packages/cpt_community/lib/modules/my_following/components/item_following_vm.dart
  32. 10 13
      packages/cpt_community/lib/respository/garage_forrent.g.dart
  33. 3 2
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_page.dart
  34. 0 9
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_state.dart
  35. 101 72
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.dart
  36. 1 1
      packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.g.dart
  37. 2 1
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_page.dart
  38. 0 6
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_state.dart
  39. 94 74
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.dart
  40. 1 1
      packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.g.dart
  41. 4 2
      packages/cpt_community/lib/modules/my_following/my_following_state.dart
  42. 6 3
      packages/cpt_community/lib/modules/my_following/my_following_vm.dart
  43. 1 1
      packages/cpt_community/lib/modules/my_following/my_following_vm.g.dart
  44. 4 0
      packages/cpt_community/lib/modules/my_following/tabs_data.dart
  45. 59 0
      packages/cpt_community/lib/modules/my_posts/components/my_posts_sale_rent_item.dart
  46. 37 0
      packages/cpt_community/lib/modules/my_posts/components/my_posts_sale_rent_item_vm.dart
  47. 11 13
      packages/cpt_property/lib/modules/ioan/property_ioan_repository.g.dart
  48. 4 41
      packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_page.dart
  49. 134 117
      packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.dart
  50. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.g.dart
  51. 3 40
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_page.dart
  52. 0 18
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_state.dart
  53. 166 149
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.dart
  54. 1 1
      packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.g.dart
  55. 66 5
      packages/cpt_community/lib/respository/common_garage.dart
  56. 10 10
      packages/cpt_community/lib/respository/common_garage.g.dart
  57. 291 11
      packages/cpt_community/lib/respository/common_newsfeed.dart
  58. 10 10
      packages/cpt_community/lib/respository/common_newsfeed.g.dart
  59. 0 99
      packages/cpt_community/lib/respository/garage_forrent.dart
  60. 0 99
      packages/cpt_community/lib/respository/garage_forsale.dart
  61. 0 29
      packages/cpt_community/lib/respository/garage_forsale.g.dart
  62. 0 99
      packages/cpt_community/lib/respository/newsfeed_detail_repository.dart
  63. 0 29
      packages/cpt_community/lib/respository/newsfeed_detail_repository.g.dart
  64. 0 99
      packages/cpt_community/lib/respository/newsfeed_following_repository.dart
  65. 0 30
      packages/cpt_community/lib/respository/newsfeed_following_repository.g.dart
  66. 0 99
      packages/cpt_community/lib/respository/newsfeed_foryou_repository.dart
  67. 0 29
      packages/cpt_community/lib/respository/newsfeed_foryou_repository.g.dart
  68. 0 98
      packages/cpt_community/lib/respository/newsfeed_news_repository.dart
  69. 0 65
      packages/cpt_community/lib/respository/newsfeed_publish_repository.dart
  70. 0 29
      packages/cpt_community/lib/respository/newsfeed_publish_repository.g.dart
  71. 4 4
      packages/cpt_community/lib/router/page/community_page_router.gr.dart
  72. 0 71
      packages/cpt_property/lib/modules/ioan/property_ioan_repository.dart
  73. 1 1
      packages/cpt_property/lib/modules/ioan/property_ioan_vm.g.dart
  74. 0 29
      packages/cpt_property/lib/modules/news/repository/property_news_repository.g.dart
  75. 5 5
      packages/cpt_property/lib/modules/news/vm/property_news_vm.dart
  76. 1 1
      packages/cpt_property/lib/modules/news/vm/property_news_vm.g.dart
  77. 1 1
      packages/cpt_property/lib/modules/rent/page/property_rent_page.dart
  78. 4 4
      packages/cpt_property/lib/modules/rent/vm/property_rent_vm.dart
  79. 1 1
      packages/cpt_property/lib/modules/rent/vm/property_rent_vm.g.dart
  80. 0 69
      packages/cpt_property/lib/modules/sale/repository/property_sale_repository.dart
  81. 0 29
      packages/cpt_property/lib/modules/sale/repository/property_sale_repository.g.dart
  82. 4 4
      packages/cpt_property/lib/modules/sale/vm/property_sale_vm.dart
  83. 1 1
      packages/cpt_property/lib/modules/sale/vm/property_sale_vm.g.dart
  84. 57 7
      packages/cpt_property/lib/modules/news/repository/property_news_repository.dart
  85. 10 11
      packages/cpt_community/lib/respository/newsfeed_news_repository.g.dart
  86. 45 0
      packages/cs_domain/lib/entity/garage_sale_rent_detail_entity.dart
  87. 22 0
      packages/cs_domain/lib/entity/myfollowing_list_entity.dart
  88. 27 0
      packages/cs_domain/lib/entity/myposts_sale_rent_entity.dart
  89. 25 0
      packages/cs_domain/lib/generated/json/base/json_convert_content.dart
  90. 112 0
      packages/cs_domain/lib/generated/json/garage_sale_rent_detail_entity.g.dart
  91. 42 0
      packages/cs_domain/lib/generated/json/myfollowing_list_entity.g.dart
  92. 64 0
      packages/cs_domain/lib/generated/json/myposts_sale_rent_entity.g.dart

+ 2 - 5
packages/cpt_community/lib/components/garage_card.dart

@@ -61,11 +61,8 @@ class GarageCard extends StatelessWidget {
     Map<String, dynamic>? card_account = itemObj.getValue<Map<String,dynamic>>("account", null);
     String card_avator = card_account?['avator']?? "";
     String card_publish_name = card_account?['name']?? "";
-    // bool card_followed = card_account?['followed']??false;
-    // String card_content = itemObj.getValue("content", "");
     bool card_liked = itemObj.getValue("liked", false);
     int card_likes_count = itemObj.getValue("likes_count", 0);
-    // int card_comments_count = itemObj.getValue("comments_count", 0);
     return Column(
       children: [
         // 图片
@@ -137,8 +134,8 @@ class GarageCard extends StatelessWidget {
             ],
           ),
         ),
-        // 发布人信息
-        Expanded(
+          // 发布人信息
+          Expanded(
           child: Padding(
             padding: EdgeInsets.only(left: (useType == GarageCardUseType.forSale || useType == GarageCardUseType.forRent)?10:0, right: 10),
             child: Row(

+ 5 - 1
packages/cpt_community/lib/components/newsfeed_card_content.dart

@@ -1,3 +1,5 @@
+import 'dart:math';
+
 import 'package:auto_route/src/route/page_route_info.dart';
 import 'package:cpt_community/components/comments_dialog.dart';
 import 'package:cpt_community/modules/community/community_page.dart';
@@ -6,6 +8,7 @@ import 'package:flutter/material.dart';
 import 'package:flutter/widgets.dart';
 import 'package:plugin_basic/modules/global_web_page.dart';
 import 'package:plugin_basic/modules/preview_photo_page.dart';
+import 'package:plugin_basic/router/basic_page_router.dart';
 import 'package:router/componentRouter/component_service_manager.dart';
 import 'package:router/ext/auto_router_extensions.dart';
 import 'package:shared/utils/color_utils.dart';
@@ -119,7 +122,8 @@ class NewsFeedCardContent extends StatelessWidget {
                             // 点击图片预览
                             // 过滤掉非字符串类型的元素
                             List<String> filteredImages = totalImageUrls?.whereType<String>().toList() ?? [];
-                            PreviewPhotoPage.startInstance(context: context, images: filteredImages, position: index);
+                            // PreviewPhotoPage.startInstance(context: context, images: filteredImages, position: index);
+                            context.appRouter.push(PreviewPhotoPageRoute(images: filteredImages, position: index));
                           }
                         },
                       ),

+ 22 - 5
packages/cpt_community/lib/modules/community/community_vm.dart

@@ -36,8 +36,8 @@ part 'community_vm.g.dart';
 @riverpod
 class CommunityVm extends _$CommunityVm {
   get topSectionsData => state.topSectionsData;
-  late CommonNewsFeedRepository commonNewsFeedRepositoryInstance;
-  late CommonGarageRepository commonGarageRepositoryInstance;
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
 
   final Map<int, dynamic> providerMap = {};
 
@@ -67,8 +67,8 @@ class CommunityVm extends _$CommunityVm {
   @override
   CommunityVmState build(){
     // 引入数据仓库
-    commonNewsFeedRepositoryInstance = ref.read(commonNewsFeedRepositoryProvider);
-    commonGarageRepositoryInstance = ref.read(commonGarageRepositoryProvider);
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     // 第一帧渲染完成
     WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
@@ -164,7 +164,7 @@ class CommunityVm extends _$CommunityVm {
   // 获取garage sale 分类选项
   Future getGarageSaleCategoryOptions() async{
     final Map<String, dynamic> params = {};
-    final result = await commonGarageRepositoryInstance.fetchGarageCateGoryList(params);
+    final result = await commonGarageRespositoryInstance.fetchGarageCateGoryList(params);
     return result;
   }
   // 选择 garage sale 导航栏点击 选择分类
@@ -304,5 +304,22 @@ class CommunityVm extends _$CommunityVm {
     });
     GaragesalePostPage.startInstance(type: type);
   }
+
+  // 点击了 卡片上的 关注按钮
+  Future<bool> commonClickCardFollowBtn(BuildContext? context,int to_user_id,bool isFollowed, int? idx) async{
+    try{
+      Map<String, dynamic> params = {
+        "to_user_id": to_user_id
+      };
+      final result = await commonNewsFeedRespositoryInstance.handlerFollowOrCancel(params);
+      if(result.isSuccess){
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      return false;
+    }
+  }
 }
 

+ 1 - 1
packages/cpt_community/lib/modules/community/community_vm.g.dart

@@ -6,7 +6,7 @@ part of 'community_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$communityVmHash() => r'aec72511842beac895e537c5837c247a88c31049';
+String _$communityVmHash() => r'ad31041e0609827cdf51a497e69f71ab48355fbc';
 
 /// See also [CommunityVm].
 @ProviderFor(CommunityVm)

+ 2 - 1
packages/cpt_community/lib/modules/community/following/following_page.dart

@@ -101,6 +101,7 @@ class FollowingPage extends HookConsumerWidget {
     String card_created_at = item.getValue("created_at", "");
     Map<String, dynamic>? card_account = item.getValue<Map<String,dynamic>>("account", {});
     String card_avator = card_account?['avator']?? "";
+    String card_count_name = card_account?['name']?? "";
     bool card_followed = card_account?['followed']??false;
     String card_content = item.getValue("content", "");
     List? card_resources = item.getValue<List>("resources", [])?? [];
@@ -132,7 +133,7 @@ class FollowingPage extends HookConsumerWidget {
                 Container(
                   child: NewsFeedCardHeader(
                     key: UniqueKey(),
-                    title: card_title,
+                    title: card_count_name,
                     avator: card_avator,
                     time: card_created_at,
                   ),

+ 64 - 42
packages/cpt_community/lib/modules/community/following/following_vm.dart

@@ -1,4 +1,3 @@
-import 'package:cpt_community/respository/newsfeed_following_repository.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:domain/entity/newsfeed_following_entity.dart';
 import 'package:flutter/cupertino.dart';
@@ -10,6 +9,7 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../../respository/common_newsfeed.dart';
 import '../../../router/page/community_page_router.dart';
 import '../community_pageview_idx_data.dart';
 import '../community_vm.dart';
@@ -19,7 +19,7 @@ part 'following_vm.g.dart';
 
 @riverpod
 class FollowingVm extends _$FollowingVm {
-  late NewsFeedFollowingRepository repositoryInstance;
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
   int _count = 0; // 总条数
@@ -40,7 +40,7 @@ class FollowingVm extends _$FollowingVm {
   @override
   FollowingState build(){
     // 引入数据仓库
-    repositoryInstance = ref.read(newsFeedFollowingRepositoryProvider);
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
     Log.d("---------------following-----------build---------------------");
 
@@ -124,7 +124,7 @@ class FollowingVm extends _$FollowingVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await repositoryInstance.fetchFollowingList(params);
+      final result = await commonNewsFeedRespositoryInstance.fetchFollowingList(params);
       //校验成功失败
       if (result.isSuccess) {
         handlerResultList((result.data  as NewsfeedFollowingEntity).list);
@@ -181,32 +181,47 @@ class FollowingVm extends _$FollowingVm {
   }
 
   // 点赞/取消点赞
-  Future handlerLikeClick(int id, bool isLike, int itemidx) async {
+  Future handlerLikeClick(int id, bool isLike, int? itemidx) async {
     try {
-      final result = await repositoryInstance.fetchLikeClick({
+      List<Map<String, dynamic>> listCopyDta =  List.from(state.list!);
+      final result = await commonNewsFeedRespositoryInstance.fetchLikeClick({
         "id": id,
       });
       if (result.isSuccess) {
-        //重新赋值data或list
-        // final json = result.getDataJson();
-        // var data = NewsfeedNewsEntity.fromJson(json!);
-        //重新赋值data或list
-        // state.list![id].liked = data.list![0].liked;
-        // state.list![id].likeno = data.list![0].likeno;
-        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
-        ToastEngine.show(toastMsg);
-        // 修改 state.list[itemIdx] 中的 like 状态 和 likes_count
-        state.list![itemidx]['liked'] = !isLike;
-        if(isLike){
-          // 取消点赞
-          if(state.list![itemidx]['likes_count']>0){
-            state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] - 1;
+        if(itemidx != null){
+          // 修改 listCopyDta[itemIdx] 中的 like 状态 和 likes_count
+          listCopyDta![itemidx]['liked'] = !isLike;
+
+          if(isLike){
+            // 取消点赞
+            if(listCopyDta![itemidx]['likes_count']>0){
+              listCopyDta![itemidx]['likes_count'] = listCopyDta![itemidx]['likes_count'] - 1;
+            }
+          }else {
+            listCopyDta![itemidx]['likes_count'] = listCopyDta![itemidx]['likes_count'] + 1;
           }
         }else {
-          state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] + 1;
+          // 详情中的点赞 需要找到对应的 item 进行 修改 like 和 likes_count
+          listCopyDta!.forEach((carditem) {
+            if(carditem['id'] == id){
+              carditem['liked'] = !isLike;
+              if(isLike){
+                // 取消点赞
+                if(carditem['likes_count']>0){
+                  carditem['likes_count'] = carditem['likes_count'] - 1;
+                }
+              }else {
+                carditem['likes_count'] = carditem['likes_count'] + 1;
+              }
+            }
+          });
         }
-        //重新赋值data或list
-        changeLoadingState(LoadState.State_Success, null);
+
+        state = state.copyWith(list: listCopyDta);
+
+        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
+        ToastEngine.show(toastMsg);
+
         return true;
       }else {
         return false;
@@ -237,27 +252,34 @@ class FollowingVm extends _$FollowingVm {
         break;
     }
   }
-  Future handlerFollow(BuildContext context, bool isFollow) async{
+  // 关注/取消关注
+  Future<bool> handlerFollow(BuildContext? context, int to_user_id,int cardId, bool isFollow) async{
     Log.d("点击了 关注");
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await repositoryInstance.fetchNewsList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     handlerResultList((result.data  as NewsfeedNewsEntity).list);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
+    try {
+      final result = await commonNewsFeedRespositoryInstance.handlerFollowOrCancel({
+        "to_user_id": to_user_id,
+      });
+      if(result.isSuccess){
+        // 修改cardId 对应的 card item 的 account 里面的 followed
+        if(cardId!=null){
+          final listCopyDta = List<Map<String, dynamic>>.from(state.list!);
+          listCopyDta!.forEach((carditem) {
+            if(carditem['id'] == cardId){
+              carditem['account']['followed'] = !carditem['account']['followed'];
+            }
+          });
+          state = state.copyWith(list: listCopyDta);
+        }
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      Log.d("error: $error");
+      return false;
+    }
   }
+
   // 去详情页面
   void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");

+ 1 - 1
packages/cpt_community/lib/modules/community/following/following_vm.g.dart

@@ -6,7 +6,7 @@ part of 'following_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$followingVmHash() => r'767da5b6bbc17cb3cc17511b4e812f52352f6f3a';
+String _$followingVmHash() => r'a8a3de76398c9469283ba056d29fb15ff314b280';
 
 /// See also [FollowingVm].
 @ProviderFor(FollowingVm)

+ 2 - 1
packages/cpt_community/lib/modules/community/foryou/foryou_page.dart

@@ -101,6 +101,7 @@ class ForyouPage extends HookConsumerWidget {
     String card_created_at = item.getValue("created_at", "");
     Map<String, dynamic>? card_account = item.getValue<Map<String,dynamic>>("account", {});
     String card_avator = card_account?['avator']?? "";
+    String card_count_name = card_account?['name']?? "";
     bool card_followed = card_account?['followed']??false;
     String card_content = item.getValue("content", "");
     List? card_resources = item.getValue<List>("resources", [])?? [];
@@ -132,7 +133,7 @@ class ForyouPage extends HookConsumerWidget {
                 Container(
                   child: NewsFeedCardHeader(
                     key: UniqueKey(),
-                    title: card_title,
+                    title: card_count_name,
                     avator: card_avator,
                     time: card_created_at,
                   ),

+ 65 - 42
packages/cpt_community/lib/modules/community/foryou/foryou_vm.dart

@@ -9,7 +9,7 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
-import '../../../respository/newsfeed_foryou_repository.dart';
+import '../../../respository/common_newsfeed.dart';
 import '../../../router/page/community_page_router.dart';
 import '../community_pageview_idx_data.dart';
 import '../community_vm.dart';
@@ -20,7 +20,7 @@ part 'foryou_vm.g.dart';
 
 @riverpod
 class ForyouVm extends _$ForyouVm {
-  late NewsFeedForyouRepository repositoryInstance;
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
@@ -41,7 +41,7 @@ class ForyouVm extends _$ForyouVm {
   @override
   ForyouState build(){
     // 引入数据仓库
-    repositoryInstance = ref.read(newsFeedForyouRepositoryProvider);
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -246,7 +246,7 @@ class ForyouVm extends _$ForyouVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await repositoryInstance.fetchForyouList(params);
+      final result = await commonNewsFeedRespositoryInstance.fetchForyouList(params);
       //校验成功失败
       if (result.isSuccess) {
         handlerResultList((result.data  as NewsfeedForyouEntity).list);
@@ -301,32 +301,47 @@ class ForyouVm extends _$ForyouVm {
   }
 
   // 点赞/取消点赞
-  Future handlerLikeClick(int id, bool isLike, int itemidx) async {
+  Future handlerLikeClick(int id, bool isLike, int? itemidx) async {
     try {
-      final result = await repositoryInstance.fetchLikeClick({
+      List<Map<String, dynamic>> listCopyDta =  List.from(state.list!);
+      final result = await commonNewsFeedRespositoryInstance.fetchLikeClick({
         "id": id,
       });
       if (result.isSuccess) {
-        //重新赋值data或list
-        // final json = result.getDataJson();
-        // var data = NewsfeedNewsEntity.fromJson(json!);
-        //重新赋值data或list
-        // state.list![id].liked = data.list![0].liked;
-        // state.list![id].likeno = data.list![0].likeno;
-        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
-        ToastEngine.show(toastMsg);
-        // 修改 state.list[itemIdx] 中的 like 状态 和 likes_count
-        state.list![itemidx]['liked'] = !isLike;
-        if(isLike){
-          // 取消点赞
-          if(state.list![itemidx]['likes_count']>0){
-            state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] - 1;
+        if(itemidx != null){
+          // 修改 listCopyDta[itemIdx] 中的 like 状态 和 likes_count
+          listCopyDta![itemidx]['liked'] = !isLike;
+
+          if(isLike){
+            // 取消点赞
+            if(listCopyDta![itemidx]['likes_count']>0){
+              listCopyDta![itemidx]['likes_count'] = listCopyDta![itemidx]['likes_count'] - 1;
+            }
+          }else {
+            listCopyDta![itemidx]['likes_count'] = listCopyDta![itemidx]['likes_count'] + 1;
           }
         }else {
-          state.list![itemidx]['likes_count'] = state.list![itemidx]['likes_count'] + 1;
+          // 详情中的点赞 需要找到对应的 item 进行 修改 like 和 likes_count
+          listCopyDta!.forEach((carditem) {
+            if(carditem['id'] == id){
+              carditem['liked'] = !isLike;
+              if(isLike){
+                // 取消点赞
+                if(carditem['likes_count']>0){
+                  carditem['likes_count'] = carditem['likes_count'] - 1;
+                }
+              }else {
+                carditem['likes_count'] = carditem['likes_count'] + 1;
+              }
+            }
+          });
         }
-        //重新赋值data或list
-        changeLoadingState(LoadState.State_Success, null);
+
+        state = state.copyWith(list: listCopyDta);
+
+        final String toastMsg = isLike ? "Cancel successfully": "Liked successfully";
+        ToastEngine.show(toastMsg);
+
         return true;
       }else {
         return false;
@@ -357,27 +372,35 @@ class ForyouVm extends _$ForyouVm {
         break;
     }
   }
-  Future handlerFollow(BuildContext context, bool isFollow) async{
+
+  // 关注/取消关注
+  Future<bool> handlerFollow(BuildContext? context, int to_user_id,int cardId, bool isFollow) async{
     Log.d("点击了 关注");
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await repositoryInstance.fetchNewsList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     handlerResultList((result.data  as NewsfeedNewsEntity).list);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
+    try {
+      final result = await commonNewsFeedRespositoryInstance.handlerFollowOrCancel({
+        "to_user_id": to_user_id,
+      });
+      if(result.isSuccess){
+        // 修改cardId 对应的 card item 的 account 里面的 followed
+        if(cardId!=null){
+          final listCopyDta = List<Map<String, dynamic>>.from(state.list!);
+          listCopyDta!.forEach((carditem) {
+            if(carditem['id'] == cardId){
+              carditem['account']['followed'] = !carditem['account']['followed'];
+            }
+          });
+          state = state.copyWith(list: listCopyDta);
+        }
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      Log.d("error: $error");
+      return false;
+    }
   }
+
   // 去详情页面
   void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");

+ 1 - 1
packages/cpt_community/lib/modules/community/foryou/foryou_vm.g.dart

@@ -6,7 +6,7 @@ part of 'foryou_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$foryouVmHash() => r'59a05b8a1bc27762c47eee720bfd47a7806478fe';
+String _$foryouVmHash() => r'e80b452f3614a1872c18adb1a315443982185738';
 
 /// See also [ForyouVm].
 @ProviderFor(ForyouVm)

+ 43 - 29
packages/cpt_community/lib/modules/community/news/news_page.dart

@@ -42,6 +42,7 @@ class NewsPage extends HookConsumerWidget {
   Widget build(BuildContext context, WidgetRef ref) {
     final vm = ref.read(newsVmProvider.notifier);
     final state = ref.watch(newsVmProvider);
+
     useEffect((){
       // 组件挂载时执行 - 执行接口请求
       Future.microtask(() => vm.initPageData());
@@ -98,15 +99,20 @@ class NewsPage extends HookConsumerWidget {
 
   Widget _buildNewsItem(BuildContext context, WidgetRef ref, Map<String, dynamic> item, vm, int itemIdx){
     String card_title = item.getValue("title", "");
+    int card_id = item.getValue("id", null);
     String card_created_at = item.getValue("created_at", "");
     Map<String, dynamic>? card_account = item.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 = item.getValue("content", "");
     List? card_resources = item.getValue<List>("resources", [])?? [];
     bool card_liked = item.getValue("liked", false);
     int card_likes_count = item.getValue("likes_count", 0);
     int card_comments_count = item.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),
@@ -132,7 +138,7 @@ class NewsPage extends HookConsumerWidget {
                   Container(
                     child: NewsFeedCardHeader(
                       key: UniqueKey(),
-                      title: card_title,
+                      title: card_count_name,
                       avator: card_avator,
                       time: card_created_at,
                     ),
@@ -173,34 +179,42 @@ class NewsPage extends HookConsumerWidget {
                 ]
             ),
             // 右上角 关注/取消关注 按钮
-            Visibility(
-              visible: card_followed ? false: true,
-              child: Positioned(
-                  right: 10,
-                  top: -5,
-                  child: Container(
-                    width: 83.5,
-                    height: 45.5,
-                    alignment: Alignment.center,
-                    // decoration: BoxDecoration(
-                    //   color:  ColorUtils.string2Color('#4161D0'),
-                    //   borderRadius: BorderRadius.circular(5),
-                    // ),
-                    child: MyButton(
-                      text: '+Follow',
-                      textColor: Colors.white,
-                      backgroundColor: ColorUtils.string2Color('#4161D0'),
-                      radius: 8,
-                      minHeight: 27.5,
-                      padding: const EdgeInsets.only(left: 5, right: 5,top:9,bottom:9),
-                      fontWeight: FontWeight.w400,
-                      fontSize: 14,
-                      onPressed: (){
-                        vm.handlerFollow(context, card_followed);
-                      },
-                    ),
-                  )
-              ),
+            Positioned(
+                right: 10,
+                top: -5,
+                child: Container(
+                  width: 83.5,
+                  height: 50.5,
+                  alignment: Alignment.center,
+                  // decoration: BoxDecoration(
+                  //   color:  ColorUtils.string2Color('#4161D0'),
+                  //   borderRadius: BorderRadius.circular(5),
+                  // ),
+                  child: HookBuilder(
+                    builder: (context) {
+                      final isFollowedState = useState<bool>(card_followed);
+                      return MyButton(
+                        text: isFollowedState.value ? 'Followed': '+Follow',
+                        textColor: isFollowedState.value ?  context.appColors.disEnableGray: context.appColors.textWhite,
+                        disabledTextColor: context.appColors.disEnableGray,
+                        backgroundColor: isFollowedState.value ? Colors.transparent : ColorUtils.string2Color('#4161D0'),
+                        side: BorderSide(color: !isFollowedState.value ? Colors.transparent : context.appColors.disEnableGray, width: 0.5),
+                        radius: 8,
+                        minHeight: 27.5,
+                        padding: const EdgeInsets.only(left: 5, right: 5,top:9,bottom:9),
+                        fontWeight: FontWeight.w400,
+                        fontSize: 14,
+                        onPressed: () async{
+                          bool asyncResult = await vm.handlerFollow(context,card_count_id, card_id,  isFollowedState.value );
+                          if(asyncResult){
+                            // 成功  关注->取消关注  取消关注->关注
+                            isFollowedState.value = !isFollowedState.value;
+                          }
+                        },
+                      );
+                    }
+                  ),
+                )
             )
           ],
         ),

+ 32 - 24
packages/cpt_community/lib/modules/community/news/news_vm.dart

@@ -1,3 +1,4 @@
+import 'package:cpt_community/respository/common_newsfeed.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:flutter/cupertino.dart';
@@ -9,7 +10,6 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
-import '../../../respository/newsfeed_news_repository.dart';
 import '../../../router/page/community_page_router.dart';
 import '../community_pageview_idx_data.dart';
 import '../community_vm.dart';
@@ -21,7 +21,7 @@ part 'news_vm.g.dart';
 
 @riverpod
 class NewsVm extends _$NewsVm {
-  late NewsFeedNewsRepository repositoryInstance;
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
 
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
@@ -44,7 +44,7 @@ class NewsVm extends _$NewsVm {
   @override
   NewsState build(){
     // 引入数据仓库
-    repositoryInstance = ref.read(newsFeedNewsRepositoryProvider);
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -128,7 +128,7 @@ class NewsVm extends _$NewsVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await repositoryInstance.fetchNewsList(params);
+      final result = await commonNewsFeedRespositoryInstance.fetchNewsList(params);
       //校验成功失败
       if (result.isSuccess) {
         handlerResultList((result.data  as NewsfeedNewsEntity).list, isLoadMore ?? false);
@@ -186,7 +186,7 @@ class NewsVm extends _$NewsVm {
   Future handlerLikeClick(int id, bool isLike, int? itemidx) async {
     try {
       List<Map<String, dynamic>> listCopyDta =  List.from(state.list!);
-      final result = await repositoryInstance.fetchLikeClick({
+      final result = await commonNewsFeedRespositoryInstance.fetchLikeClick({
         "id": id,
       });
       if (result.isSuccess) {
@@ -254,27 +254,35 @@ class NewsVm extends _$NewsVm {
         break;
     }
   }
-  Future handlerFollow(BuildContext context, bool isFollow) async{
+
+  // 关注/取消关注
+  Future<bool> handlerFollow(BuildContext? context, int to_user_id,int cardId, bool isFollow) async{
     Log.d("点击了 关注");
-    // try {
-    //   //请求网络
-    //   Map<String, dynamic>  params = {
-    //
-    //   };
-    //   Log.d("请求参数------$params");
-    //   final result = await repositoryInstance.fetchNewsList(params);
-    //   //校验成功失败
-    //   if (result.isSuccess) {
-    //     handlerResultList((result.data  as NewsfeedNewsEntity).list);
-    //   } else {
-    //     String errorMessage = result.errorMsg!;
-    //     changeLoadingState(LoadState.State_Error, errorMessage);
-    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //   }
-    // } catch (e) {
-    //   ToastEngine.show("Error: $e");
-    // }
+    try {
+      final result = await commonNewsFeedRespositoryInstance.handlerFollowOrCancel({
+        "to_user_id": to_user_id,
+      });
+      if(result.isSuccess){
+        // 修改cardId 对应的 card item 的 account 里面的 followed
+        if(cardId!=null){
+          final listCopyDta = List<Map<String, dynamic>>.from(state.list!);
+          listCopyDta!.forEach((carditem) {
+            if(carditem['id'] == cardId){
+              carditem['account']['followed'] = !carditem['account']['followed'];
+            }
+          });
+          state = state.copyWith(list: listCopyDta);
+        }
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      Log.d("error: $error");
+      return false;
+    }
   }
+
   // 去详情页面
   void handlerGotoDetail(BuildContext? context, int id){
     Log.d("去详情页面");

+ 1 - 1
packages/cpt_community/lib/modules/community/news/news_vm.g.dart

@@ -6,7 +6,7 @@ part of 'news_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsVmHash() => r'e96b257e68b8e9c69c4381bf49b3a139a632c85b';
+String _$newsVmHash() => r'c560bb4c7f8779dd4e8227c0833de74f3307505a';
 
 /// See also [NewsVm].
 @ProviderFor(NewsVm)

+ 2 - 0
packages/cpt_community/lib/modules/community/newsfeed_detail/comments_input.dart

@@ -66,6 +66,8 @@ class CommentsTextareaInput extends HookConsumerWidget {
             },
             onChanged: (text) {
               // 当文本改变时,更新字符数量
+              Log.d("text  $text");
+              Log.d("4  ${state.commentFieldInfo!['controller']?.text}");
               if(showCounter){
                 noteCount.value = text.length;
               }

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

@@ -49,13 +49,14 @@ class NewsfeedDetailPage extends HookConsumerWidget {
     final state = ref.watch(newsfeedDetailVmProvider);
     GlobalKey _likeButtonKey = GlobalKey<MyLikeButtonState>();
 
-    NewsfeedDetailEntity?  detailInfo = state.detailInfo;
+    NewsfeedDetailEntity?  detailInfo = state.detailInfo!;
 
     List<NewsfeedDetailComments>? commentList = detailInfo!.comments;
 
     useEffect((){
+      vm.setCurrentDetailType(type!);
       // 组件挂载时执行 - 执行接口请求
-      Future.microtask(() => vm.initPageData(id: id));
+      Future.microtask(() => vm.initPageData(id: id, type: type));
       return () {
         // 组件卸载时执行
       };
@@ -72,7 +73,7 @@ class NewsfeedDetailPage extends HookConsumerWidget {
       body: Column(
           mainAxisSize: MainAxisSize.max,
           children:[
-              Expanded(
+            Expanded(
                 child: EasyRefresh(
                   controller: vm.refreshController,
                   // 上拉加载
@@ -109,17 +110,21 @@ class NewsfeedDetailPage extends HookConsumerWidget {
                   ),
                 ),
               ),
-              _buildBottomActionSection(context, ref, _likeButtonKey),
+            (detailInfo != null && detailInfo.id != null)? _buildBottomActionSection(context, ref,vm, _likeButtonKey): SizedBox.shrink(),
           ]
       )
     );
   }
 
   Widget _buildTopCard(BuildContext context, WidgetRef ref,NewsfeedDetailEntity detailInfo ){
+    final vm = ref.read(newsfeedDetailVmProvider.notifier);
     String card_title = "";
+    int card_id = detailInfo!.id??0;
     String card_created_at = detailInfo!.createdAt ?? "";
     NewsfeedDetailAccount card_account = detailInfo!.account?? NewsfeedDetailAccount();
+    int card_count_id = card_account!.id??0;
     String card_avator = card_account!.avatar?? '';
+    String card_count_name = card_account!.name?? '';
     bool card_followed = card_account!.followed??false;
     String card_content = detailInfo!.content??"";
     bool? card_liked = detailInfo!.liked;
@@ -128,7 +133,6 @@ class NewsfeedDetailPage extends HookConsumerWidget {
     List? card_resources = detailInfo!.resources?? [];
 
 
-
     return Stack(
       children: [
         Container(
@@ -153,7 +157,7 @@ class NewsfeedDetailPage extends HookConsumerWidget {
                 // 卡片头部(头像 标题 时间)
                 NewsFeedCardHeader(
                   key: UniqueKey(),
-                  title: card_title,
+                  title: card_count_name,
                   avator: card_avator,
                   time: card_created_at,
                 ),
@@ -170,132 +174,152 @@ class NewsfeedDetailPage extends HookConsumerWidget {
           ),
         ),
         // 右上角 关注/取消关注 按钮
-        Visibility(
-          visible: card_followed ? false: true,
-          child: Positioned(
-              right: 40,
-              top: 35,
-              child: Container(
-                width: 83.5,
-                height: 45.5,
-                alignment: Alignment.center,
-                // decoration: BoxDecoration(
-                //   color:  ColorUtils.string2Color('#4161D0'),
-                //   borderRadius: BorderRadius.circular(5),
-                // ),
-                child: MyButton(
-                  text: '+Follow',
-                  textColor: context.appColors.textWhite,
-                  backgroundColor: ColorUtils.string2Color('#4161D0'),
-                  radius: 8,
-                  minHeight: 27.5,
-                  padding: const EdgeInsets.only(left: 5, right: 5,top:9,bottom:9),
-                  fontWeight: FontWeight.w400,
-                  fontSize: 14,
-                  onPressed: (){
-                    // Navigator.pop(context);
-                  },
-                ),
-              )
-          ),
+        Positioned(
+            right: 40,
+            top: 35,
+            child: Container(
+              width: 83.5,
+              height: 45.5,
+              alignment: Alignment.center,
+              // decoration: BoxDecoration(
+              //   color:  ColorUtils.string2Color('#4161D0'),
+              //   borderRadius: BorderRadius.circular(5),
+              // ),
+              child: HookBuilder(
+                  builder: (context) {
+                    final isFollowedState = useState<bool>(card_followed);
+                    return MyButton(
+                      text: isFollowedState.value ? 'Followed': '+Follow',
+                      textColor: isFollowedState.value ?  context.appColors.disEnableGray: context.appColors.textWhite,
+                      disabledTextColor: context.appColors.disEnableGray,
+                      backgroundColor: isFollowedState.value ? Colors.transparent : ColorUtils.string2Color('#4161D0'),
+                      side: BorderSide(color: !isFollowedState.value ? Colors.transparent : context.appColors.disEnableGray, width: 0.5),
+                      radius: 8,
+                      minHeight: 27.5,
+                      padding: const EdgeInsets.only(left: 5, right: 5,top:9,bottom:9),
+                      fontWeight: FontWeight.w400,
+                      fontSize: 14,
+                      onPressed: () async{
+                        bool asyncResult = await vm.handlerFollow(context,card_count_id, card_id,  isFollowedState.value );
+                        if(asyncResult){
+                          // 成功  关注->取消关注  取消关注->关注
+                          isFollowedState.value = !isFollowedState.value;
+                          // 修改该item
+
+                        }
+                      },
+                    );
+                  }
+              ),
+            )
         )
       ],
     );
   }
 
   Widget _buildCommentListCard(BuildContext context,  WidgetRef ref, NewsfeedDetailEntity detailInfo){
-
+    final vm = ref.read(newsfeedDetailVmProvider.notifier);
     int likeCount = detailInfo!.likesCount??0;
     List<NewsfeedDetailComments>? commentList = detailInfo!.comments;
     num commentCount = commentList?.length?? 0;
-
-    return Container(
-      margin: const EdgeInsets.only(left: 15, right: 15,top: 18,bottom: 18),
-      padding: const EdgeInsets.only(bottom: 30),
-      decoration: BoxDecoration(
-          color: context.appColors.textWhite,
-          borderRadius: BorderRadius.circular(10),
-          boxShadow: [
-            BoxShadow(
-              color: ColorUtils.string2Color("#E4E7EB").withOpacity(0.5),
-              spreadRadius: 0,
-              blurRadius: 4,
-              offset: const Offset(0, 4), // changes position of shadow
-            ),
-          ]
-      ),
-      child: Column(
-        crossAxisAlignment: CrossAxisAlignment.start,
-        mainAxisAlignment: MainAxisAlignment.start,
-        children: [
-          // 总评论数 总收藏数等
-          Row(
+    return HookBuilder(
+      builder: (context) {
+        return Container(
+          margin: const EdgeInsets.only(left: 15, right: 15,top: 18,bottom: 18),
+          padding: const EdgeInsets.only(bottom: 30),
+          decoration: BoxDecoration(
+              color: context.appColors.textWhite,
+              borderRadius: BorderRadius.circular(10),
+              boxShadow: [
+                BoxShadow(
+                  color: ColorUtils.string2Color("#E4E7EB").withOpacity(0.5),
+                  spreadRadius: 0,
+                  blurRadius: 4,
+                  offset: const Offset(0, 4), // changes position of shadow
+                ),
+              ]
+          ),
+          child: Column(
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisAlignment: MainAxisAlignment.start,
             children: [
-              Expanded(
-                child: Container(
-                  padding: const EdgeInsets.only(left: 15, right: 15,top: 14,bottom: 14),
-                  child: Row(
-                    children: [
-                      MyTextView('Comments', textColor: ColorUtils.string2Color("#2956B7"), fontSize: 15, isFontLight: true,),
-                      const SizedBox(width: 5,),
-                      MyTextView('($commentCount)', textColor: ColorUtils.string2Color("#2956B7"), fontSize: 15, isFontLight: true,),
-                    ]
-                  )
-                )
-              ),
-             // 收藏数
-             Expanded(
-                 child: Container(
-                   padding: const EdgeInsets.only(right: 20),
-                   child: Row(
-                     mainAxisAlignment: MainAxisAlignment.end,
-                     children: [
-                       const MyAssetImage(
-                         Assets.communityLikeActive,
-                         width: 15,
-                         height: 15,
-                       ),
-                       const SizedBox(width: 5,),
-                       MyTextView(
-                         '$likeCount',
-                         textColor: ColorUtils.string2Color("#767676"),
-                         fontSize: 14,
-                         isFontLight: true,
+              // 总评论数 总收藏数等
+              Row(
+                children: [
+                  Expanded(
+                    child: Container(
+                      padding: const EdgeInsets.only(left: 15, right: 15,top: 14,bottom: 14),
+                      child: Row(
+                        children: [
+                          MyTextView('Comments', textColor: ColorUtils.string2Color("#2956B7"), fontSize: 15, isFontLight: true,),
+                          const SizedBox(width: 5,),
+                          MyTextView('(${commentCount})', textColor: ColorUtils.string2Color("#2956B7"), fontSize: 15, isFontLight: true,),
+                        ]
+                      )
+                    )
+                  ),
+                 // 收藏数
+                 Expanded(
+                     child: Container(
+                       padding: const EdgeInsets.only(right: 20),
+                       child: Row(
+                         mainAxisAlignment: MainAxisAlignment.end,
+                         children: [
+                           const MyAssetImage(
+                             Assets.communityLikeActive,
+                             width: 15,
+                             height: 15,
+                           ),
+                           const SizedBox(width: 5,),
+                           MyTextView(
+                             '${likeCount}',
+                             textColor: ColorUtils.string2Color("#767676"),
+                             fontSize: 14,
+                             isFontLight: true,
+                           ),
+                         ],
                        ),
-                     ],
-                   ),
-                 ),
-             )
-            ],
-          ),
+                     ),
+                 )
+                ],
+              ),
 
-          // 分割线
-          Container(
-            height: 1,
-            color: context.appColors.dividerDefault,
-          ),
+              // 分割线
+              Container(
+                height: 1,
+                color: context.appColors.dividerDefault,
+              ),
 
-          Padding(
-            padding: const EdgeInsets.only(top: 16),
-            child: Column(
-              children: (commentList?.isNotEmpty ?? false)? commentList!.asMap().entries.map((entry) {
-                final item = entry.value;
-                final index = entry.key;
-                final lastIdx = commentList.length - 1;
-                return _buildCommentItem(context, ref, item, index, lastIdx);
-              }).toList(): [
-                const Center(
-                  child: SizedBox(
-                    height: 250,
-                    child: MyAssetImage(Assets.baseServicePageNoData, width: 123.5, height: 115.5, fit: BoxFit.contain),
-                  ),
-                )
-              ],
-            ),
+              Padding(
+                padding: const EdgeInsets.only(top: 16),
+                child: Column(
+                  children: (commentList?.isNotEmpty ?? false)? commentList!.asMap().entries.map((entry) {
+                    NewsfeedDetailComments item = entry.value;
+                    final index = entry.key;
+                    final lastIdx = commentList.length - 1;
+                    int newsfeedId = detailInfo!.id!;
+                    int to_user_id = item.id!;
+                    String to_user_name = item!.account!.name!;
+                    return _buildCommentItem(context, ref, item, index, lastIdx).onTap((){
+                      // 点击 单条 评论 则对 此评论进行评论
+                      vm.handlerCommentClick(context, newsfeedId, to_user_id, to_user_name, true);
+                    });
+                  }).toList(): [
+                    // 没有数据的显示
+                    const Center(
+                      child: SizedBox(
+                        height: 250,
+                        child: MyAssetImage(Assets.baseServicePageNoData, width: 123.5, height: 115.5, fit: BoxFit.contain),
+                      ),
+                    )
+                  ],
+                ),
+              ),
+            ]
           ),
-        ]
-      ),
-    ).borderRadius(all:8);
+        ).borderRadius(all:8);
+      }
+    );
   }
 
 
@@ -309,11 +333,21 @@ class NewsfeedDetailPage extends HookConsumerWidget {
     NewsfeedDetailComments? comment_Item = commentList?[index];
     int  comment_id = comment_Item!.id?? 0;
     String comment_content = comment_Item!.content?? '';
+
     String comment_time = comment_Item!.createdAt?? '';
     NewsfeedDetailCommentsAccount? commentAccount_Item = commentList?[index].account;
-    String comment_avatar = commentAccount_Item!.avatar?? '';
-    int comment_account_id = commentAccount_Item!.id?? 0;
-    String comment_name = commentAccount_Item!.name?? "";
+    String comment_avatar = commentAccount_Item?.avatar?? '';
+    int comment_account_id = commentAccount_Item?.id?? 0;
+    String comment_name = commentAccount_Item?.name?? "";
+
+    NewsfeedDetailCommentsToAccount? commentToAccount_Item = commentList?[index].toAccount;
+    String comment_toAccount_avatar = commentToAccount_Item?.avatar?? '';
+    int comment_toAccount_id = commentToAccount_Item?.id?? 0;
+    String comment_toAccount_name = commentToAccount_Item?.name?? "";
+
+    if(commentToAccount_Item !=null && comment_toAccount_name != null){
+      comment_content = '@$comment_toAccount_name: $comment_content';
+    }
 
 
     return Container(
@@ -382,16 +416,23 @@ class NewsfeedDetailPage extends HookConsumerWidget {
   }
 
 
-  Widget _buildBottomActionSection(BuildContext context, WidgetRef ref , _likeButtonKey){
+  Widget _buildBottomActionSection(BuildContext context, WidgetRef ref ,vm,  _likeButtonKey){
     final state = ref.watch(newsfeedDetailVmProvider);
     final vm = ref.read(newsfeedDetailVmProvider.notifier);
 
     NewsfeedDetailEntity  detailInfo = state.detailInfo!;
 
+    int newsfeedId = detailInfo!.id!;
+
+    int to_user_id = detailInfo!.account!.id!;
+    String to_user_name = detailInfo!.account!.name!;
+
     // List<NewsfeedDetailComments>? commentList = detailInfo!.comments;
 
-    bool isLike = detailInfo.liked?? false;
+    bool isLike = detailInfo!.liked?? false;
+
     return SafeArea(
+      bottom: true,
       child: Visibility(
         visible: state.loadingState == LoadState.State_Success,
         child: Container(
@@ -420,9 +461,13 @@ class NewsfeedDetailPage extends HookConsumerWidget {
                                 customIconHeight: 18,
                                 customIconActiveAssets: Assets.communityLikeActive,
                                 customIconUnActiveAssets: Assets.communityNewsfeedDetailLike,
-                                onLike: () {
+                                onLike: () async {
                                   Log.d('点击了like button');
-                                  vm.handlerLikeClick(context, detailInfo!.id as int, isLike);
+                                  bool asyncResult = await vm.handlerLikeClick(context, detailInfo!.id as int, isLike);
+                                  if(asyncResult){
+                                    // 成功
+
+                                  }
                                 },
                               ),
                               const SizedBox(width: 10,),
@@ -467,7 +512,7 @@ class NewsfeedDetailPage extends HookConsumerWidget {
                             ],
                           ),
                         ).onTap((){
-                          vm.handlerCommentClick(context);
+                          vm.handlerCommentClick(context, newsfeedId, to_user_id, to_user_name, false);
                         })
                       ],
                     ),

+ 171 - 32
packages/cpt_community/lib/modules/community/newsfeed_detail/newsfeed_detail_vm.dart

@@ -1,5 +1,7 @@
 
-import 'package:cpt_community/respository/newsfeed_news_repository.dart';
+import 'package:cpt_community/modules/community/following/following_vm.dart';
+import 'package:cpt_community/modules/community/foryou/foryou_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';
 import 'package:domain/entity/newsfeed_detail_entity.dart';
@@ -16,7 +18,6 @@ import 'package:widgets/my_text_view.dart';
 import 'package:widgets/widget_export.dart';
 import '../../../components/comments_dialog.dart';
 
-import '../../../respository/newsfeed_detail_repository.dart';
 import '../news/news_vm.dart';
 import 'comments_input.dart';
 import 'newsfeed_detail_state.dart';
@@ -27,7 +28,7 @@ part 'newsfeed_detail_vm.g.dart';
 
 @riverpod
 class NewsfeedDetailVm extends _$NewsfeedDetailVm {
-  late NewsFeedDetailRepository repositoryInstance;
+  late CommonNewsFeedRespository repositoryInstance;
 
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
@@ -53,9 +54,8 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   @override
   NewsfeedDetailState build(){
     // 引入数据仓库
-    repositoryInstance = ref.read(newsFeedDetailRepositoryProvider);
+    repositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
-
     // 第一次挂载后
     // WidgetsBinding.instance!.addPostFrameCallback((_) {
     // }
@@ -64,6 +64,11 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
     return state;
   }
 
+  setCurrentDetailType(String detailPageType){
+    Log.d("设置当前页面类型---------$detailPageType");
+    _detailType = detailPageType;
+  }
+
 //刷新页面状态
   void changeLoadingState(LoadState loadState, String? errorMsg) {
     state = state.copyWith(
@@ -76,7 +81,9 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   initPageData({int? id, String? type}) {
     Log.d("----property_news_vm-----initPageData   ${state.loadingState}");
     _detailId = id ?? _detailId;
-    _detailType = type;
+    if(type != null){
+      setCurrentDetailType(type);
+    }
 
     onRefresh(id: _detailId, type: type);
   }
@@ -84,15 +91,10 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   // 上拉加载 更多
   Future loadMore({int? id, String? type}) async {
     Log.d("----property_news_vm-----loadMore");
-    // await Future.delayed(const Duration(seconds: 2));
-    // if(state.list.length >= _count){
-    //   return;
-    // }else {
-    //   int _page = _page + 1;
-    //   getListData();
-    // }
-    _page++;
-    getListData(id:id, type:type);
+    // _page++;
+    // getListData(id:id, type:type);
+    getDetailInfo(id:_detailId, type:_detailType, isRefresh: false);
+    // refreshController.finishLoad();
   }
 
 
@@ -113,7 +115,7 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
   }
 
   // 获取详情信息
-  Future getDetailInfo<T>({int? id, String? type}) async {
+  Future getDetailInfo<T>({int? id, String? type, bool isRefresh = true}) async {
     try{
       if (_needShowPlaceholder) {
         changeLoadingState(LoadState.State_Loading, null);
@@ -124,15 +126,16 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
       final result = await repositoryInstance.fetchNewsFeedDetailInfo(params);
       if(result.isSuccess){
 
-        // Log.d("-444---${result.data}-----");
-
-
         state = state.copyWith(
           detailInfo: result.data as NewsfeedDetailEntity,
         );
 
         changeLoadingState(LoadState.State_Success, null);
-        refreshController.finishRefresh();
+        if(isRefresh){
+          refreshController.finishRefresh();
+        }else {
+          refreshController.finishLoad(IndicatorResult.noMore);
+        }
       }else {
         String errorMessage = result.errorMsg!;
         changeLoadingState(LoadState.State_Error, errorMessage);
@@ -216,13 +219,64 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
     refreshController.finishLoad();
   }
 
-  // 点击了 comment 按钮
-  handlerCommentClick(BuildContext context) async{
+  // 点击了 关注/取消关注按钮
+  Future<bool> handlerFollow(BuildContext? context, int to_user_id,int cardId, bool isFollow) async{
+    Log.d("newsfeed_detail_vm 中 当前的 _detailType $_detailType 点击了 关注/取消关注");
+    bool result = false;
+    if(_detailType == 'news'){
+      Log.d("调用 newvm 中的关注/取消关注方法");
+      // 调用列表中的 点赞方法
+      final newsfeedVm = ref.read(newsVmProvider.notifier);
+      result = await newsfeedVm.handlerFollow(context, to_user_id, cardId, isFollow);
+    }else if(_detailType == 'following'){
+      Log.d("调用 followingVm 中的关注/取消关注方法");
+      // 调用列表中的 点赞方法
+      final followingVm = ref.read(followingVmProvider.notifier);
+      result = await followingVm.handlerFollow(context, to_user_id, cardId, isFollow);
+    }else if(_detailType == 'foryou'){
+      Log.d("调用 forYouVm 中的关注/取消关注方法");
+      // 调用列表中的 点赞方法
+      final forYouVm = ref.read(foryouVmProvider.notifier);
+      result = await forYouVm.handlerFollow(context, to_user_id, cardId, isFollow);
+    }
+
+    if(result){
+      // 成功了
+      // 修改cardId 对应的 card item 的 account 里面的 followed
+      if(cardId!=null){
+        NewsfeedDetailEntity detailInfoDta = state.detailInfo!;
+        NewsfeedDetailAccount card_account = detailInfoDta!.account?? NewsfeedDetailAccount();
+        card_account.followed = !(card_account!.followed?? false);
+        state = state.copyWith(detailInfo: detailInfoDta);
+      }
+    }
+    return result;
+  }
+
+  // 点击了 评论 按钮
+  handlerCommentClick(BuildContext context, int newsfeedId, int to_user_id, String to_user_name, bool isReply ) async{
+    Log.d("点击了评论按钮 newsfeedId:  $newsfeedId  to_user_id:  $to_user_id  to_user_name:  $to_user_name  isReply:  $isReply ");
+
+    String hintText = 'Please enter your comment';
+    if(isReply){
+      hintText = 'Reply to $to_user_name: ';
+      // 修改对话框的 提示文字
+    }else {
+      to_user_id = 0; // 评论对象ID(默认传0)
+      String hintText = 'Please enter your comment';
+    }
+    state = state.copyWith(commentFieldInfo: {
+      'value': '',
+      'controller': TextEditingController(),
+      'hintText': hintText,
+      'focusNode': FocusNode(),
+      'obsecure': false,
+    });
+
     BuildContext contextPage = context;
     // double height = MediaQuery.of(contextPage).size.height;
     double commentInputHeight = 150.0;
-    Log.d("点击了评论按钮");
-    await DialogEngine.show(
+        await DialogEngine.show(
       tag: "newsFeedComments",
       position: DialogPosition.bottom,
       widget: CommentsDialog(
@@ -266,12 +320,24 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
                 child: Center(
                   child: IconButton(
                     icon: Icon(Icons.send, color: context.appColors.textWhite, size: 25,),
-                    onPressed: (){
-                      Log.d("点击了发送按钮");
-                    },
+                    onPressed: null,
                   ),
                 ),
-              ),
+              ).onTap(() async{
+                Log.d("点击了发送按钮");
+                // 收起键盘
+                handlerKeyboardShowHide(false);
+                // 获取评论内容
+                String commentContent = getCommentContent()??'';
+                bool asyncResult = await handlerSubmitComment(context: context, newsfeedId: newsfeedId, to_user_id: to_user_id, commentContent: commentContent);
+                if(asyncResult){
+                  // 成功后 需要 清理输入框以及关闭 同时收起键盘 同时 刷新评论数据
+                  resetCommentField();
+                  DialogEngine.dismiss(tag: "newsFeedComments");
+                  // 刷新评论数据
+                  handlerSetCommentsList();
+                }
+              }),
             ]
           );
         },
@@ -279,16 +345,89 @@ class NewsfeedDetailVm extends _$NewsfeedDetailVm {
     );
   }
 
+  // 刷新评论列表
+  handlerSetCommentsList(){
+    onRefresh(id:_detailId,type: _detailType);
+  }
+
+  // 提交评论
+  Future<bool> handlerSubmitComment({BuildContext? context, required int newsfeedId, int? to_user_id = 0, required String commentContent} ) async{
+    Log.d("点击提交评论 newsfeedId: $newsfeedId  to_user_id: $to_user_id  commentContent; $commentContent");
+    try{
+      Map<String, dynamic> params = {
+        "id": newsfeedId,
+        "content": commentContent,
+        "to_user_id": to_user_id,
+      };
+      final result = await repositoryInstance.fetchNewsfeedCommentSubmit(params);
+      if(result.isSuccess){
+        // 成功后 需要 清理输入框以及关闭 同时收起键盘 同时 刷新评论数据
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      return false;
+    }
+  }
+
   // 点击了 Like 按钮
   Future<bool> handlerLikeClick(BuildContext? context, int id,  bool isLike) async{
-    Log.d("点击了点赞按钮 id:$id  isLike: $isLike");
+    Log.d("newsfeed_detail_vm 中 当前的 _detailType $_detailType 点击了点赞按钮 id:$id  isLike: $isLike");
+
+    bool result = false;
+    if(_detailType == 'news'){
+      Log.d("调用 newvm 中的点赞方法");
+      // 调用列表中的 点赞方法
+      final newsfeedVm = ref.read(newsVmProvider.notifier);
+      result = await newsfeedVm.handlerLikeClick(id, isLike, null);
+    }else if(_detailType == 'following'){
+      Log.d("调用 followingVm 中的点赞方法");
+      // 调用列表中的 点赞方法
+      final followingVm = ref.read(followingVmProvider.notifier);
+      result = await followingVm.handlerLikeClick(id, isLike, null);
+    }else if(_detailType == 'foryou'){
+      Log.d("调用 forYouVm 中的点赞方法");
+      // 调用列表中的 点赞方法
+      final forYouVm = ref.read(foryouVmProvider.notifier);
+      result = await forYouVm.handlerLikeClick(id, isLike, null);
+    }
+
+    if(result){
+      // 成功了
+      // 修改 comments 数量 和 收藏数
+      NewsfeedDetailEntity detailInfoCopy = state.detailInfo!;
+      int likeCount = detailInfoCopy!.likesCount??0;
+      bool liked = detailInfoCopy!.liked??false;
+      // List<NewsfeedDetailComments>? commentList = detailInfoCopy!.comments;
+      // num commentCount = commentList?.length?? 0;
+      detailInfoCopy!.liked = !liked;
+      if(isLike){
+        detailInfoCopy!.likesCount = likeCount - 1;
+      }else{
+        detailInfoCopy!.likesCount = likeCount + 1;
+      }
+      state = state.copyWith(detailInfo: detailInfoCopy);
+    }
 
-    // 调用列表中的 点赞方法
-    final newsfeedVm = ref.read(newsVmProvider.notifier);
-    bool result = await newsfeedVm.handlerLikeClick(id, isLike, null);
     return result;
   }
 
+  // 隐藏/显示 键盘
+  void handlerKeyboardShowHide(bool show){
+    Log.d("点击了键盘显示/隐藏");
+    if(show){
+      state.commentFieldInfo?['focusNode']?.focus();
+    }else {
+      state.commentFieldInfo?['focusNode']?.unfocus();
+    }
+  }
+  // 获取评论内容
+  String getCommentContent(){
+    Log.d("评论框的内容 ${state.commentFieldInfo!['controller']?.text??''}");
+    return state.commentFieldInfo!['controller']?.text??'';
+  }
+
   // 清空评论
   resetCommentField(){
     state.commentFieldInfo!['controller']!.clear();

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

@@ -6,7 +6,7 @@ part of 'newsfeed_detail_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsfeedDetailVmHash() => r'ce389da8ee9b58f390b9819e1ed3d0979b2cb4fd';
+String _$newsfeedDetailVmHash() => r'bce3c2cadc599ef8c7c814da65e8c81ed1a73e61';
 
 /// See also [NewsfeedDetailVm].
 @ProviderFor(NewsfeedDetailVm)

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

@@ -1,4 +1,5 @@
 
+import 'package:cpt_community/respository/common_newsfeed.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:flutter/material.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
@@ -10,7 +11,6 @@ import 'package:auto_route/auto_route.dart';
 import 'package:shared/utils/util.dart';
 
 
-import '../../../respository/newsfeed_publish_repository.dart';
 import '../community_vm.dart';
 import 'newsfeed_post_page_state.dart';
 
@@ -18,7 +18,7 @@ part 'newsfeed_post_vm.g.dart';
 
 @riverpod
 class NewsfeedPostVm extends _$NewsfeedPostVm {
-  late NewsFeedPublishRepository repositoryInstance;
+  late CommonNewsFeedRespository repositoryInstance;
 
   NewsfeedPostPageState initState() {
     return NewsfeedPostPageState(
@@ -39,7 +39,7 @@ class NewsfeedPostVm extends _$NewsfeedPostVm {
   @override
   NewsfeedPostPageState build() {
     // 引入数据仓库
-    repositoryInstance = ref.read(newsFeedPublishRepositoryProvider);
+    repositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     // 初始化状态
     NewsfeedPostPageState state = initState();
 

+ 1 - 1
packages/cpt_community/lib/modules/community/newsfeed_post/newsfeed_post_vm.g.dart

@@ -6,7 +6,7 @@ part of 'newsfeed_post_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsfeedPostVmHash() => r'7d7f91825fb9b8162ab42ee63ada1bea62809966';
+String _$newsfeedPostVmHash() => r'9e99a570571851fd337207a06998ed8bf064f347';
 
 /// See also [NewsfeedPostVm].
 @ProviderFor(NewsfeedPostVm)

+ 4 - 4
packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.dart

@@ -19,7 +19,7 @@ part 'for_rent_vm.g.dart';
 
 @riverpod
 class ForrentVm extends _$ForrentVm {
-  late CommonGarageRepository commonGarageRepositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
@@ -73,7 +73,7 @@ class ForrentVm extends _$ForrentVm {
   @override
   ForrentState build(){
     // 引入数据仓库
-    commonGarageRepositoryInstance = ref.read(commonGarageRepositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -196,7 +196,7 @@ class ForrentVm extends _$ForrentVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await commonGarageRepositoryInstance.fetchGarageDataList(params);
+      final result = await commonGarageRespositoryInstance.fetchGarageDataList(params);
       //校验成功失败
       if (result.isSuccess) {
         handlerResultList(result.list?.cast<GarageSaleRentEntity>(), isLoadMore ?? false);
@@ -274,7 +274,7 @@ class ForrentVm extends _$ForrentVm {
         "id": id,
       };
       Log.d("请求参数------$params");
-      final result = await commonGarageRepositoryInstance.fetchGarageColleciton(params);
+      final result = await commonGarageRespositoryInstance.fetchGarageColleciton(params);
       //校验成功失败
       if (result.isSuccess) {
         // 修改 该id 的 liked 和 likes_count 字段

+ 1 - 1
packages/cpt_community/lib/modules/garage/for_rent/for_rent_vm.g.dart

@@ -6,7 +6,7 @@ part of 'for_rent_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$forrentVmHash() => r'1dc0df10f17ff092fd7f521c28a0cf71d9e0671c';
+String _$forrentVmHash() => r'64d0cddcdfa741792d5bdeae3a70c8c694e01461';
 
 /// See also [ForrentVm].
 @ProviderFor(ForrentVm)

+ 4 - 4
packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.dart

@@ -20,7 +20,7 @@ part 'for_sale_vm.g.dart';
 
 @riverpod
 class ForsaleVm extends _$ForsaleVm {
-  late CommonGarageRepository commonGarageRepositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
@@ -41,7 +41,7 @@ class ForsaleVm extends _$ForsaleVm {
   @override
   ForsaleState build(){
     // 引入数据仓库
-    commonGarageRepositoryInstance = ref.read(commonGarageRepositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -216,7 +216,7 @@ class ForsaleVm extends _$ForsaleVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await commonGarageRepositoryInstance.fetchGarageDataList(params);
+      final result = await commonGarageRespositoryInstance.fetchGarageDataList(params);
       //校验成功失败
       if (result.isSuccess) {
         handlerResultList(result.list?.cast<GarageSaleRentEntity>(), isLoadMore ?? false);
@@ -288,7 +288,7 @@ class ForsaleVm extends _$ForsaleVm {
         "id": id,
       };
       Log.d("请求参数------$params");
-      final result = await commonGarageRepositoryInstance.fetchGarageColleciton(params);
+      final result = await commonGarageRespositoryInstance.fetchGarageColleciton(params);
       //校验成功失败
       if (result.isSuccess) {
         // 修改 该id 的 liked 和 likes_count 字段

+ 1 - 1
packages/cpt_community/lib/modules/garage/for_sale/for_sale_vm.g.dart

@@ -6,7 +6,7 @@ part of 'for_sale_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$forsaleVmHash() => r'e94a8a4c8ca889796a23b37f6a1ae6dd6a709b23';
+String _$forsaleVmHash() => r'79de87553b92d59e522c27fd773b8da73170b7ea';
 
 /// See also [ForsaleVm].
 @ProviderFor(ForsaleVm)

+ 47 - 22
packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_page.dart

@@ -17,16 +17,16 @@ import 'package:widgets/my_text_view.dart';
 
 @RoutePage()
 class GaragesaleDetailPage extends HookConsumerWidget {
-  final int? id;
-  final String? type;  // forSale  forRent
+  final int id;
+  final String type;  // forSale  forRent
 
   const GaragesaleDetailPage({Key? key, required this.id, required this.type}) : super(key: key);
   // 启动当前页面
   static void startInstance({BuildContext? context, int? id, String? type = 'forSale'}) {
     if (context != null) {
-      context.router.push(GaragesaleDetailPageRoute(id: id, type: type));
+      context.router.push(GaragesaleDetailPageRoute(id: id!, type: type!));
     } else {
-      appRouter.push(GaragesaleDetailPageRoute(id: id, type: type));
+      appRouter.push(GaragesaleDetailPageRoute(id: id!, type: type!));
     }
   }
 
@@ -37,7 +37,14 @@ class GaragesaleDetailPage extends HookConsumerWidget {
     final vm = ref.read(garagesaleDetailVmProvider.notifier);
     final String pageTitle = (type == 'forSale') ? 'For Sale' :'For Rent';
     GlobalKey _likeButtonKey = GlobalKey<MyLikeButtonState>();
+
+    String title =  '';
+    String price =  '';
+    String contactType = '';
+    String description = '';
+
     useEffect((){
+      vm.setInitPageData(id: id!, type: type);
       // 组件挂载时执行 - 执行接口请求
       Future.microtask(() => vm.initPageData());
       return () {
@@ -67,12 +74,22 @@ class GaragesaleDetailPage extends HookConsumerWidget {
                     scrollDirection: Axis.vertical,
                     physics: const BouncingScrollPhysics(),
                     clipBehavior: Clip.none,
-                    child: _buildContentBox(context, ref),
+                    child: _buildContentBox(context, ref,
+                      title:title,
+                      price:price,
+                      contactType:contactType,
+                      description:description,
+                    ),
                   ),
                 ),
                 Visibility(
-                  visible: state.loadingState == LoadState.State_Success && state.datas!['contactType'] == 'WhatsApp',
-                  child: _buildWhatsApp(context, ref),
+                  visible: state.loadingState == LoadState.State_Success,
+                  child: _buildWhatsApp(context, ref,
+                    title:title,
+                    price:price,
+                    contactType:contactType,
+                    description:description,
+                  ),
                 ),
               ]
             ),
@@ -80,14 +97,19 @@ class GaragesaleDetailPage extends HookConsumerWidget {
           // 底部联系信息
           Visibility(
             visible: state.loadingState == LoadState.State_Success,
-            child: _buildBottomConcatInfo(context, ref, _likeButtonKey),
+            child: _buildBottomConcatInfo(context, ref, _likeButtonKey,
+              title:title,
+              price:price,
+              contactType:contactType,
+              description:description,
+            ),
           )
         ],
       ),
     );
   }
 
-  Widget _buildWhatsApp(BuildContext context, WidgetRef ref) {
+  Widget _buildWhatsApp(BuildContext context, WidgetRef ref, {required String title, required String price, required String contactType, required String description}) {
     final vm = ref.read(garagesaleDetailVmProvider.notifier);
     return Positioned(
       right: 15.5,
@@ -102,13 +124,14 @@ class GaragesaleDetailPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildContentBox(BuildContext context, WidgetRef ref) {
+  Widget _buildContentBox(BuildContext context, WidgetRef ref, {required String title, required String price, required String contactType, required String description}) {
     final vm = ref.read(garagesaleDetailVmProvider.notifier);
     final state = ref.watch(garagesaleDetailVmProvider);
-    String title = state.datas!['title'] ?? '';
-    String price = state.datas!['price'] ?? '';
-    String contactType = state.datas!['contactType'] ?? '';
-    String description = state.datas!['description'] ?? '';
+    String goods_img = '';
+    String title =  '';
+    String price = '';
+    String contactType =  '';
+    String description = '';
     return Column(
       crossAxisAlignment: CrossAxisAlignment.start,
       children: [
@@ -117,7 +140,7 @@ class GaragesaleDetailPage extends HookConsumerWidget {
           width: double.infinity,
           height: 173.5,
           child: MyLoadImage(
-            state.datas!['goods_img'],
+            goods_img,
           ),
         ),
         Column(
@@ -145,14 +168,16 @@ class GaragesaleDetailPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildBottomConcatInfo(BuildContext context, WidgetRef ref, likeButtonKey) {
+  Widget _buildBottomConcatInfo(BuildContext context, WidgetRef ref, likeButtonKey, {required String title, required String price, required String contactType, required String description}) {
     final state = ref.watch(garagesaleDetailVmProvider);
-    String publisher = state.datas!['publisher'] ?? '';
-    String contactType = state.datas!['contactType'] ?? '';
-    String contactInfo = state.datas!['contactInfo'] ?? '';
-    String publisherAvatar = state.datas!['publisher_avatar'] ?? '';
-    String publisherTime = state.datas!['publisher_time'] ?? '';
-    int collectionNum = state.datas!['collection_num'] ?? 0;
+
+    String publisher =  '';
+    String contactType =  '';
+    String contactInfo =  '';
+    String publisherAvatar = '';
+    String publisherTime =  '';
+    int collectionNum =  0;
+
     return Container(
       height: 50,
       color: ColorUtils.string2Color('#4161D0'),

+ 3 - 2
packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_state.dart

@@ -1,3 +1,4 @@
+import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:widgets/load_state_layout.dart';
 
 class GarageDetailState {
@@ -8,7 +9,7 @@ class GarageDetailState {
   final int? id;
   final String? type;  // forsale  forrent
 
-  Map<String, dynamic> datas;
+  GarageSaleRentDetailEntity datas;
 
   GarageDetailState({
     this.loadingState = LoadState.State_Loading,
@@ -19,7 +20,7 @@ class GarageDetailState {
   });
 
   GarageDetailState copyWith({
-    Map<String, dynamic>? datas,
+    GarageSaleRentDetailEntity? datas,
     LoadState? loadingState,
     String? errorMessage,
     int? id,

+ 36 - 4
packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.dart

@@ -1,4 +1,6 @@
+import 'package:cpt_community/respository/common_garage.dart';
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -15,9 +17,12 @@ part 'garagesale_detail_vm.g.dart';
 
 @riverpod
 class GaragesaleDetailVm extends _$GaragesaleDetailVm {
-  // late GaragesaleDetailRepository GaragesaleDetailRepositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
 
+  int _detailId = 0;
+  String _detailType = "";
+
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
     controlFinishRefresh: true,  //允许刷新
@@ -26,14 +31,14 @@ class GaragesaleDetailVm extends _$GaragesaleDetailVm {
 
   GarageDetailState initState() {
     return GarageDetailState(
-        datas: {}
+        datas: GarageSaleRentDetailEntity()
     );
   }
 
   @override
   GarageDetailState build(){
     // 引入数据仓库
-    // GaragesaleDetailRepositoryInstance = ref.read(newsRepositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -55,6 +60,10 @@ class GaragesaleDetailVm extends _$GaragesaleDetailVm {
     getDetailData();
   }
 
+  setInitPageData({required int id, required String type}){
+    _detailId = id;
+    _detailType = type;
+  }
   // 初始化页面数据
   initPageData() {
     Log.d("----property_news_vm-----initPageData   ${state.loadingState}");
@@ -91,7 +100,8 @@ class GaragesaleDetailVm extends _$GaragesaleDetailVm {
       'publisher_time': 'June 17,2024 at 7:23 PM'
     };
 
-    state = state.copyWith(datas: detailData);
+    state = state.copyWith(datas: GarageSaleRentDetailEntity(
+    ));
 
     changeLoadingState(LoadState.State_Success, null);
 
@@ -99,6 +109,28 @@ class GaragesaleDetailVm extends _$GaragesaleDetailVm {
 
     // 最后赋值
     _needShowPlaceholder = false;
+
+
+    // try {
+    //   Map<String, dynamic> params = {
+    //     "id": _detailId,
+    //   };
+    //   final result = await commonGarageRespositoryInstance.fetchGarageDetailInfo(params);
+    //   if(result.isSuccess){
+    //     state = state.copyWith(datas: result.data as GarageSaleRentDetailEntity);
+    //     changeLoadingState(LoadState.State_Success, null);
+    //     refreshController.finishRefresh();
+    //   } else {
+    //     String errorMessage = result.errorMsg!;
+    //     changeLoadingState(LoadState.State_Error, errorMessage);
+    //     ToastEngine.show(result.errorMsg ?? "Network Load Error");
+    //   }
+    // } catch (e) {
+    //   ToastEngine.show("Error: $e");
+    // }
+
+    // 最后赋值
+    _needShowPlaceholder = false;
   }
 
 

+ 1 - 1
packages/cpt_community/lib/modules/garage/garagesale_detail/garagesale_detail_vm.g.dart

@@ -7,7 +7,7 @@ part of 'garagesale_detail_vm.dart';
 // **************************************************************************
 
 String _$garagesaleDetailVmHash() =>
-    r'59335b8961337b00baf96d91bbc92da4b65d52de';
+    r'17076cfe86ec86c19b0285834671eb024b1dc4ae';
 
 /// See also [GaragesaleDetailVm].
 @ProviderFor(GaragesaleDetailVm)

+ 3 - 3
packages/cpt_community/lib/modules/garage/garagesale_post/garagesale_post_vm.dart

@@ -21,7 +21,7 @@ part 'garagesale_post_vm.g.dart';
 
 @riverpod
 class GaragesalePostVm extends _$GaragesalePostVm {
-  late CommonGarageRepository commonGarageRepositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
   List _resCategoryOptionsList = [];
   int _initialSaleSelectIndex = 0;
   String _initialSaleSelectedItem = '';
@@ -92,7 +92,7 @@ class GaragesalePostVm extends _$GaragesalePostVm {
 
   @override
   GaragesalePostPageState build() {
-    commonGarageRepositoryInstance = ref.read(commonGarageRepositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     // 初始化状态
     GaragesalePostPageState state = initState();
 
@@ -354,7 +354,7 @@ class GaragesalePostVm extends _$GaragesalePostVm {
       "contact": contactValue,  // string($例如:whatsapp:+8617671757687 或 mobile:+8617671757687)
       "resources": imgList,
     };
-    final result =  await commonGarageRepositoryInstance.fetchPublishGarage(params);
+    final result =  await commonGarageRespositoryInstance.fetchPublishGarage(params);
     return result;
   }
 

+ 1 - 1
packages/cpt_community/lib/modules/garage/garagesale_post/garagesale_post_vm.g.dart

@@ -6,7 +6,7 @@ part of 'garagesale_post_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$garagesalePostVmHash() => r'c26051add6b907d479d7b68a56bb186e6235e52e';
+String _$garagesalePostVmHash() => r'5aa33663d0c96ddd7ed82f68dbb36488c7db4655';
 
 /// See also [GaragesalePostVm].
 @ProviderFor(GaragesalePostVm)

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

@@ -1,4 +1,6 @@
 import 'package:cpt_community/components/comments_dialog.dart';
+import 'package:cpt_community/modules/my_following/my_follow/my_follow_vm.dart';
+import 'package:cpt_community/modules/my_following/my_follower/my_follower_vm.dart';
 import 'package:cs_resources/theme/app_colors_theme.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:flutter/material.dart';
@@ -10,26 +12,26 @@ import 'package:widgets/my_button.dart';
 import 'package:widgets/my_load_image.dart';
 import 'package:widgets/my_text_view.dart';
 
-enum MyFollowingType {
-  isFollowType,
-  isFollowerType,
-}
+import 'item_following_vm.dart';
+
 
 class MyFollowingListItem extends StatelessWidget {
-  final MyFollowingType? itemType;
+  final String itemType;
   bool? hasBottomDriver = true;
   Map<String, dynamic> itemObj;
   void Function(dynamic)? onClickAction;
   MyFollowingListItem({
     super.key,
     required this.itemObj,
-    this.itemType = MyFollowingType.isFollowType,
+    itemType,
     this.hasBottomDriver=true,
     this.onClickAction
-  });
+  }): itemType = itemType ?? MyFollowingType['isFollowType'];
 
   @override
   Widget build(BuildContext context) {
+    String avator = itemObj?['avator']??'';
+    String name = itemObj?['name']??'';
     return Column(
       children: [
         Container(
@@ -42,13 +44,13 @@ class MyFollowingListItem extends StatelessWidget {
                   mainAxisAlignment: MainAxisAlignment.start,
                   children: [
                     MyLoadImage(
-                      'https://img1.baidu.com/it/u=2743394743,692629981&fm=253&fmt=auto&app=120&f=JPEG?w=800&h=800',
+                      avator,
                       width: 65,
                       height: 65,
                       isCircle: true,
                     ),
                     MyTextView(
-                      'Chin Lan',
+                      name,
                       fontSize: 17,
                       isFontMedium: true,
                       marginLeft: 17,
@@ -59,25 +61,30 @@ class MyFollowingListItem extends StatelessWidget {
                 }),
               ),
               // _buildIsFollowButton(context),
-              HookConsumer(
+              itemType == MyFollowingType['isFollowType'] ? HookConsumer(
                 builder: (context, ref, child) {
-                  final isFollow = useState(itemObj['isFollow']);
-                  return (!isFollow.value)? MyButton(
-                    text:'+Follow',
-                    onPressed: (){
+                  final isFollow = useState<bool>(true);
+                  return  MyButton(
+                    text: isFollow.value? 'Followed':'+Follow',
+                    onPressed: () async{
+                      final vm = ref.read(itemFollowingVmProvider.notifier);
                       // todo 调用接口 然后更新状态
-                      isFollow.value = !isFollow.value;
+                      int to_user_id = itemObj['id'];
+                      bool asyncResult = await vm.handlerFollow(context, to_user_id, isFollow.value, itemType!);
+                      if(asyncResult){
+                        isFollow.value = !isFollow.value;
+                      }
                     },
-                    textColor: context.appColors.textWhite,
-                    backgroundColor: context.appColors.textPrimary,
+                    textColor: isFollow.value? context.appColors.textDarkGray : context.appColors.textWhite,
+                    side: isFollow.value?  BorderSide(color: context.appColors.textDarkGray,width: 0.5) : BorderSide.none,
+                    backgroundColor: isFollow.value? Colors.transparent :context.appColors.textPrimary,
                     fontSize: 14,
                     fontWeight: FontWeight.w400,
                     minWidth: 67.5,
                     minHeight: 30.5,
-                  ): const SizedBox.shrink();
+                  );
                 },
-              )
-
+              ): const SizedBox.shrink()
             ],
           ),
         ),

+ 54 - 0
packages/cpt_community/lib/modules/my_following/components/item_following_vm.dart

@@ -0,0 +1,54 @@
+import 'package:flutter/cupertino.dart';
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+
+import '../../../respository/common_newsfeed.dart';
+import '../my_follow/my_follow_vm.dart';
+import '../my_follower/my_follower_vm.dart';
+import 'item_following.dart';
+
+part 'item_following_vm.g.dart';
+
+
+Map<String, dynamic> MyFollowingType = {
+  "isFollowType": '1',
+  "isFollowerType": '2',
+};
+
+@riverpod
+class ItemFollowingVm extends _$ItemFollowingVm {
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
+  @override
+  build(){
+    // 引入数据仓库
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
+    final state = {};
+    Log.d("--------------------------build---------------------");
+    return state;
+  }
+
+  // 关注/取消关注
+  Future<bool> handlerFollow(BuildContext? context, int to_user_id, bool isFollow, String itemType) async{
+    Log.d("点击了 关注");
+    try {
+      final result = await commonNewsFeedRespositoryInstance.handlerFollowOrCancel({
+        "to_user_id": to_user_id,
+      });
+      if(result.isSuccess){
+        if(itemType == MyFollowingType['isFollowType']){
+          // 删除 my_follow_list 中 id 为 to_user_id 的item
+          final myFollowVm = ref.read(myFollowVmProvider.notifier);
+          myFollowVm.softDeleteItem(to_user_id);
+        }else if(itemType == MyFollowingType['isFollowerType']){
+          // final myFlowerVm = ref.read(myFollowerVmProvider.notifier);
+        }
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      Log.d("error: $error");
+      return false;
+    }
+  }
+}

+ 10 - 13
packages/cpt_community/lib/respository/garage_forrent.g.dart

@@ -1,29 +1,26 @@
 // GENERATED CODE - DO NOT MODIFY BY HAND
 
-part of 'garage_forrent.dart';
+part of 'item_following_vm.dart';
 
 // **************************************************************************
 // RiverpodGenerator
 // **************************************************************************
 
-String _$garageForRentRepositoryHash() =>
-    r'0e0e89b3bdc885e8732f7b3318964f8e0b820822';
+String _$itemFollowingVmHash() => r'8e26a6f42135b31ef85d8bfe7bd1ba2ebdd0b9a1';
 
-/// See also [garageForRentRepository].
-@ProviderFor(garageForRentRepository)
-final garageForRentRepositoryProvider =
-    Provider<GarageForRentRepository>.internal(
-  garageForRentRepository,
-  name: r'garageForRentRepositoryProvider',
+/// See also [ItemFollowingVm].
+@ProviderFor(ItemFollowingVm)
+final itemFollowingVmProvider =
+    AutoDisposeNotifierProvider<ItemFollowingVm, Object?>.internal(
+  ItemFollowingVm.new,
+  name: r'itemFollowingVmProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$garageForRentRepositoryHash,
+      : _$itemFollowingVmHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef GarageForRentRepositoryRef = ProviderRef<GarageForRentRepository>;
+typedef _$ItemFollowingVm = AutoDisposeNotifier<Object?>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 3 - 2
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_page.dart

@@ -19,6 +19,7 @@ import 'package:widgets/widget_export.dart';
 
 import '../../../router/page/community_page_router.dart';
 import '../components/item_following.dart';
+import '../components/item_following_vm.dart';
 import 'my_follow_vm.dart';
 
 @RoutePage()
@@ -153,11 +154,11 @@ class MyFollowPage extends HookConsumerWidget {
     );
   }
 
-  Widget _buildFollowItem(BuildContext context,WidgetRef ref, item, vm, index, totalIndex) {
+  Widget _buildFollowItem(BuildContext context,WidgetRef ref, Map<String, dynamic> item, vm, index, totalIndex) {
     bool isLast = index == totalIndex - 1;
     return MyFollowingListItem(
         itemObj: item,
-        itemType: MyFollowingType.isFollowType,
+        itemType: MyFollowingType['isFollowType'],
         hasBottomDriver: isLast? false : true,
         onClickAction:(itemObj){
           print("点击了  ${itemObj['name']}");

+ 0 - 9
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_state.dart

@@ -5,17 +5,11 @@ class MyFollowState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? page;
-  int? limit = 10;
-  int? count = 0;
   List<Map<String, dynamic>> list;
 
   MyFollowState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.page = 1,
-    this.limit = 10,
-    this.count = 0,
     required this.list,
   });
 
@@ -30,9 +24,6 @@ class MyFollowState {
     return MyFollowState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      page: page ?? this.page,
-      limit: limit ?? this.limit,
-      count: count ?? this.count,
       list: list ?? this.list,
     );
   }

+ 101 - 72
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.dart

@@ -1,4 +1,5 @@
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/myfollowing_list_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -6,13 +7,19 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../../respository/common_newsfeed.dart';
 import '../my_following_vm.dart';
+import '../tabs_data.dart';
 import 'my_follow_state.dart';
 
 part 'my_follow_vm.g.dart';
 
 @riverpod
 class MyFollowVm extends _$MyFollowVm {
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
 
   bool _needShowPlaceholder = false; //是否展示LoadingView
 
@@ -30,6 +37,8 @@ class MyFollowVm extends _$MyFollowVm {
 
   @override
   MyFollowState build(){
+    // 引入数据仓库
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -53,17 +62,7 @@ class MyFollowVm extends _$MyFollowVm {
   // 上拉加载 更多
   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();
   }
 
@@ -71,15 +70,13 @@ class MyFollowVm extends _$MyFollowVm {
   // 下拉刷新
   Future onRefresh() async {
     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();
   }
@@ -91,72 +88,104 @@ class MyFollowVm extends _$MyFollowVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.page}---");
-    //   try {
-    //     //请求网络
-    //     Map<String, dynamic>  params = {
-    //       "page": state.page,
-    //       "limit": state.limit,
-    //     };
-    //     Log.d("请求参数------$params");
-    //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
-    //     Log.d("请求完成结果------${result.data}");
-    //     //校验成功失败
-    //     if (result.isSuccess) {
-    //       // state = state.copyWith(serverTime: result.data);
-    //       state = state;
-    //   handleList(listResult.data?.rows);
-    //       ToastEngine.show("获取数据成功");
-    //     } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    //       ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //     }
-    //   } catch (e) {
-    //     ToastEngine.show("Error: $e");
-    //   }
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'avator': 'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'William Jefferson',
-        'isFollow': false,
-      },
-      {
-        'id':2,
-        'avator': 'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'William Jefferson',
-        'isFollow': true,
-      },
-    ];
-
-    if (state.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();
-
+    Log.d("for_sale加载listData数据---------------start--${_page}---");
+
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     'id':1,
+    //     'avator': 'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'William Jefferson',
+    //     'isFollow': false,
+    //   },
+    //   {
+    //     'id':2,
+    //     'avator': 'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'William Jefferson',
+    //     'isFollow': true,
+    //   },
+    // ];
+
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "keyword": "",
+        "page": _page,
+        "limit": _limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await commonNewsFeedRespositoryInstance.fetchMyFollowList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList(result.list as List<MyfollowingListEntity>);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
 
-    // 最后赋值
-    _needShowPlaceholder = false;
+    // 更新 my_posts_tabs 里面的数字
+    updateMyFollowingTabsNum(tabsNamesData['Follow'], state.list!.length, 0);
+  }
+
+  void handlerResultList(List<MyfollowingListEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        allList!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      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);
+      }
+    }
+  }
 
+  // 更新 my_posts_tabs 里面的数字
+  updateMyFollowingTabsNum(String key, int num, int activeTabIdx){
     WidgetsBinding.instance.addPostFrameCallback((_) {
       // 需要更新 my_posts_tabs 里面的数字
       ref.read(myFollowingVmProvider.notifier)
-          .updateMyFollowingTabsNum( 'followCount', state.list!.length, 0);
+          .updateMyFollowingTabsNum(key, num, activeTabIdx );
     });
   }
 
+  softDeleteItem(int id){
+    state.list!.removeWhere((element) => element['id'] == id);
+    state = state.copyWith(list: state.list);
+    // 更新 my_posts_tabs 里面的数字
+    updateMyFollowingTabsNum(tabsNamesData['Follow'], state.list!.length, 0);
+  }
+
   handlerSearchChange(String value){}
 
   handlerSubmitSearch(String value){}

+ 1 - 1
packages/cpt_community/lib/modules/my_following/my_follow/my_follow_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_follow_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myFollowVmHash() => r'ad3b17b9dadc3d2164fa56eda2596c2366f9a8f5';
+String _$myFollowVmHash() => r'740c4ae662c2edcebd62426a0fb7fe39804d31f8';
 
 /// See also [MyFollowVm].
 @ProviderFor(MyFollowVm)

+ 2 - 1
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_page.dart

@@ -19,6 +19,7 @@ import 'package:widgets/widget_export.dart';
 
 import '../../../router/page/community_page_router.dart';
 import '../components/item_following.dart';
+import '../components/item_following_vm.dart';
 import 'my_follower_vm.dart';
 
 @RoutePage()
@@ -157,7 +158,7 @@ class MyFollowerPage extends HookConsumerWidget {
     bool isLast = index == totalIndex - 1;
     return MyFollowingListItem(
         itemObj: item,
-        itemType: MyFollowingType.isFollowerType,
+        itemType: MyFollowingType['isFollowerType'],
         hasBottomDriver: isLast? false : true,
         onClickAction:(itemObj){
           print("点击了  ${itemObj['name']}");

+ 0 - 6
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_state.dart

@@ -13,9 +13,6 @@ class MyFollowerState {
   MyFollowerState({
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.page = 1,
-    this.limit = 10,
-    this.count = 0,
     required this.list,
   });
 
@@ -30,9 +27,6 @@ class MyFollowerState {
     return MyFollowerState(
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      page: page ?? this.page,
-      limit: limit ?? this.limit,
-      count: count ?? this.count,
       list: list ?? this.list,
     );
   }

+ 94 - 74
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.dart

@@ -1,5 +1,6 @@
 import 'package:cpt_community/modules/my_following/my_following_vm.dart';
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/myfollowing_list_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -7,13 +8,18 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../../respository/common_newsfeed.dart';
+import '../tabs_data.dart';
 import 'my_follower_state.dart';
 
 part 'my_follower_vm.g.dart';
 
 @riverpod
 class MyFollowerVm extends _$MyFollowerVm {
-
+  late CommonNewsFeedRespository commonNewsFeedRespositoryInstance;
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
   bool _needShowPlaceholder = false; //是否展示LoadingView
 
   // Refresh 控制器
@@ -30,6 +36,8 @@ class MyFollowerVm extends _$MyFollowerVm {
 
   @override
   MyFollowerState build(){
+    // 引入数据仓库
+    commonNewsFeedRespositoryInstance = ref.read(commonNewsFeedRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -57,17 +65,7 @@ class MyFollowerVm extends _$MyFollowerVm {
   // 上拉加载 更多
   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();
   }
 
@@ -75,15 +73,13 @@ class MyFollowerVm extends _$MyFollowerVm {
   // 下拉刷新
   Future onRefresh() async {
     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();
   }
@@ -95,71 +91,95 @@ class MyFollowerVm extends _$MyFollowerVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.page}---");
-    //   try {
-    //     //请求网络
-    //     Map<String, dynamic>  params = {
-    //       "page": state.page,
-    //       "limit": state.limit,
-    //     };
-    //     Log.d("请求参数------$params");
-    //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
-    //     Log.d("请求完成结果------${result.data}");
-    //     //校验成功失败
-    //     if (result.isSuccess) {
-    //       // state = state.copyWith(serverTime: result.data);
-    //       state = state;
-    //   handleList(listResult.data?.rows);
-    //       ToastEngine.show("获取数据成功");
-    //     } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    //       ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //     }
-    //   } catch (e) {
-    //     ToastEngine.show("Error: $e");
-    //   }
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'avator': 'https://iknow-pic.cdn.bcebos.com/4afbfbedab64034f6c21389bbdc379310b551dba',
-        'title': 'Steve Jobs',
-        'isFollow': false,
-      },
-      {
-        'id':2,
-        'avator': 'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'William Jefferson',
-        'isFollow': true,
-      },
-    ];
-
-    if (state.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();
-
+    Log.d("for_sale加载listData数据---------------start--${_page}---");
+
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     'id':1,
+    //     'avator': 'https://iknow-pic.cdn.bcebos.com/4afbfbedab64034f6c21389bbdc379310b551dba',
+    //     'title': 'Steve Jobs',
+    //     'isFollow': false,
+    //   },
+    //   {
+    //     'id':2,
+    //     'avator': 'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'William Jefferson',
+    //     'isFollow': true,
+    //   },
+    // ];
+
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "keyword": "",
+        "page": _page,
+        "limit": _limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await commonNewsFeedRespositoryInstance.fetchMyFlowerList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList(result.list as List<MyfollowingListEntity>);
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
 
-    // 最后赋值
-    _needShowPlaceholder = false;
+    // 更新 my_posts_tabs 里面的数字
+    updateMyFollowingTabsNum(tabsNamesData['Follower'], state.list!.length, 1);
+  }
+
+  void handlerResultList(List<MyfollowingListEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        allList!.addAll(list.map((item) => item.toJson()).toList());
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      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);
+      }
+    }
+  }
 
+  // 更新 my_posts_tabs 里面的数字
+  updateMyFollowingTabsNum(String key, int num, int activeTabIdx){
     WidgetsBinding.instance.addPostFrameCallback((_) {
       // 需要更新 my_posts_tabs 里面的数字
       ref.read(myFollowingVmProvider.notifier)
-          .updateMyFollowingTabsNum( 'followerCount', state.list!.length, 1);
+          .updateMyFollowingTabsNum(key, num, activeTabIdx );
     });
-
   }
 
   handlerSearchChange(String value){}

+ 1 - 1
packages/cpt_community/lib/modules/my_following/my_follower/my_follower_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_follower_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myFollowerVmHash() => r'94dbe2b359863bd7ea8bc90efc0b273d05aa9613';
+String _$myFollowerVmHash() => r'5587cec27d5bbd560823f5066e743168729f2044';
 
 /// See also [MyFollowerVm].
 @ProviderFor(MyFollowerVm)

+ 4 - 2
packages/cpt_community/lib/modules/my_following/my_following_state.dart

@@ -1,3 +1,5 @@
+import 'package:cpt_community/modules/my_following/tabs_data.dart';
+
 class MyFollowingState {
   List<String>? tabsList;
   int? currentPageViewIdx = 0;
@@ -14,8 +16,8 @@ class MyFollowingState {
     this.followPageIsSearchBarStatus = false,
     this.followerPageIsSearchBarStatus = false,
   }) : tabsList = tabsList ?? [
-    'Follow',
-    'Follower',
+    tabsNamesData['Follow'],
+    tabsNamesData['Follower'],
   ];
 
   MyFollowingState copyWith({

+ 6 - 3
packages/cpt_community/lib/modules/my_following/my_following_vm.dart

@@ -1,3 +1,4 @@
+import 'package:cpt_community/modules/my_following/tabs_data.dart';
 import 'package:cs_resources/generated/assets.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
@@ -39,11 +40,13 @@ class MyFollowingVm extends _$MyFollowingVm {
     tabsRouter.setActiveIndex(tabIndex);
   }
 
+  // 设置当前tab
   setCurrentTabIndex(int activeTabIdx){
     state = state.copyWith(
       activeTabIdx: activeTabIdx,
     );
   }
+
   // 改变 follow 页面navigatorbar
   handlerChangeFollowPageNavbar(bool showSearchBar){
     WidgetsBinding.instance?.addPostFrameCallback((timeStamp) {
@@ -73,14 +76,14 @@ class MyFollowingVm extends _$MyFollowingVm {
     });
   }
 
-
+  // 更新 tab 的数字
   updateMyFollowingTabsNum(String code, int num, int activeTabIdx){
-    if(code == 'followerCount'){
+    if(code == tabsNamesData['Follower']){
       state = state.copyWith(
         followerCount: num,
         activeTabIdx: activeTabIdx,
       );
-    } else if(code == 'followCount'){
+    } else if(code == tabsNamesData['Follow']){
       state = state.copyWith(
         followCount: num,
         activeTabIdx: activeTabIdx,

+ 1 - 1
packages/cpt_community/lib/modules/my_following/my_following_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_following_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myFollowingVmHash() => r'062ebd721a307fa49519a8aedffa645d04a4ce68';
+String _$myFollowingVmHash() => r'a547759c6d6dbd425d1573adc47494172a707e54';
 
 /// See also [MyFollowingVm].
 @ProviderFor(MyFollowingVm)

+ 4 - 0
packages/cpt_community/lib/modules/my_following/tabs_data.dart

@@ -0,0 +1,4 @@
+Map<String, dynamic> tabsNamesData = {
+  'Follow': 'Follow',
+  'Follower': 'Follower',
+};

+ 59 - 0
packages/cpt_community/lib/modules/my_posts/components/my_posts_sale_rent_item.dart

@@ -0,0 +1,59 @@
+import 'package:cs_resources/theme/app_colors_theme.dart';
+import 'package:flutter/cupertino.dart';
+import 'package:hooks_riverpod/hooks_riverpod.dart';
+import 'package:shared/utils/color_utils.dart';
+import 'package:shared/utils/log_utils.dart';
+
+import '../../../components/garage_card.dart';
+import 'my_posts_sale_rent_item_vm.dart';
+
+class MyPostsSaleRentItem extends HookConsumerWidget {
+  MyPostsSaleRentItem({Key? key, required this.item, required this.garageSaleType}) : super(key: key);
+
+  String garageSaleType = 'forSale';
+  final Map<String, dynamic> item;
+
+  @override
+  Widget build(BuildContext context, WidgetRef ref) {
+    final vm = ref.read(myPostsSaleRentItemVmProvider.notifier);
+    return SizedBox(
+      width: double.infinity,
+      child: Container(
+        decoration: BoxDecoration(
+          color: context.appColors.whiteBG,
+          borderRadius: BorderRadius.circular(8),
+          boxShadow: [
+            BoxShadow(
+              color: ColorUtils.string2Color('#E5E5E5'),
+              offset: const Offset(0, 2),
+              blurRadius: 8,
+            ),
+          ],
+        ),
+        child: Column(
+            mainAxisAlignment: MainAxisAlignment.start,
+            crossAxisAlignment: CrossAxisAlignment.start,
+            mainAxisSize: MainAxisSize.max,
+            children: [
+              Expanded(
+                child: GarageCard(
+                    key: UniqueKey(),
+                    useType: GarageCardUseType.myPostsForRent,
+                    itemObj: item,
+                    onClickColleciotn: (dynamic collectionValue) async {
+                      Log.d("my_posts_sale_rent_item 点击了喜欢按钮  --${item['id']}-$collectionValue");
+                      bool asyncResult = await vm.handlerGarageClickLike(item['id'], collectionValue);
+                      if(asyncResult){
+                        return true;
+                      }else {
+                        return false;
+                      }
+                    }
+                ),
+              ),
+            ]
+        ),
+      ),
+    );
+  }
+}

+ 37 - 0
packages/cpt_community/lib/modules/my_posts/components/my_posts_sale_rent_item_vm.dart

@@ -0,0 +1,37 @@
+import 'package:riverpod_annotation/riverpod_annotation.dart';
+import 'package:shared/utils/log_utils.dart';
+
+import '../../../respository/common_garage.dart';
+
+part 'my_posts_sale_rent_item_vm.g.dart';
+
+@riverpod
+class MyPostsSaleRentItemVm extends _$MyPostsSaleRentItemVm {
+  late CommonGarageRespository commonGarageRespositoryInstance;
+  @override
+  build(){
+    // 引入数据仓库
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
+    final state = {};
+    Log.d("--------------------------build---------------------");
+
+    return state;
+  }
+
+  Future<bool> handlerGarageClickLike(int garageId, bool isLike) async{
+    // 调用 fetchGarageColleciton
+    try{
+      Map<String, dynamic> params = {
+        "id": garageId,
+      };
+      final result = await commonGarageRespositoryInstance.fetchGarageColleciton(params);
+      if(result.isSuccess){
+        return true;
+      }else {
+        return false;
+      }
+    }catch(error){
+      return false;
+    }
+  }
+}

+ 11 - 13
packages/cpt_property/lib/modules/ioan/property_ioan_repository.g.dart

@@ -1,29 +1,27 @@
 // GENERATED CODE - DO NOT MODIFY BY HAND
 
-part of 'property_ioan_repository.dart';
+part of 'my_posts_sale_rent_item_vm.dart';
 
 // **************************************************************************
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertyIoanRepositoryHash() =>
-    r'a6733dbd000218cbd4eb05a400ca497ffbebb7aa';
+String _$myPostsSaleRentItemVmHash() =>
+    r'0c2db008cc9f0151beaaa257c259f8a104c4ac09';
 
-/// See also [propertyIoanRepository].
-@ProviderFor(propertyIoanRepository)
-final propertyIoanRepositoryProvider =
-    Provider<PropertyIoanRepository>.internal(
-  propertyIoanRepository,
-  name: r'propertyIoanRepositoryProvider',
+/// See also [MyPostsSaleRentItemVm].
+@ProviderFor(MyPostsSaleRentItemVm)
+final myPostsSaleRentItemVmProvider =
+    AutoDisposeNotifierProvider<MyPostsSaleRentItemVm, Object?>.internal(
+  MyPostsSaleRentItemVm.new,
+  name: r'myPostsSaleRentItemVmProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$propertyIoanRepositoryHash,
+      : _$myPostsSaleRentItemVmHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef PropertyIoanRepositoryRef = ProviderRef<PropertyIoanRepository>;
+typedef _$MyPostsSaleRentItemVm = AutoDisposeNotifier<Object?>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 4 - 41
packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_page.dart

@@ -19,6 +19,7 @@ import 'package:widgets/widget_export.dart';
 import '../../../components/garage_card.dart';
 import '../../../components/newfeed_card_header.dart';
 import '../../../router/page/community_page_router.dart';
+import '../components/my_posts_sale_rent_item.dart';
 import 'my_posts_forrent_vm.dart';
 
 @RoutePage()
@@ -85,9 +86,9 @@ class MyPostsForRentPage extends HookConsumerWidget {
                   ),
                   delegate: SliverChildBuilderDelegate(
                         (context, index) {
-                      return  _buildMyPostsForRentItem(context, ref, state.list[index], vm).onTap((){
-                        vm.handlerGotoDetail(state.list[index]['id']);
-                      });
+                          return MyPostsSaleRentItem(item: state.list[index],garageSaleType: 'forRent').onTap((){
+                            vm.handlerGotoDetail(state.list[index]['id']);
+                          });
                     },
                     childCount: state.list.length,
                   ),
@@ -98,42 +99,4 @@ class MyPostsForRentPage extends HookConsumerWidget {
       ),
     );
   }
-
-  Widget _buildMyPostsForRentItem(BuildContext context, WidgetRef ref, item, vm){
-    return SizedBox(
-      width: double.infinity,
-      child: Container(
-        decoration: BoxDecoration(
-          color: context.appColors.whiteBG,
-          borderRadius: BorderRadius.circular(8),
-          boxShadow: [
-            BoxShadow(
-              color: ColorUtils.string2Color('#E5E5E5'),
-              offset: const Offset(0, 2),
-              blurRadius: 8,
-            ),
-          ],
-        ),
-        child: Column(
-            mainAxisAlignment: MainAxisAlignment.start,
-            crossAxisAlignment: CrossAxisAlignment.start,
-            mainAxisSize: MainAxisSize.max,
-            children: [
-              // 卡片头部(头像 标题 时间)
-              Expanded(
-                child: GarageCard(
-                    key: UniqueKey(),
-                    useType: GarageCardUseType.myPostsForRent,
-                    itemObj: item,
-                    onClickColleciotn: (dynamic collectionValue){
-                      Log.d("点击了收藏按钮  --${item['id']}-$collectionValue");
-                      return true;
-                    }
-                ),
-              ),
-            ]
-        ),
-      ),
-    );
-  }
 }

+ 134 - 117
packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.dart

@@ -1,5 +1,6 @@
 import 'package:cpt_community/modules/my_posts/my_posts_vm.dart';
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/myposts_sale_rent_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -8,6 +9,7 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 
+import '../../../respository/common_garage.dart';
 import '../../../router/page/community_page_router.dart';
 import 'my_posts_forrent_respository.dart';
 import 'my_posts_forrent_state.dart';
@@ -16,8 +18,12 @@ part 'my_posts_forrent_vm.g.dart';
 
 @riverpod
 class MyPostsForRentVm extends _$MyPostsForRentVm {
-  // late MyPostsForRentRepository MyPostsForRentRepositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
+  late BuildContext _currentPageContext;
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
 
   // Refresh 控制器
   final EasyRefreshController refreshController = EasyRefreshController(
@@ -31,10 +37,14 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
     );
   }
 
+  setCurrentPageContext(BuildContext context){
+    _currentPageContext = context;
+  }
+
   @override
   MyPostsForRentState build(){
     // 引入数据仓库
-    // MyPostsForRentRepositoryInstance = ref.read(newsRepositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -59,17 +69,7 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
   // 上拉加载 更多
   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();
   }
 
@@ -77,15 +77,13 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
   // 下拉刷新
   Future onRefresh() async {
     Log.d("----forrent_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();
   }
@@ -97,115 +95,134 @@ class MyPostsForRentVm extends _$MyPostsForRentVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.page}---");
-    //   try {
-    //     //请求网络
-    //     Map<String, dynamic>  params = {
-    //       "page": state.page,
-    //       "limit": state.limit,
-    //     };
-    //     Log.d("请求参数------$params");
-    //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
-    //     Log.d("请求完成结果------${result.data}");
-    //     //校验成功失败
-    //     if (result.isSuccess) {
-    //       // state = state.copyWith(serverTime: result.data);
-    //       state = state;
-    //   handleList(listResult.data?.rows);
-    //       ToastEngine.show("获取数据成功");
-    //     } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    //       ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //     }
-    //   } catch (e) {
-    //     ToastEngine.show("Error: $e");
-    //   }
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$66',
-        'isCollection': true,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':2,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$88',
-        'isCollection': false,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':3,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$66',
-        'isCollection': true,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-    ];
-
-    if (state.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();
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     'id':1,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$66',
+    //     'isCollection': true,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':2,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$88',
+    //     'isCollection': false,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':3,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$66',
+    //     'isCollection': true,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    // ];
+    //
+    // 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();
+    // }
+
+    try {
+      //请求网络
+      Map<String, dynamic>  params = {
+        "type": 2,  // 类型(1=Sale,2=Rent)
+        "page": _page,
+        "limit": _limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await commonGarageRespositoryInstance.fetchMyPostsGarageDataList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.list as List<MypostsSaleRentEntity>));
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
 
-    WidgetsBinding.instance.addPostFrameCallback((_) {
-      // 需要更新 my_posts_tabs 里面的数字
-      ref.read(myPostsVmProvider.notifier).updateMyPostsTabsNum( 'forRent', state.list.length, 2);
-    });
+    // 需要更新 my_posts_tabs 里面的数字
+    updateMyFollowingTabsNum('forRent', state.list.length, 2);
 
-    // 最后赋值
-    _needShowPlaceholder = false;
   }
 
-
-  // 点击 like comments  share
-  void handlerClickActionBtn(String? actionStr, item){
-    final id = item['id'];
-    switch (actionStr) {
-      case 'like':
-        Log.d("点击了 点赞");
-        handlerGotoDetail(id);
-        break;
-      case 'comments':
-        Log.d("点击了 评论");
-        handlerGotoDetail(id);
-        break;
-      case 'share':
-        Log.d("点击了 分享");
-        handlerGotoDetail(id);
-        break;
-      default:
-        break;
+  void handlerResultList(List<MypostsSaleRentEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      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);
+      }
     }
   }
+
+
+  // 更新 my_posts_tabs 里面的数字
+  updateMyFollowingTabsNum(String key, int num, int activeTabIdx){
+    WidgetsBinding.instance.addPostFrameCallback((_) {
+      // 需要更新 my_posts_tabs 里面的数字
+      ref.read(myPostsVmProvider.notifier)
+          .updateMyPostsTabsNum(key, num, activeTabIdx );
+    });
+  }
   // 去详情页面
   void handlerGotoDetail(id){
     Log.d("去详情页面");
-    appRouter.push(GaragesaleDetailPageRoute(id: id, type: 'forrent'));
+    appRouter.push(GaragesaleDetailPageRoute(id: id, type: 'forRent'));
   }
 }

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_forrent/my_posts_forrent_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_posts_forrent_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myPostsForRentVmHash() => r'ee3f8fee8a2c0b11102959d0c9800622a8957b75';
+String _$myPostsForRentVmHash() => r'272c5370f64f4ecc7ca4544a3ee819518b62b06e';
 
 /// See also [MyPostsForRentVm].
 @ProviderFor(MyPostsForRentVm)

+ 3 - 40
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_page.dart

@@ -19,6 +19,7 @@ import 'package:widgets/widget_export.dart';
 import '../../../components/garage_card.dart';
 import '../../../components/newfeed_card_header.dart';
 import '../../../router/page/community_page_router.dart';
+import '../components/my_posts_sale_rent_item.dart';
 import 'my_posts_forsale_vm.dart';
 
 @RoutePage()
@@ -86,8 +87,8 @@ class MyPostsForSalePage extends HookConsumerWidget {
                   ),
                   delegate: SliverChildBuilderDelegate(
                         (context, index) {
-                      return  _buildMyPostsForSaleItem(context, ref, state.list[index], vm).onTap((){
-                        vm.handlerGotoDetail(state.list[index]['id']);
+                      return MyPostsSaleRentItem(item: state.list[index], garageSaleType: 'forSale').onTap((){
+                        vm.handlerGotoDetail(state.list[index]['id'], );
                       });
                     },
                     childCount: state.list.length,
@@ -99,42 +100,4 @@ class MyPostsForSalePage extends HookConsumerWidget {
       ),
     );
   }
-
-  Widget _buildMyPostsForSaleItem(BuildContext context, WidgetRef ref, item, vm){
-    return SizedBox(
-      width: double.infinity,
-      child: Container(
-        decoration: BoxDecoration(
-          color: context.appColors.whiteBG,
-          borderRadius: BorderRadius.circular(8),
-          boxShadow: [
-            BoxShadow(
-              color: ColorUtils.string2Color('#E5E5E5'),
-              offset: const Offset(0, 2),
-              blurRadius: 8,
-            ),
-          ],
-        ),
-        child: Column(
-            mainAxisAlignment: MainAxisAlignment.start,
-            crossAxisAlignment: CrossAxisAlignment.start,
-            mainAxisSize: MainAxisSize.max,
-            children: [
-              // 卡片头部(头像 标题 时间)
-              Expanded(
-                child: GarageCard(
-                    key: UniqueKey(),
-                    useType: GarageCardUseType.myPostsForSale,
-                    itemObj: item,
-                    onClickColleciotn: (dynamic collectionValue){
-                      Log.d("点击了收藏按钮  --${item['id']}-$collectionValue");
-                      return true;
-                    }
-                ),
-              ),
-            ]
-        ),
-      ),
-    );
-  }
 }

+ 0 - 18
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_state.dart

@@ -6,9 +6,6 @@ class MyPostsForSaleState {
   LoadState loadingState;
   String? errorMessage;
 
-  int? page;
-  int? limit = 10;
-  int? count = 0;
   List<Map<String, dynamic>> list;
 
   List<String>? tabsList = ['For Sale', 'For Rent'];
@@ -17,9 +14,6 @@ class MyPostsForSaleState {
     this.activeTabIndex,
     this.loadingState = LoadState.State_Loading,
     String? errorMessage,
-    this.page = 1,
-    this.limit = 10,
-    this.count = 0,
     required this.list,
     this.tabsList,
   });
@@ -28,9 +22,6 @@ class MyPostsForSaleState {
     int? activeTabIndex,
     LoadState? loadingState,
     String? errorMessage,
-    int? page,
-    int? limit,
-    int? count,
     List<Map<String, dynamic>>? list,
     List<String>? tabsList,
   }) {
@@ -38,9 +29,6 @@ class MyPostsForSaleState {
       activeTabIndex: activeTabIndex ?? this.activeTabIndex,
       loadingState: loadingState ?? this.loadingState,
       errorMessage: errorMessage ?? this.errorMessage,
-      page: page ?? this.page,
-      limit: limit ?? this.limit,
-      count: count ?? this.count,
       tabsList: tabsList ?? this.tabsList,
       list: list ?? this.list,
     );
@@ -51,9 +39,6 @@ class MyPostsForSaleState {
       'activeTabIndex': this.activeTabIndex,
       'loadingState': this.loadingState,
       'errorMessage': this.errorMessage,
-      'page': this.page,
-      'limit': this.limit,
-      'count': this.count,
       'list': this.list,
       'tabsList': this.tabsList,
     };
@@ -64,9 +49,6 @@ class MyPostsForSaleState {
       activeTabIndex: map['activeTabIndex'] as int,
       loadingState: map['loadingState'] as LoadState,
       errorMessage: map['errorMessage'] as String,
-      page: map['page'] as int,
-      limit: map['limit'] as int,
-      count: map['count'] as int,
       list: map['list'] as List<Map<String, dynamic>>,
       tabsList: map['tabsList'] as List<String>,
     );

+ 166 - 149
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.dart

@@ -1,5 +1,7 @@
 import 'package:cpt_community/modules/my_posts/my_posts_vm.dart';
+import 'package:cpt_community/respository/common_garage.dart';
 import 'package:cs_resources/generated/assets.dart';
+import 'package:domain/entity/myposts_sale_rent_entity.dart';
 import 'package:flutter/cupertino.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -17,8 +19,11 @@ part 'my_posts_forsale_vm.g.dart';
 
 @riverpod
 class MyPostsForSaleVm extends _$MyPostsForSaleVm {
-  // late MyPostsForSaleRepository MyPostsForSaleRepositoryInstance;
+  late CommonGarageRespository commonGarageRespositoryInstance;
   late BuildContext _currentPageContext;
+  int _page = 1;  // 当前页
+  int _limit = 10; // 每页数量
+  int _count = 0; // 总条数
 
   bool _needShowPlaceholder = false; //是否展示LoadingView
 
@@ -37,7 +42,7 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
   @override
   MyPostsForSaleState build(){
     // 引入数据仓库
-    // MyPostsForSaleRepositoryInstance = ref.read(newsRepositoryProvider);
+    commonGarageRespositoryInstance = ref.read(commonGarageRespositoryProvider);
     final state = initState();
     Log.d("--------------------------build---------------------");
 
@@ -65,17 +70,7 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
   // 上拉加载 更多
   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();
   }
 
@@ -84,14 +79,13 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
   Future onRefresh() async {
     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();
   }
@@ -103,150 +97,173 @@ class MyPostsForSaleVm extends _$MyPostsForSaleVm {
       changeLoadingState(LoadState.State_Loading, null);
     }
 
-    Log.d("for_sale加载listData数据---------------start--${state.page}---");
-    //   try {
-    //     //请求网络
-    //     Map<String, dynamic>  params = {
-    //       "page": state.page,
-    //       "limit": state.limit,
-    //     };
-    //     Log.d("请求参数------$params");
-    //     final result = await propertyNewsRepository.fetchPropertyNewsList(params);
-    //     Log.d("请求完成结果------${result.data}");
-    //     //校验成功失败
-    //     if (result.isSuccess) {
-    //       // state = state.copyWith(serverTime: result.data);
-    //       state = state;
-    //   handleList(listResult.data?.rows);
-    //       ToastEngine.show("获取数据成功");
-    //     } else {
-    //   errorMessage = listResult.errorMsg;
-    //   changeLoadingState(LoadState.State_Error);
-    //       ToastEngine.show(result.errorMsg ?? "Network Load Error");
-    //     }
-    //   } catch (e) {
-    //     ToastEngine.show("Error: $e");
-    //   }
-
-    await Future.delayed(const Duration(milliseconds: 1500));
-    final List<Map<String, dynamic>> listData = [
-      {
-        'id':1,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$66',
-        'isCollection': true,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':2,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$88',
-        'isCollection': false,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':3,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$66',
-        'isCollection': true,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':4,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$88',
-        'isCollection': false,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':5,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$66',
-        'isCollection': true,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-      {
-        'id':6,
-        'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
-        'title': 'Electronic keyboard',
-        'price': '\$88',
-        'isCollection': false,
-        'collection_num': 12,
-        'publisher': 'William Jefferson',
-        'publish_time': 'June 17,2016 at 7:23 p.m.',
-        'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
-      },
-    ];
-
-    if (state.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();
+
+    // await Future.delayed(const Duration(milliseconds: 1500));
+    // final List<Map<String, dynamic>> listData = [
+    //   {
+    //     'id':1,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$66',
+    //     'isCollection': true,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':2,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$88',
+    //     'isCollection': false,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':3,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$66',
+    //     'isCollection': true,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':4,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$88',
+    //     'isCollection': false,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':5,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$66',
+    //     'isCollection': true,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    //   {
+    //     'id':6,
+    //     'goods_img':  'https://img2.baidu.com/it/u=3489233687,2364672159&fm=253&fmt=auto&app=120&f=JPEG?w=507&h=500',
+    //     'title': 'Electronic keyboard',
+    //     'price': '\$88',
+    //     'isCollection': false,
+    //     'collection_num': 12,
+    //     'publisher': 'William Jefferson',
+    //     'publish_time': 'June 17,2016 at 7:23 p.m.',
+    //     'publisher_avator': 'https://img1.baidu.com/it/u=3890726495,1572750319&fm=253&fmt=auto&app=120&f=JPEG?w=500&h=500'
+    //   },
+    // ];
+    //
+    // 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 = {
+        "type": 1,  // 类型(1=Sale,2=Rent)
+        "page": _page,
+        "limit": _limit,
+      };
+      Log.d("请求参数------$params");
+      final result = await commonGarageRespositoryInstance.fetchMyPostsGarageDataList(params);
+      //校验成功失败
+      if (result.isSuccess) {
+        handlerResultList((result.list as List<MypostsSaleRentEntity>));
+      } else {
+        String errorMessage = result.errorMsg!;
+        changeLoadingState(LoadState.State_Error, errorMessage);
+        ToastEngine.show(result.errorMsg ?? "Network Load Error");
+      }
+    } catch (e) {
+      ToastEngine.show("Error: $e");
     }
 
 
-    WidgetsBinding.instance.addPostFrameCallback((_) {
-        // 需要更新 my_posts_tabs 里面的数字
-      ref.read(myPostsVmProvider.notifier)
-          .updateMyPostsTabsNum( 'forSale', state.list.length, 1);
-    });
+    // 需要更新 my_posts_tabs 里面的数字
+    updateMyFollowingTabsNum('forSale', state.list.length, 1);
 
-    // 最后赋值
-    _needShowPlaceholder = false;
   }
 
 
-  // 点击 like comments  share
-  void handlerClickActionBtn(String? actionStr, item){
-    final id = item['id'];
-    switch (actionStr) {
-      case 'like':
-        Log.d("点击了 点赞");
-        handlerGotoDetail(id);
-        break;
-      case 'comments':
-        Log.d("点击了 评论");
-        handlerGotoDetail(id);
-        break;
-      case 'share':
-        Log.d("点击了 分享");
-        handlerGotoDetail(id);
-        break;
-      default:
-        break;
+  void handlerResultList(List<MypostsSaleRentEntity>? list) {
+    if (list != null && list.isNotEmpty) {
+      //有数据,判断是刷新还是加载更多的数据
+      if (_page == 1) {
+        //刷新的方式
+        state.list!.clear();
+        state.list!.addAll(list.map((item) => item.toJson()).toList());
+        refreshController.finishRefresh();
+
+        //更新展示的状态
+        changeLoadingState(LoadState.State_Success, null);
+      } else {
+        //加载更多
+        final allList = state.list;
+        state = state.copyWith(list: allList);
+        refreshController.finishLoad();
+      }
+    } else {
+      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);
+      }
     }
   }
+
+
+  // 更新 my_posts_tabs 里面的数字
+  updateMyFollowingTabsNum(String key, int num, int activeTabIdx){
+    WidgetsBinding.instance.addPostFrameCallback((_) {
+      // 需要更新 my_posts_tabs 里面的数字
+      ref.read(myPostsVmProvider.notifier)
+          .updateMyPostsTabsNum(key, num, activeTabIdx );
+    });
+  }
+
   // 去详情页面
   void handlerGotoDetail(id){
     Log.d("去详情页面");
-    appRouter.push(GaragesaleDetailPageRoute(id: id, type: 'forsale'));
+    appRouter.push(GaragesaleDetailPageRoute(id: id, type: 'forSale'));
   }
 }

+ 1 - 1
packages/cpt_community/lib/modules/my_posts/my_posts_forsale/my_posts_forsale_vm.g.dart

@@ -6,7 +6,7 @@ part of 'my_posts_forsale_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$myPostsForSaleVmHash() => r'e5d86704c4d68a8ba887e740bd37ffa1ff816b6a';
+String _$myPostsForSaleVmHash() => r'd2200e3a70ccfc082e46550e378d2df9ea437296';
 
 /// See also [MyPostsForSaleVm].
 @ProviderFor(MyPostsForSaleVm)

+ 66 - 5
packages/cpt_community/lib/respository/common_garage.dart

@@ -1,8 +1,11 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
 import 'package:domain/entity/garage_sale_rent_entity.dart';
+import 'package:domain/entity/myposts_sale_rent_entity.dart';
 import 'package:domain/entity/newsfeed_foryou_entity.dart';
 import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
 import 'package:plugin_platform/http/http_result.dart';
@@ -17,18 +20,18 @@ import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 part 'common_garage.g.dart';
 
 @Riverpod(keepAlive: true)
-CommonGarageRepository commonGarageRepository(Ref ref) {
+CommonGarageRespository commonGarageRespository(Ref ref) {
   final dioEngine = ref.watch(dioEngineProvider);
-  return CommonGarageRepository(dioEngine: dioEngine);
+  return CommonGarageRespository(dioEngine: dioEngine);
 }
 
 /*
  * 数据仓库
  */
-class CommonGarageRepository {
+class CommonGarageRespository {
   DioEngine dioEngine;
 
-  CommonGarageRepository({required this.dioEngine});
+  CommonGarageRespository({required this.dioEngine});
 
   // garage 获取 分类 字典
   Future<HttpResult<Object>> fetchGarageCateGoryList(
@@ -59,6 +62,10 @@ class CommonGarageRepository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -92,10 +99,52 @@ class CommonGarageRepository {
       List<GarageSaleRentEntity> data = json?.map((item) => GarageSaleRentEntity.fromJson(item)).toList() ?? [];
       //重新赋值data或list
       return result.convert(list: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
 
+  // myposts 中 garage 获取 列表
+  Future<HttpResult<Object>> fetchMyPostsGarageDataList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/me/post/garage-sale', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getListJson();
+      List<MypostsSaleRentEntity> data = json?.map((item) => MypostsSaleRentEntity.fromJson(item)).toList() ?? [];
+      //重新赋值data或list
+      return result.convert(list: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+
   // garage 点赞/取消点赞
   Future<HttpResult<Object>> fetchGarageColleciton(
       Map<String, dynamic>? data, {
@@ -124,6 +173,10 @@ class CommonGarageRepository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -157,6 +210,10 @@ class CommonGarageRepository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -187,9 +244,13 @@ class CommonGarageRepository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      // var data = NewsfeedDetailEntity.fromJson(json!);
+      var data = GarageSaleRentDetailEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }

+ 10 - 10
packages/cpt_community/lib/respository/common_garage.g.dart

@@ -6,24 +6,24 @@ part of 'common_garage.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$commonGarageRepositoryHash() =>
-    r'199096291467a0d278f3cf67b41ed86653297831';
+String _$commonGarageRespositoryHash() =>
+    r'116b7b036198559326ab4561acbca6d657a261ab';
 
-/// See also [commonGarageRepository].
-@ProviderFor(commonGarageRepository)
-final commonGarageRepositoryProvider =
-    Provider<CommonGarageRepository>.internal(
-  commonGarageRepository,
-  name: r'commonGarageRepositoryProvider',
+/// See also [commonGarageRespository].
+@ProviderFor(commonGarageRespository)
+final commonGarageRespositoryProvider =
+    Provider<CommonGarageRespository>.internal(
+  commonGarageRespository,
+  name: r'commonGarageRespositoryProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$commonGarageRepositoryHash,
+      : _$commonGarageRespositoryHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
 @Deprecated('Will be removed in 3.0. Use Ref instead')
 // ignore: unused_element
-typedef CommonGarageRepositoryRef = ProviderRef<CommonGarageRepository>;
+typedef CommonGarageRespositoryRef = ProviderRef<CommonGarageRespository>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 291 - 11
packages/cpt_community/lib/respository/common_newsfeed.dart

@@ -1,7 +1,12 @@
 import 'package:domain/constants/api_constants.dart';
+import 'package:domain/entity/myfollowing_list_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';
 import 'package:domain/entity/newsfeed_foryou_entity.dart';
 import 'package:domain/entity/newsfeed_news_entity.dart';
 import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
 import 'package:plugin_platform/http/http_result.dart';
@@ -16,22 +21,58 @@ import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 part 'common_newsfeed.g.dart';
 
 @Riverpod(keepAlive: true)
-CommonNewsFeedRepository commonNewsFeedRepository(Ref ref) {
+CommonNewsFeedRespository commonNewsFeedRespository(Ref ref) {
   final dioEngine = ref.watch(dioEngineProvider);
-  return CommonNewsFeedRepository(dioEngine: dioEngine);
+  return CommonNewsFeedRespository(dioEngine: dioEngine);
 }
 
 /*
  * 数据仓库
  */
-class CommonNewsFeedRepository {
+class CommonNewsFeedRespository {
   DioEngine dioEngine;
 
-  CommonNewsFeedRepository({required this.dioEngine});
+  CommonNewsFeedRespository({required this.dioEngine});
 
+  // news feed - news 列表
+  Future<HttpResult<Object>> fetchNewsList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
 
-  // 获取 我关注的人
-  Future<HttpResult<Object>> fetchMyFollowList(
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/feed/news', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedNewsEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // news feed - following 列表
+  Future<HttpResult<Object>> fetchFollowingList(
       Map<String, dynamic>? data, {
         CancelToken? cancelToken,
       }) async {
@@ -43,7 +84,7 @@ class CommonNewsFeedRepository {
 
     final result = await dioEngine.requestNetResult(
       // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/me/index/follows', // api 地址
+      '/api/v1/user/news-feed/feed/following', // api 地址
       params: params,
       headers: headers,
       method: HttpMethod.GET,
@@ -56,16 +97,203 @@ class CommonNewsFeedRepository {
     if (result.isSuccess) {
       //重新赋值data或list
       final json = result.getDataJson();
-      // var data = NewsfeedForyouEntity.fromJson(json!);
+      var data = NewsfeedFollowingEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // news feed - foryou 列表
+  Future<HttpResult<Object>> fetchForyouList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/feed/for-you', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedForyouEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // 获取 详情信息
+  Future<HttpResult<Object>> fetchNewsFeedDetailInfo(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/feed/detail', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedDetailEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // 提交评论
+  Future<HttpResult<Object>> fetchNewsfeedCommentSubmit(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/comment/publish', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = NewsfeedCommentPublishEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // news feed - post 发布newsfeed
+  Future<HttpResult<Object>> fetchNewsfeedPublish(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/index/publish', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      // var data = NewsfeedCommentPublishEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
 
 
+  // 获取 我关注的人
+  Future<HttpResult<Object>> fetchMyFollowList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/me/index/follows', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final ListJson = result.getListJson();
+      var data = ListJson!.map((e) => MyfollowingListEntity.fromJson(e!)).toList();
+      //重新赋值data或list
+      return result.convert(list: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
   // 获取 关注我的人
-  Future<HttpResult<Object>> fetchMyFollowerList(
+  Future<HttpResult<Object>> fetchMyFlowerList(
       Map<String, dynamic>? data, {
         CancelToken? cancelToken,
       }) async {
@@ -89,10 +317,50 @@ class CommonNewsFeedRepository {
     //根据返回的结果,封装原始数据为Bean/Entity对象
     if (result.isSuccess) {
       //重新赋值data或list
-      final json = result.getDataJson();
+      final ListJson = result.getListJson();
+      var data = ListJson!.map((e) => MyfollowingListEntity.fromJson(e!)).toList();
+      //重新赋值data或list
+      return result.convert(list: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // news feed 点赞/取消点赞
+  Future<HttpResult<Object>> fetchLikeClick(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+    params = data!;
+    Map<String, String> headers = {};
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/news-feed/like/click', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.POST,
+      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final boolData = result.getDataDynamic();
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
-      return result.convert(data: json);
+      return result.convert(data: boolData);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -125,6 +393,10 @@ class CommonNewsFeedRepository {
       // var data = NewsfeedForyouEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: json);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -158,6 +430,10 @@ class CommonNewsFeedRepository {
       // var data = NewsfeedDetailEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -191,6 +467,10 @@ class CommonNewsFeedRepository {
       // var data = NewsfeedDetailEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }

+ 10 - 10
packages/cpt_community/lib/respository/common_newsfeed.g.dart

@@ -6,24 +6,24 @@ part of 'common_newsfeed.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$commonNewsFeedRepositoryHash() =>
-    r'8c22848ea8fb7c019bf85c24fab543fc703d17ac';
+String _$commonNewsFeedRespositoryHash() =>
+    r'c21dbbacfe42a102f5addcb11433a2398e7301d4';
 
-/// See also [commonNewsFeedRepository].
-@ProviderFor(commonNewsFeedRepository)
-final commonNewsFeedRepositoryProvider =
-    Provider<CommonNewsFeedRepository>.internal(
-  commonNewsFeedRepository,
-  name: r'commonNewsFeedRepositoryProvider',
+/// See also [commonNewsFeedRespository].
+@ProviderFor(commonNewsFeedRespository)
+final commonNewsFeedRespositoryProvider =
+    Provider<CommonNewsFeedRespository>.internal(
+  commonNewsFeedRespository,
+  name: r'commonNewsFeedRespositoryProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$commonNewsFeedRepositoryHash,
+      : _$commonNewsFeedRespositoryHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
 @Deprecated('Will be removed in 3.0. Use Ref instead')
 // ignore: unused_element
-typedef CommonNewsFeedRepositoryRef = ProviderRef<CommonNewsFeedRepository>;
+typedef CommonNewsFeedRespositoryRef = ProviderRef<CommonNewsFeedRespository>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 0 - 99
packages/cpt_community/lib/respository/garage_forrent.dart

@@ -1,99 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_foryou_entity.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'garage_forrent.g.dart';
-
-@Riverpod(keepAlive: true)
-GarageForRentRepository garageForRentRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return GarageForRentRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class GarageForRentRepository {
-  DioEngine dioEngine;
-
-  GarageForRentRepository({required this.dioEngine});
-
-  // news feed - news 列表
-  Future<HttpResult<Object>> fetchForyouList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/feed/for-you', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  // news feed -news 点赞/取消点赞
-  Future<HttpResult<Object>> fetchLikeClick(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/like/click', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final boolData = result.getDataDynamic();
-      // var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: boolData);
-    }
-    return result.convert();
-  }
-
-
-
-}

+ 0 - 99
packages/cpt_community/lib/respository/garage_forsale.dart

@@ -1,99 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_foryou_entity.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'garage_forsale.g.dart';
-
-@Riverpod(keepAlive: true)
-GarageForSaleRepository garageForSaleRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return GarageForSaleRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class GarageForSaleRepository {
-  DioEngine dioEngine;
-
-  GarageForSaleRepository({required this.dioEngine});
-
-  // news feed - news 列表
-  Future<HttpResult<Object>> fetchForyouList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/feed/for-you', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  // news feed -news 点赞/取消点赞
-  Future<HttpResult<Object>> fetchLikeClick(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/like/click', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final boolData = result.getDataDynamic();
-      // var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: boolData);
-    }
-    return result.convert();
-  }
-
-
-
-}

+ 0 - 29
packages/cpt_community/lib/respository/garage_forsale.g.dart

@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'garage_forsale.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$garageForSaleRepositoryHash() =>
-    r'3601311b39f7301210b9e034a305bdb013fc87df';
-
-/// See also [garageForSaleRepository].
-@ProviderFor(garageForSaleRepository)
-final garageForSaleRepositoryProvider =
-    Provider<GarageForSaleRepository>.internal(
-  garageForSaleRepository,
-  name: r'garageForSaleRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$garageForSaleRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef GarageForSaleRepositoryRef = ProviderRef<GarageForSaleRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 0 - 99
packages/cpt_community/lib/respository/newsfeed_detail_repository.dart

@@ -1,99 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
-import 'package:domain/entity/newsfeed_detail_entity.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'newsfeed_detail_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-NewsFeedDetailRepository newsFeedDetailRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return NewsFeedDetailRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class NewsFeedDetailRepository {
-  DioEngine dioEngine;
-
-  NewsFeedDetailRepository({required this.dioEngine});
-
-  // 获取 详情信息
-  Future<HttpResult<Object>> fetchNewsFeedDetailInfo(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/feed/detail', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedDetailEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  // 提交评论
-  Future<HttpResult<Object>> fetchNewsfeedCommentSubmit(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/comment/publish', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedCommentPublishEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  
-}

+ 0 - 29
packages/cpt_community/lib/respository/newsfeed_detail_repository.g.dart

@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'newsfeed_detail_repository.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$newsFeedDetailRepositoryHash() =>
-    r'921d0c9185be5eb5f9b78da90b5d470cb1fbf3aa';
-
-/// See also [newsFeedDetailRepository].
-@ProviderFor(newsFeedDetailRepository)
-final newsFeedDetailRepositoryProvider =
-    Provider<NewsFeedDetailRepository>.internal(
-  newsFeedDetailRepository,
-  name: r'newsFeedDetailRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$newsFeedDetailRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef NewsFeedDetailRepositoryRef = ProviderRef<NewsFeedDetailRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 0 - 99
packages/cpt_community/lib/respository/newsfeed_following_repository.dart

@@ -1,99 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_following_entity.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'newsfeed_following_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-NewsFeedFollowingRepository newsFeedFollowingRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return NewsFeedFollowingRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class NewsFeedFollowingRepository {
-  DioEngine dioEngine;
-
-  NewsFeedFollowingRepository({required this.dioEngine});
-
-  // news feed - news 列表
-  Future<HttpResult<Object>> fetchFollowingList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/feed/following', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedFollowingEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  // news feed -news 点赞/取消点赞
-  Future<HttpResult<Object>> fetchLikeClick(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/like/click', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final boolData = result.getDataDynamic();
-      // var data = NewsfeedFollowingEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: boolData);
-    }
-    return result.convert();
-  }
-
-
-
-}

+ 0 - 30
packages/cpt_community/lib/respository/newsfeed_following_repository.g.dart

@@ -1,30 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'newsfeed_following_repository.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$newsFeedFollowingRepositoryHash() =>
-    r'5104ae97a6afb5f318af1a102e5ed3c8f85523d2';
-
-/// See also [newsFeedFollowingRepository].
-@ProviderFor(newsFeedFollowingRepository)
-final newsFeedFollowingRepositoryProvider =
-    Provider<NewsFeedFollowingRepository>.internal(
-  newsFeedFollowingRepository,
-  name: r'newsFeedFollowingRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$newsFeedFollowingRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef NewsFeedFollowingRepositoryRef
-    = ProviderRef<NewsFeedFollowingRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 0 - 99
packages/cpt_community/lib/respository/newsfeed_foryou_repository.dart

@@ -1,99 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_foryou_entity.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'newsfeed_foryou_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-NewsFeedForyouRepository newsFeedForyouRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return NewsFeedForyouRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class NewsFeedForyouRepository {
-  DioEngine dioEngine;
-
-  NewsFeedForyouRepository({required this.dioEngine});
-
-  // news feed - news 列表
-  Future<HttpResult<Object>> fetchForyouList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/feed/for-you', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  // news feed -news 点赞/取消点赞
-  Future<HttpResult<Object>> fetchLikeClick(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/like/click', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final boolData = result.getDataDynamic();
-      // var data = NewsfeedForyouEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: boolData);
-    }
-    return result.convert();
-  }
-
-
-
-}

+ 0 - 29
packages/cpt_community/lib/respository/newsfeed_foryou_repository.g.dart

@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'newsfeed_foryou_repository.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$newsFeedForyouRepositoryHash() =>
-    r'71ac847dc2c3d53094e7198d1c329a011b3ae8aa';
-
-/// See also [newsFeedForyouRepository].
-@ProviderFor(newsFeedForyouRepository)
-final newsFeedForyouRepositoryProvider =
-    Provider<NewsFeedForyouRepository>.internal(
-  newsFeedForyouRepository,
-  name: r'newsFeedForyouRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$newsFeedForyouRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef NewsFeedForyouRepositoryRef = ProviderRef<NewsFeedForyouRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 0 - 98
packages/cpt_community/lib/respository/newsfeed_news_repository.dart

@@ -1,98 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'newsfeed_news_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-NewsFeedNewsRepository newsFeedNewsRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return NewsFeedNewsRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class NewsFeedNewsRepository {
-  DioEngine dioEngine;
-
-  NewsFeedNewsRepository({required this.dioEngine});
-
-  // news feed - news 列表
-  Future<HttpResult<Object>> fetchNewsList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/feed/news', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = NewsfeedNewsEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-  // news feed -news 点赞/取消点赞
-  Future<HttpResult<Object>> fetchLikeClick(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/like/click', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final boolData = result.getDataDynamic();
-      // var data = NewsfeedNewsEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: boolData);
-    }
-    return result.convert();
-  }
-
-
-
-}

+ 0 - 65
packages/cpt_community/lib/respository/newsfeed_publish_repository.dart

@@ -1,65 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/newsfeed_comment_publish_entity.dart';
-import 'package:domain/entity/newsfeed_news_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/log_utils.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-
-part 'newsfeed_publish_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-NewsFeedPublishRepository newsFeedPublishRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return NewsFeedPublishRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class NewsFeedPublishRepository {
-  DioEngine dioEngine;
-
-  NewsFeedPublishRepository({required this.dioEngine});
-
-  // news feed - post 发布newsfeed
-  Future<HttpResult<Object>> fetchNewsfeedPublish(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-    params = data!;
-    Map<String, String> headers = {};
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/news-feed/index/publish', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.POST,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      // var data = NewsfeedCommentPublishEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: json);
-    }
-    return result.convert();
-  }
-
-
-}

+ 0 - 29
packages/cpt_community/lib/respository/newsfeed_publish_repository.g.dart

@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'newsfeed_publish_repository.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$newsFeedPublishRepositoryHash() =>
-    r'c7233b4abdd852c7a3749a62671192b0740c4295';
-
-/// See also [newsFeedPublishRepository].
-@ProviderFor(newsFeedPublishRepository)
-final newsFeedPublishRepositoryProvider =
-    Provider<NewsFeedPublishRepository>.internal(
-  newsFeedPublishRepository,
-  name: r'newsFeedPublishRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$newsFeedPublishRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef NewsFeedPublishRepositoryRef = ProviderRef<NewsFeedPublishRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 4 - 4
packages/cpt_community/lib/router/page/community_page_router.gr.dart

@@ -223,8 +223,8 @@ class GaragesaleDetailPageRoute
     extends PageRouteInfo<GaragesaleDetailPageRouteArgs> {
   GaragesaleDetailPageRoute({
     Key? key,
-    required int? id,
-    required String? type,
+    required int id,
+    required String type,
     List<PageRouteInfo>? children,
   }) : super(
           GaragesaleDetailPageRoute.name,
@@ -251,9 +251,9 @@ class GaragesaleDetailPageRouteArgs {
 
   final Key? key;
 
-  final int? id;
+  final int id;
 
-  final String? type;
+  final String type;
 
   @override
   String toString() {

+ 0 - 71
packages/cpt_property/lib/modules/ioan/property_ioan_repository.dart

@@ -1,71 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-import 'property_ioan_state.dart';
-
-part 'property_ioan_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-PropertyIoanRepository propertyIoanRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return PropertyIoanRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class PropertyIoanRepository {
-  DioEngine dioEngine;
-
-  PropertyIoanRepository({required this.dioEngine});
-
-  Future<HttpResult<Object>> fetchPropertyIoanList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-
-    // if (!Utils.isEmpty(type)) {
-    //   params["type"] = type!;
-    // }
-
-    params = data!;
-
-
-    Map<String, String> headers = {};
-
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/index.php/api/employee/extra/time', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: true,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = PropertyIoanState.fromMap(json!);
-      //重新赋值data或list
-      return result.convert<PropertyIoanState>(data: data);
-    }
-    return result.convert();
-  }
-
-
-}

+ 1 - 1
packages/cpt_property/lib/modules/ioan/property_ioan_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_ioan_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertyIoanVmHash() => r'61a0481b76a62bfc7c1a3a6be8949c9f057ec64e';
+String _$propertyIoanVmHash() => r'7f97bf9c0f14dcf5f336b1929eb14f504bc7c9fc';
 
 /// See also [PropertyIoanVm].
 @ProviderFor(PropertyIoanVm)

+ 0 - 29
packages/cpt_property/lib/modules/news/repository/property_news_repository.g.dart

@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'property_news_repository.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$propertyNewsRepositoryHash() =>
-    r'4dd4722df0ea770dabbf9417faa00ffa6f6f5044';
-
-/// See also [propertyNewsRepository].
-@ProviderFor(propertyNewsRepository)
-final propertyNewsRepositoryProvider =
-    Provider<PropertyNewsRepository>.internal(
-  propertyNewsRepository,
-  name: r'propertyNewsRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$propertyNewsRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef PropertyNewsRepositoryRef = ProviderRef<PropertyNewsRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 5 - 5
packages/cpt_property/lib/modules/news/vm/property_news_vm.dart

@@ -1,3 +1,4 @@
+import 'package:cpt_property/respository/property_resposity.dart';
 import 'package:domain/entity/property_news_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod_annotation/riverpod_annotation.dart';
@@ -6,13 +7,12 @@ import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
 import '../page/property_news_state.dart';
-import '../repository/property_news_repository.dart';
 
 part 'property_news_vm.g.dart';
 
 @riverpod
 class PropertyNewsVm extends _$PropertyNewsVm {
-  late PropertyNewsRepository propertyNewsRepository;
+  late PropertyRespository propertyRespositoryInstance;
 
   bool _needShowPlaceholder = false; //是否展示LoadingView
   int _page = 1;  // 当前页
@@ -33,7 +33,7 @@ class PropertyNewsVm extends _$PropertyNewsVm {
   @override
   PropertyNewsState build() {
     // 引入数据仓库
-    propertyNewsRepository = ref.read(propertyNewsRepositoryProvider);
+    propertyRespositoryInstance = ref.read(propertyRespositoryProvider);
     // 初始化状态
     PropertyNewsState state = initState();
     // 初始化列表数据
@@ -102,7 +102,7 @@ class PropertyNewsVm extends _$PropertyNewsVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await propertyNewsRepository.fetchList(params);
+      final result = await propertyRespositoryInstance.fetchNewsList(params);
       //校验成功失败
       if (result.isSuccess) {
         handlerResultList((result.data  as PropertyNewsEntity).list);
@@ -212,7 +212,7 @@ class PropertyNewsVm extends _$PropertyNewsVm {
       Map<String, dynamic> params = {
         "id": curItem['id'],
       };
-      final result = await propertyNewsRepository.fetchPropertyNewsLikeClick(params);
+      final result = await propertyRespositoryInstance.fetchPropertyNewsLikeClick(params);
       //校验成功失败
       if (result.isSuccess) {
         List<Map<String, dynamic>>? newList = state.list?.map((item) {

+ 1 - 1
packages/cpt_property/lib/modules/news/vm/property_news_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_news_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertyNewsVmHash() => r'0cae6de1cd893ca95b0f8219b04f29c362f77a13';
+String _$propertyNewsVmHash() => r'928d4b39cb2b66e861543f2dae06d10f4e755b15';
 
 /// See also [PropertyNewsVm].
 @ProviderFor(PropertyNewsVm)

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

@@ -36,7 +36,7 @@ class PropertyRentPage extends HookConsumerWidget {
       // color: Colors.blue,
       child: MyTextView(
         item['title'],
-        maxLines: 1, // 设置最大行数为2
+        maxLines: 2, // 设置最大行数为2
         isTextEllipsis: true, // 超出部分用省略号表示
         fontSize: 16,
         textColor: context.appColors.textBlack,

+ 4 - 4
packages/cpt_property/lib/modules/rent/vm/property_rent_vm.dart

@@ -1,3 +1,4 @@
+import 'package:cpt_property/respository/property_resposity.dart';
 import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:plugin_platform/http/http_result.dart';
 import 'package:riverpod/src/framework.dart';
@@ -6,13 +7,12 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
-import '../../sale/repository/property_sale_repository.dart';
 import '../page/property_rent_state.dart';
 part 'property_rent_vm.g.dart';
 
 @riverpod
 class PropertyRentVm extends _$PropertyRentVm {
-  late PropertySaleRepository propertySaleRepository;
+  late PropertyRespository propertyRespositoryInstance;
 
   bool _needShowPlaceholder = false; //是否展示LoadingView
   int _page = 1;  // 当前页
@@ -34,7 +34,7 @@ class PropertyRentVm extends _$PropertyRentVm {
   @override
   PropertyRentState build() {
     // 引入数据仓库
-    propertySaleRepository = ref.read(propertySaleRepositoryProvider);
+    propertyRespositoryInstance = ref.read(propertyRespositoryProvider);
     // 引入数据仓库
     // 初始化状态
     PropertyRentState state = initState();
@@ -167,7 +167,7 @@ class PropertyRentVm extends _$PropertyRentVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await propertySaleRepository.fetchList(params);
+      final result = await propertyRespositoryInstance.fetchTransactionList(params);
       //校验成功失败
       if (result.isSuccess) {
         // state = state.copyWith(count: (result.data as PropertySaleRentEntity).count);

+ 1 - 1
packages/cpt_property/lib/modules/rent/vm/property_rent_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_rent_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertyRentVmHash() => r'2e62b3a1a11cd5e3896b7fb46e2506a9273ef861';
+String _$propertyRentVmHash() => r'8af3e7aea46b297f066b9e699713ebea5c06c47a';
 
 /// See also [PropertyRentVm].
 @ProviderFor(PropertyRentVm)

+ 0 - 69
packages/cpt_property/lib/modules/sale/repository/property_sale_repository.dart

@@ -1,69 +0,0 @@
-import 'package:domain/constants/api_constants.dart';
-import 'package:domain/entity/property_sale_rent_entity.dart';
-import 'package:domain/entity/server_time.dart';
-import 'package:plugin_platform/platform_export.dart';
-import 'package:plugin_platform/http/dio_engine.dart';
-import 'package:plugin_platform/http/http_result.dart';
-import 'package:riverpod_annotation/riverpod_annotation.dart';
-import 'package:shared/utils/util.dart';
-
-import 'package:flutter_riverpod/flutter_riverpod.dart';
-import 'package:plugin_basic/provider/http_provider/http_provider.dart';
-
-import '../page/property_sale_state.dart';
-part 'property_sale_repository.g.dart';
-
-@Riverpod(keepAlive: true)
-PropertySaleRepository propertySaleRepository(Ref ref) {
-  final dioEngine = ref.watch(dioEngineProvider);
-  return PropertySaleRepository(dioEngine: dioEngine);
-}
-
-/*
- * 数据仓库
- */
-class PropertySaleRepository {
-  DioEngine dioEngine;
-
-  PropertySaleRepository({required this.dioEngine});
-
-  Future<HttpResult<Object>> fetchList(
-      Map<String, dynamic>? data, {
-        CancelToken? cancelToken,
-      }) async {
-    Map<String, dynamic> params = {};
-
-    // if (!Utils.isEmpty(type)) {
-    //   params["type"] = type!;
-    // }
-    params = data!;
-
-    Map<String, String> headers = {};
-
-    headers["Content-Type"] = "application/x-www-form-urlencoded";
-    headers["Accept"] = "application/x.yyjobs-api.v1+json";
-
-    final result = await dioEngine.requestNetResult(
-      // ApiConstants.apiServerTime, // api 地址
-      '/api/v1/user/property/transaction/list', // api 地址
-      params: params,
-      headers: headers,
-      method: HttpMethod.GET,
-      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
-      networkDebounce: true,   //是否防抖防止重复请求
-      cancelToken: cancelToken,
-    );
-
-    //根据返回的结果,封装原始数据为Bean/Entity对象
-    if (result.isSuccess) {
-      //重新赋值data或list
-      final json = result.getDataJson();
-      var data = PropertySaleRentEntity.fromJson(json!);
-      //重新赋值data或list
-      return result.convert(data: data);
-    }
-    return result.convert();
-  }
-
-
-}

+ 0 - 29
packages/cpt_property/lib/modules/sale/repository/property_sale_repository.g.dart

@@ -1,29 +0,0 @@
-// GENERATED CODE - DO NOT MODIFY BY HAND
-
-part of 'property_sale_repository.dart';
-
-// **************************************************************************
-// RiverpodGenerator
-// **************************************************************************
-
-String _$propertySaleRepositoryHash() =>
-    r'576b1e80b34d01e5983f264c64125501e88dc8f4';
-
-/// See also [propertySaleRepository].
-@ProviderFor(propertySaleRepository)
-final propertySaleRepositoryProvider =
-    Provider<PropertySaleRepository>.internal(
-  propertySaleRepository,
-  name: r'propertySaleRepositoryProvider',
-  debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
-      ? null
-      : _$propertySaleRepositoryHash,
-  dependencies: null,
-  allTransitiveDependencies: null,
-);
-
-@Deprecated('Will be removed in 3.0. Use Ref instead')
-// ignore: unused_element
-typedef PropertySaleRepositoryRef = ProviderRef<PropertySaleRepository>;
-// ignore_for_file: type=lint
-// ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 4 - 4
packages/cpt_property/lib/modules/sale/vm/property_sale_vm.dart

@@ -5,13 +5,13 @@ import 'package:shared/utils/log_utils.dart';
 import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:widgets/load_state_layout.dart';
 import 'package:widgets/widget_export.dart';
+import '../../../respository/property_resposity.dart';
 import '../page/property_sale_state.dart';
-import '../repository/property_sale_repository.dart';
 part 'property_sale_vm.g.dart';
 
 @riverpod
 class PropertySaleVm extends _$PropertySaleVm {
-  late PropertySaleRepository propertySaleRepository;
+  late PropertyRespository propertyRespositoryInstance;
   bool _needShowPlaceholder = false; //是否展示LoadingView
   int _page = 1;  // 当前页
   int _limit = 10; // 每页数量
@@ -31,7 +31,7 @@ class PropertySaleVm extends _$PropertySaleVm {
   @override
   PropertySaleState build() {
     // 引入数据仓库
-    propertySaleRepository = ref.read(propertySaleRepositoryProvider);
+    propertyRespositoryInstance = ref.read(propertyRespositoryProvider);
     // 初始化状态
     PropertySaleState state = initState();
     // 初始化列表数据
@@ -163,7 +163,7 @@ class PropertySaleVm extends _$PropertySaleVm {
         "limit": _limit,
       };
       Log.d("请求参数------$params");
-      final result = await propertySaleRepository.fetchList(params);
+      final result = await propertyRespositoryInstance.fetchTransactionList(params);
       //校验成功失败
       if (result.isSuccess) {
         // state = state.copyWith(count: (result.data as PropertySaleRentEntity).count);

+ 1 - 1
packages/cpt_property/lib/modules/sale/vm/property_sale_vm.g.dart

@@ -6,7 +6,7 @@ part of 'property_sale_vm.dart';
 // RiverpodGenerator
 // **************************************************************************
 
-String _$propertySaleVmHash() => r'8a612924f792107d19776759ce44c7e5a4bac9cb';
+String _$propertySaleVmHash() => r'f7493a35f2d0c93caef3b9a4d7678c94fc42cdfa';
 
 /// See also [PropertySaleVm].
 @ProviderFor(PropertySaleVm)

+ 57 - 7
packages/cpt_property/lib/modules/news/repository/property_news_repository.dart

@@ -1,6 +1,8 @@
 import 'package:domain/constants/api_constants.dart';
 import 'package:domain/entity/property_news_entity.dart';
+import 'package:domain/entity/property_sale_rent_entity.dart';
 import 'package:domain/entity/server_time.dart';
+import 'package:plugin_platform/engine/toast/toast_engine.dart';
 import 'package:plugin_platform/platform_export.dart';
 import 'package:plugin_platform/http/dio_engine.dart';
 import 'package:plugin_platform/http/http_result.dart';
@@ -11,25 +13,25 @@ import 'package:shared/utils/util.dart';
 import 'package:flutter_riverpod/flutter_riverpod.dart';
 import 'package:plugin_basic/provider/http_provider/http_provider.dart';
 
-import '../page/property_news_state.dart';
 
-part 'property_news_repository.g.dart';
+part 'property_resposity.g.dart';
 
 @Riverpod(keepAlive: true)
-PropertyNewsRepository propertyNewsRepository(Ref ref) {
+PropertyRespository propertyRespository(Ref ref) {
   final dioEngine = ref.watch(dioEngineProvider);
-  return PropertyNewsRepository(dioEngine: dioEngine);
+  return PropertyRespository(dioEngine: dioEngine);
 }
 
 /*
  * 数据仓库
  */
-class PropertyNewsRepository {
+class PropertyRespository {
   DioEngine dioEngine;
 
-  PropertyNewsRepository({required this.dioEngine});
+  PropertyRespository({required this.dioEngine});
 
-  Future<HttpResult<Object>> fetchList(
+  // 获取 news 列表
+  Future<HttpResult<Object>> fetchNewsList(
       Map<String, dynamic>? data, {
         CancelToken? cancelToken,
       }) async {
@@ -61,6 +63,10 @@ class PropertyNewsRepository {
       var data = PropertyNewsEntity.fromJson(json!);
       //重新赋值data或list
       return result.convert<PropertyNewsEntity>(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }
@@ -102,6 +108,50 @@ class PropertyNewsRepository {
       }else {
         return result.convert<bool>(data: false);
       }
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
+    }
+    return result.convert();
+  }
+
+  // 获取 transaction 列表 (rent sale)
+  Future<HttpResult<Object>> fetchTransactionList(
+      Map<String, dynamic>? data, {
+        CancelToken? cancelToken,
+      }) async {
+    Map<String, dynamic> params = {};
+
+    params = data!;
+
+    Map<String, String> headers = {};
+
+    headers["Content-Type"] = "application/x-www-form-urlencoded";
+    headers["Accept"] = "application/x.yyjobs-api.v1+json";
+
+    final result = await dioEngine.requestNetResult(
+      // ApiConstants.apiServerTime, // api 地址
+      '/api/v1/user/property/transaction/list', // api 地址
+      params: params,
+      headers: headers,
+      method: HttpMethod.GET,
+      isShowLoadingDialog: false,  //是否展示默认的Loading弹窗
+      networkDebounce: true,   //是否防抖防止重复请求
+      cancelToken: cancelToken,
+    );
+
+    //根据返回的结果,封装原始数据为Bean/Entity对象
+    if (result.isSuccess) {
+      //重新赋值data或list
+      final json = result.getDataJson();
+      var data = PropertySaleRentEntity.fromJson(json!);
+      //重新赋值data或list
+      return result.convert(data: data);
+    }else {
+      if(result.errorMsg != null && result.errorMsg!.isNotEmpty){
+        ToastEngine.show("${result.errorMsg}");
+      }
     }
     return result.convert();
   }

+ 10 - 11
packages/cpt_community/lib/respository/newsfeed_news_repository.g.dart

@@ -1,29 +1,28 @@
 // GENERATED CODE - DO NOT MODIFY BY HAND
 
-part of 'newsfeed_news_repository.dart';
+part of 'property_resposity.dart';
 
 // **************************************************************************
 // RiverpodGenerator
 // **************************************************************************
 
-String _$newsFeedNewsRepositoryHash() =>
-    r'97db5621bdc5be4656b3347b7f32fde23584c0a0';
+String _$propertyRespositoryHash() =>
+    r'b791dc9af1707bb731e805d484e0f1f4357be345';
 
-/// See also [newsFeedNewsRepository].
-@ProviderFor(newsFeedNewsRepository)
-final newsFeedNewsRepositoryProvider =
-    Provider<NewsFeedNewsRepository>.internal(
-  newsFeedNewsRepository,
-  name: r'newsFeedNewsRepositoryProvider',
+/// See also [propertyRespository].
+@ProviderFor(propertyRespository)
+final propertyRespositoryProvider = Provider<PropertyRespository>.internal(
+  propertyRespository,
+  name: r'propertyRespositoryProvider',
   debugGetCreateSourceHash: const bool.fromEnvironment('dart.vm.product')
       ? null
-      : _$newsFeedNewsRepositoryHash,
+      : _$propertyRespositoryHash,
   dependencies: null,
   allTransitiveDependencies: null,
 );
 
 @Deprecated('Will be removed in 3.0. Use Ref instead')
 // ignore: unused_element
-typedef NewsFeedNewsRepositoryRef = ProviderRef<NewsFeedNewsRepository>;
+typedef PropertyRespositoryRef = ProviderRef<PropertyRespository>;
 // ignore_for_file: type=lint
 // ignore_for_file: subtype_of_sealed_class, invalid_use_of_internal_member, invalid_use_of_visible_for_testing_member, deprecated_member_use_from_same_package

+ 45 - 0
packages/cs_domain/lib/entity/garage_sale_rent_detail_entity.dart

@@ -0,0 +1,45 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/garage_sale_rent_detail_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/garage_sale_rent_detail_entity.g.dart';
+
+@JsonSerializable()
+class GarageSaleRentDetailEntity {
+	int? id;
+	String? title;
+	int? price;
+	String? description;
+	List<String>? resources;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	GarageSaleRentDetailAccount? account;
+
+	GarageSaleRentDetailEntity();
+
+	factory GarageSaleRentDetailEntity.fromJson(Map<String, dynamic> json) => $GarageSaleRentDetailEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleRentDetailEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}
+
+@JsonSerializable()
+class GarageSaleRentDetailAccount {
+	int? id;
+	String? name;
+	String? avatar;
+
+	GarageSaleRentDetailAccount();
+
+	factory GarageSaleRentDetailAccount.fromJson(Map<String, dynamic> json) => $GarageSaleRentDetailAccountFromJson(json);
+
+	Map<String, dynamic> toJson() => $GarageSaleRentDetailAccountToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 22 - 0
packages/cs_domain/lib/entity/myfollowing_list_entity.dart

@@ -0,0 +1,22 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/myfollowing_list_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/myfollowing_list_entity.g.dart';
+
+@JsonSerializable()
+class MyfollowingListEntity {
+	int? id;
+	String? name;
+	String? avatar;
+
+	MyfollowingListEntity();
+
+	factory MyfollowingListEntity.fromJson(Map<String, dynamic> json) => $MyfollowingListEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $MyfollowingListEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 27 - 0
packages/cs_domain/lib/entity/myposts_sale_rent_entity.dart

@@ -0,0 +1,27 @@
+import 'package:domain/generated/json/base/json_field.dart';
+import 'package:domain/generated/json/myposts_sale_rent_entity.g.dart';
+import 'dart:convert';
+export 'package:domain/generated/json/myposts_sale_rent_entity.g.dart';
+
+@JsonSerializable()
+class MypostsSaleRentEntity {
+	int? id;
+	String? title;
+	int? price;
+	List<String>? resources;
+	@JSONField(name: "created_at")
+	String? createdAt;
+	@JSONField(name: "likes_count")
+	int? likesCount;
+
+	MypostsSaleRentEntity();
+
+	factory MypostsSaleRentEntity.fromJson(Map<String, dynamic> json) => $MypostsSaleRentEntityFromJson(json);
+
+	Map<String, dynamic> toJson() => $MypostsSaleRentEntityToJson(this);
+
+	@override
+	String toString() {
+		return jsonEncode(this);
+	}
+}

+ 25 - 0
packages/cs_domain/lib/generated/json/base/json_convert_content.dart

@@ -14,8 +14,11 @@ import 'package:domain/entity/form_list_entity.dart';
 import 'package:domain/entity/form_option_entity.dart';
 import 'package:domain/entity/form_submitted_entity.dart';
 import 'package:domain/entity/form_submitted_page_entity.dart';
+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_sale_rent_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';
@@ -214,6 +217,14 @@ class JsonConvert {
       return data.map<FormSubmittedPageEntity>((Map<String, dynamic> e) =>
           FormSubmittedPageEntity.fromJson(e)).toList() as M;
     }
+    if (<GarageSaleRentDetailEntity>[] is M) {
+      return data.map<GarageSaleRentDetailEntity>((Map<String, dynamic> e) =>
+          GarageSaleRentDetailEntity.fromJson(e)).toList() as M;
+    }
+    if (<GarageSaleRentDetailAccount>[] is M) {
+      return data.map<GarageSaleRentDetailAccount>((Map<String, dynamic> e) =>
+          GarageSaleRentDetailAccount.fromJson(e)).toList() as M;
+    }
     if (<GarageSaleRentEntity>[] is M) {
       return data.map<GarageSaleRentEntity>((Map<String, dynamic> e) =>
           GarageSaleRentEntity.fromJson(e)).toList() as M;
@@ -226,6 +237,14 @@ class JsonConvert {
       return data.map<IdNameEntity>((Map<String, dynamic> e) =>
           IdNameEntity.fromJson(e)).toList() as M;
     }
+    if (<MyfollowingListEntity>[] is M) {
+      return data.map<MyfollowingListEntity>((Map<String, dynamic> e) =>
+          MyfollowingListEntity.fromJson(e)).toList() as M;
+    }
+    if (<MypostsSaleRentEntity>[] is M) {
+      return data.map<MypostsSaleRentEntity>((Map<String, dynamic> e) =>
+          MypostsSaleRentEntity.fromJson(e)).toList() as M;
+    }
     if (<NewsfeedCommentPublishEntity>[] is M) {
       return data.map<NewsfeedCommentPublishEntity>((Map<String, dynamic> e) =>
           NewsfeedCommentPublishEntity.fromJson(e)).toList() as M;
@@ -370,9 +389,15 @@ class JsonConvertClassCollection {
     (FormSubmittedEstateOnlineForm).toString(): FormSubmittedEstateOnlineForm
         .fromJson,
     (FormSubmittedPageEntity).toString(): FormSubmittedPageEntity.fromJson,
+    (GarageSaleRentDetailEntity).toString(): GarageSaleRentDetailEntity
+        .fromJson,
+    (GarageSaleRentDetailAccount).toString(): GarageSaleRentDetailAccount
+        .fromJson,
     (GarageSaleRentEntity).toString(): GarageSaleRentEntity.fromJson,
     (GarageSaleRentAccount).toString(): GarageSaleRentAccount.fromJson,
     (IdNameEntity).toString(): IdNameEntity.fromJson,
+    (MyfollowingListEntity).toString(): MyfollowingListEntity.fromJson,
+    (MypostsSaleRentEntity).toString(): MypostsSaleRentEntity.fromJson,
     (NewsfeedCommentPublishEntity).toString(): NewsfeedCommentPublishEntity
         .fromJson,
     (NewsfeedDetailEntity).toString(): NewsfeedDetailEntity.fromJson,

+ 112 - 0
packages/cs_domain/lib/generated/json/garage_sale_rent_detail_entity.g.dart

@@ -0,0 +1,112 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/garage_sale_rent_detail_entity.dart';
+
+GarageSaleRentDetailEntity $GarageSaleRentDetailEntityFromJson(
+    Map<String, dynamic> json) {
+  final GarageSaleRentDetailEntity garageSaleRentDetailEntity = GarageSaleRentDetailEntity();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    garageSaleRentDetailEntity.id = id;
+  }
+  final String? title = jsonConvert.convert<String>(json['title']);
+  if (title != null) {
+    garageSaleRentDetailEntity.title = title;
+  }
+  final int? price = jsonConvert.convert<int>(json['price']);
+  if (price != null) {
+    garageSaleRentDetailEntity.price = price;
+  }
+  final String? description = jsonConvert.convert<String>(json['description']);
+  if (description != null) {
+    garageSaleRentDetailEntity.description = description;
+  }
+  final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (resources != null) {
+    garageSaleRentDetailEntity.resources = resources;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    garageSaleRentDetailEntity.createdAt = createdAt;
+  }
+  final GarageSaleRentDetailAccount? account = jsonConvert.convert<
+      GarageSaleRentDetailAccount>(json['account']);
+  if (account != null) {
+    garageSaleRentDetailEntity.account = account;
+  }
+  return garageSaleRentDetailEntity;
+}
+
+Map<String, dynamic> $GarageSaleRentDetailEntityToJson(
+    GarageSaleRentDetailEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['title'] = entity.title;
+  data['price'] = entity.price;
+  data['description'] = entity.description;
+  data['resources'] = entity.resources;
+  data['created_at'] = entity.createdAt;
+  data['account'] = entity.account?.toJson();
+  return data;
+}
+
+extension GarageSaleRentDetailEntityExtension on GarageSaleRentDetailEntity {
+  GarageSaleRentDetailEntity copyWith({
+    int? id,
+    String? title,
+    int? price,
+    String? description,
+    List<String>? resources,
+    String? createdAt,
+    GarageSaleRentDetailAccount? account,
+  }) {
+    return GarageSaleRentDetailEntity()
+      ..id = id ?? this.id
+      ..title = title ?? this.title
+      ..price = price ?? this.price
+      ..description = description ?? this.description
+      ..resources = resources ?? this.resources
+      ..createdAt = createdAt ?? this.createdAt
+      ..account = account ?? this.account;
+  }
+}
+
+GarageSaleRentDetailAccount $GarageSaleRentDetailAccountFromJson(
+    Map<String, dynamic> json) {
+  final GarageSaleRentDetailAccount garageSaleRentDetailAccount = GarageSaleRentDetailAccount();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    garageSaleRentDetailAccount.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    garageSaleRentDetailAccount.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    garageSaleRentDetailAccount.avatar = avatar;
+  }
+  return garageSaleRentDetailAccount;
+}
+
+Map<String, dynamic> $GarageSaleRentDetailAccountToJson(
+    GarageSaleRentDetailAccount entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  return data;
+}
+
+extension GarageSaleRentDetailAccountExtension on GarageSaleRentDetailAccount {
+  GarageSaleRentDetailAccount copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+  }) {
+    return GarageSaleRentDetailAccount()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar;
+  }
+}

+ 42 - 0
packages/cs_domain/lib/generated/json/myfollowing_list_entity.g.dart

@@ -0,0 +1,42 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/myfollowing_list_entity.dart';
+
+MyfollowingListEntity $MyfollowingListEntityFromJson(
+    Map<String, dynamic> json) {
+  final MyfollowingListEntity myfollowingListEntity = MyfollowingListEntity();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    myfollowingListEntity.id = id;
+  }
+  final String? name = jsonConvert.convert<String>(json['name']);
+  if (name != null) {
+    myfollowingListEntity.name = name;
+  }
+  final String? avatar = jsonConvert.convert<String>(json['avatar']);
+  if (avatar != null) {
+    myfollowingListEntity.avatar = avatar;
+  }
+  return myfollowingListEntity;
+}
+
+Map<String, dynamic> $MyfollowingListEntityToJson(
+    MyfollowingListEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['name'] = entity.name;
+  data['avatar'] = entity.avatar;
+  return data;
+}
+
+extension MyfollowingListEntityExtension on MyfollowingListEntity {
+  MyfollowingListEntity copyWith({
+    int? id,
+    String? name,
+    String? avatar,
+  }) {
+    return MyfollowingListEntity()
+      ..id = id ?? this.id
+      ..name = name ?? this.name
+      ..avatar = avatar ?? this.avatar;
+  }
+}

+ 64 - 0
packages/cs_domain/lib/generated/json/myposts_sale_rent_entity.g.dart

@@ -0,0 +1,64 @@
+import 'package:domain/generated/json/base/json_convert_content.dart';
+import 'package:domain/entity/myposts_sale_rent_entity.dart';
+
+MypostsSaleRentEntity $MypostsSaleRentEntityFromJson(
+    Map<String, dynamic> json) {
+  final MypostsSaleRentEntity mypostsSaleRentEntity = MypostsSaleRentEntity();
+  final int? id = jsonConvert.convert<int>(json['id']);
+  if (id != null) {
+    mypostsSaleRentEntity.id = id;
+  }
+  final String? title = jsonConvert.convert<String>(json['title']);
+  if (title != null) {
+    mypostsSaleRentEntity.title = title;
+  }
+  final int? price = jsonConvert.convert<int>(json['price']);
+  if (price != null) {
+    mypostsSaleRentEntity.price = price;
+  }
+  final List<String>? resources = (json['resources'] as List<dynamic>?)?.map(
+          (e) => jsonConvert.convert<String>(e) as String).toList();
+  if (resources != null) {
+    mypostsSaleRentEntity.resources = resources;
+  }
+  final String? createdAt = jsonConvert.convert<String>(json['created_at']);
+  if (createdAt != null) {
+    mypostsSaleRentEntity.createdAt = createdAt;
+  }
+  final int? likesCount = jsonConvert.convert<int>(json['likes_count']);
+  if (likesCount != null) {
+    mypostsSaleRentEntity.likesCount = likesCount;
+  }
+  return mypostsSaleRentEntity;
+}
+
+Map<String, dynamic> $MypostsSaleRentEntityToJson(
+    MypostsSaleRentEntity entity) {
+  final Map<String, dynamic> data = <String, dynamic>{};
+  data['id'] = entity.id;
+  data['title'] = entity.title;
+  data['price'] = entity.price;
+  data['resources'] = entity.resources;
+  data['created_at'] = entity.createdAt;
+  data['likes_count'] = entity.likesCount;
+  return data;
+}
+
+extension MypostsSaleRentEntityExtension on MypostsSaleRentEntity {
+  MypostsSaleRentEntity copyWith({
+    int? id,
+    String? title,
+    int? price,
+    List<String>? resources,
+    String? createdAt,
+    int? likesCount,
+  }) {
+    return MypostsSaleRentEntity()
+      ..id = id ?? this.id
+      ..title = title ?? this.title
+      ..price = price ?? this.price
+      ..resources = resources ?? this.resources
+      ..createdAt = createdAt ?? this.createdAt
+      ..likesCount = likesCount ?? this.likesCount;
+  }
+}