|
@@ -9,6 +9,7 @@ using GxPress.Request.ArticleGroup;
|
|
|
using Microsoft.Extensions.Options;
|
|
|
using Datory;
|
|
|
using Dapper;
|
|
|
+using GxPress.Result.ArticleGroupUser;
|
|
|
|
|
|
namespace GxPress.Repository.Implement
|
|
|
{
|
|
@@ -53,14 +54,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 ccpph.tede_article_group where Id not in(SELECT ArticleGroupId FROM ccpph.tede_article_group_user where UserId={userId}) and IsSystemDefault=0";
|
|
|
+ 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, IsSystemDefault = item.IsSystemDefault });
|
|
|
+ }
|
|
|
+ return list;
|
|
|
}
|
|
|
|
|
|
/// <summary>
|