李昊 il y a 4 ans
Parent
commit
46d5ce4eb5

+ 5 - 0
gx_api/GxPress/Model/GxPress.Result/ArticleGroupUser/ArticleGroupUserListResult.cs

@@ -27,5 +27,10 @@ namespace GxPress.Result.ArticleGroupUser
         /// </summary>
         /// <value></value>
         public string StyleCss { get; set; }
+          /// <summary>
+        /// 系统默认
+        /// </summary>
+        /// <value></value>
+        public bool IsSystemDefault { get; set; }
     }
 }

+ 1 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/ArticleGroupRepository.cs

@@ -81,7 +81,7 @@ namespace GxPress.Repository.Implement
         }
         public async Task<IEnumerable<ArticleGroup>> GetListAsync(int userId)
         {
-            string sql = $@"select * from tede_article_group where Id not  in(SELECT ArticleGroupId FROM tede_article_group_user where UserId={userId}) or IsSystemDefault=0";
+            string sql = $@"select * from tede_article_group where Id not  in(SELECT ArticleGroupId FROM tede_article_group_user where UserId={userId}) or IsSystemDefault=1";
             var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
             var database = new Database(databaseType, _connectionString);
             var connection = database.GetConnection();

+ 1 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/ArticleGroupUserRepository.cs

@@ -85,7 +85,7 @@ namespace GxPress.Repository.Implement
             var articleGroups = await _articleGroupRepository.GetAllAsync(Q.Where(nameof(ArticleGroup.IsSystemDefault), true));
             foreach (var item in articleGroups)
             {
-                listArray.Add(new ArticleGroupUserListResult() { Id = 0, UserId = request.UserId, ArticleGroupId = item.Id, ArticleGroupName = item.Name, StyleCss = item.StyleCss });
+                listArray.Add(new ArticleGroupUserListResult() { Id = 0, UserId = request.UserId, ArticleGroupId = item.Id, ArticleGroupName = item.Name, StyleCss = item.StyleCss, IsSystemDefault = item.IsSystemDefault });
             }
             foreach (var item in listArray)
             {