|
@@ -13,6 +13,7 @@ using GxPress.Result.Article;
|
|
|
using System;
|
|
|
using GxPress.EnumConst;
|
|
|
using AutoMapper;
|
|
|
+using GxPress.Result.ArticleGroupUser;
|
|
|
|
|
|
namespace GxPress.Repository.Implement
|
|
|
{
|
|
@@ -79,14 +80,19 @@ namespace GxPress.Repository.Implement
|
|
|
{
|
|
|
return await _repository.UpdateAsync(processGroup);
|
|
|
}
|
|
|
- public async Task<IEnumerable<ArticleGroup>> GetListAsync(int userId)
|
|
|
+ public async Task<IEnumerable<ArticleGroupUserListResult>> GetListAsync(int userId)
|
|
|
{
|
|
|
string sql = $@"select * from tede_article_group where Id not in(SELECT ArticleGroupId FROM tede_article_group_user where UserId={userId}) and IsSystemDefault=0";
|
|
|
var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
|
|
|
var database = new Database(databaseType, _connectionString);
|
|
|
var connection = database.GetConnection();
|
|
|
var result = await connection.QueryAsync<ArticleGroup>(sql);
|
|
|
- return result;
|
|
|
+ var list = new List<ArticleGroupUserListResult>();
|
|
|
+ foreach (var item in result)
|
|
|
+ {
|
|
|
+ list.Add(new ArticleGroupUserListResult() { Id = item.Id, UserId = userId, ArticleGroupId = item.Id, ArticleGroupName = item.Name, StyleCss = item.StyleCss, IsSystemDefault = item.IsSystemDefault });
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|