GroupRepository.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490
  1. using System.Collections.Generic;
  2. using System.Threading.Tasks;
  3. using AutoMapper;
  4. using Dapper;
  5. using GxPress.Common.AppOptions;
  6. using GxPress.Common.Exceptions;
  7. using GxPress.Common.Page;
  8. using GxPress.Common.Tools;
  9. using GxPress.Entity;
  10. using GxPress.EnumConst;
  11. using GxPress.Repository.Interface;
  12. using GxPress.Request.App.Group;
  13. using GxPress.Result.App.Group;
  14. using GxPress.Result.App.GroupUser;
  15. using Microsoft.AspNetCore.Hosting;
  16. using Microsoft.Extensions.Options;
  17. using Newtonsoft.Json;
  18. using Datory;
  19. using GxPress.Request.App.Topic;
  20. using SqlKata;
  21. using GxPress.Result.Job;
  22. using System.Linq;
  23. namespace GxPress.Repository.Implement
  24. {
  25. public class GroupRepository : IGroupRepository
  26. {
  27. private readonly Repository<Entity.Group> _repository;
  28. private readonly IMapper _mapper;
  29. private readonly IWebHostEnvironment _environment;
  30. private readonly string _connectionString;
  31. private readonly string _databaseTypeStr;
  32. private readonly Repository<GroupUser> _groupUserRepository;
  33. public GroupRepository(IOptionsMonitor<DatabaseOptions> dbOptionsAccessor, IMapper mapper,
  34. IWebHostEnvironment environment)
  35. {
  36. _databaseTypeStr = dbOptionsAccessor.CurrentValue.DatabaseType;
  37. _connectionString = dbOptionsAccessor.CurrentValue.ConnectionString;
  38. var databaseType =
  39. StringUtils.ToEnum<DatabaseType>(dbOptionsAccessor.CurrentValue.DatabaseType, DatabaseType.MySql);
  40. var database = new Database(databaseType, dbOptionsAccessor.CurrentValue.ConnectionString);
  41. _repository = new Repository<Entity.Group>(database);
  42. _groupUserRepository = new Repository<GroupUser>(database);
  43. _environment = environment;
  44. _mapper = mapper;
  45. }
  46. public IDatabase Database => _repository.Database;
  47. public string TableName => _repository.TableName;
  48. public List<TableColumn> TableColumns => _repository.TableColumns;
  49. public async Task<int> InsertAsync(GroupInRequest request)
  50. {
  51. if (string.IsNullOrEmpty(request.Name))
  52. throw new BusinessException("小组名称不能为空");
  53. var group = new Entity.Group
  54. {
  55. Name = request.Name,
  56. AvatarUrl = request.AvatarUrl,
  57. Introduce = request.Introduce,
  58. IsAdmin = false,
  59. IsUDisturb = false,
  60. QRCoder = request.QRCoder,
  61. IsWords = false,
  62. UserId = request.UserId,
  63. GroupCategroyId = request.GroupCategroyId,
  64. LabelName = request.LabelName,
  65. IsShow = request.IsShow
  66. };
  67. if (!string.IsNullOrEmpty(group.AvatarUrl))
  68. group.AvatarUrl = StringUtils.RemoveDomain(group.AvatarUrl);
  69. var id = await _repository.InsertAsync(group);
  70. //生成二维码
  71. var groupDto = await _repository.GetAsync(id);
  72. var qrCodeData = new { key = QRCodeTypeConst.GroupInfo, value = groupDto.Guid };
  73. var resultPath =
  74. FileHelper.SaveQRCodeFile(StringUtils.GetWebRootPath(_environment.WebRootPath),
  75. JsonConvert.SerializeObject(qrCodeData));
  76. groupDto.QRCoder = resultPath.RelativePath;
  77. await _repository.UpdateAsync(groupDto);
  78. return id;
  79. }
  80. public async Task<IEnumerable<GroupUser>> GetAllAsync(SqlKata.Query query)
  81. {
  82. return await _groupUserRepository.GetAllAsync(query);
  83. }
  84. /// <summary>
  85. /// 修改小组
  86. /// </summary>
  87. /// <param name="request"></param>
  88. /// <returns></returns>
  89. public async Task<bool> UpdateAsync(GroupUpRequest request)
  90. {
  91. var group = await _repository.GetAsync(request.Id);
  92. if (!string.IsNullOrEmpty(request.Name))
  93. group.Name = request.Name;
  94. if (!string.IsNullOrEmpty(request.AvatarUrl))
  95. {
  96. group.HistoryAvatarUrl = group.AvatarUrl;
  97. group.AvatarUrl = StringUtils.RemoveDomain(request.AvatarUrl);
  98. }
  99. if (!string.IsNullOrEmpty(request.Introduce))
  100. group.Introduce = request.Introduce;
  101. if (!string.IsNullOrEmpty(request.LabelName))
  102. group.LabelName = request.LabelName;
  103. if (request.IsShow > 0)
  104. group.IsShow = request.IsShow == 1;
  105. if (request.IsAdmin > 0)
  106. group.IsAdmin = request.IsAdmin == 1;
  107. if (request.IsWords > 0)
  108. group.IsWords = request.IsWords == 1;
  109. return await _repository.UpdateAsync(group);
  110. }
  111. /// <summary>
  112. /// 删除小组
  113. /// </summary>
  114. /// <param name="id"></param>
  115. /// <returns></returns>
  116. public async Task<bool> DeleteAsync(int id)
  117. {
  118. return await _repository.DeleteAsync(id);
  119. }
  120. public async Task<bool> DeleteAsync(Query query)
  121. {
  122. return await _repository.DeleteAsync(query) > 0;
  123. }
  124. /// <summary>
  125. /// 查询小组
  126. /// </summary>
  127. /// <param name="request"></param>
  128. /// <returns></returns>
  129. public async Task<PagedList<GroupUserFindResult>> FindGroupByGroupFolderId(GroupSearchRequest request)
  130. {
  131. var pagedList = new PagedList<GroupUserFindResult>();
  132. var groupConst = AllTypeConst.Group.GetHashCode();
  133. //根据文件夹ID查询成员
  134. var sqlValue = "";
  135. // if (!string.IsNullOrEmpty(request.Key))
  136. // sqlValue += $"and b.Name like '%{request.Key}%'";
  137. //共享数量
  138. var topicSharingCount = "(select count(1) from tede_group_user where GroupId=a.MiddleId) as TopicSharingCount";
  139. //总话题数量
  140. var topicAllCount = "(select count(1) from tede_topic where GroupId=a.MiddleId) as TopicAllCount";
  141. //未读话题数量
  142. var uReadTopicCount = $"(select count(1) from tede_topic_addressee where TopicId in (select Id from tede_topic where GroupId=a.MiddleId) and UserId={request.UserId} and IsRead=0) as UReadTopicCount";
  143. var categoryName = "(select FolderName from tede_middle where id=a.ParentId) as CategoryName";
  144. var sql =
  145. $@"SELECT a.*,{topicSharingCount},{topicAllCount},{uReadTopicCount},{categoryName},
  146. (SELECT
  147. COUNT(1)
  148. FROM
  149. tede_group
  150. WHERE
  151. id IN (SELECT
  152. MiddleId
  153. FROM
  154. tede_middle
  155. WHERE
  156. ParentId = a.Id)) AS FileCount,b.Id, b.AvatarUrl, b.Name FROM tede_Middle a LEFT JOIN tede_group b ON a.MiddleId = b.Id WHERE 1=1 ";
  157. if (request.GroupFolderId == 0 && string.IsNullOrEmpty(request.Key))
  158. sql += $"and a.ParentId = @groupFolderId ";
  159. else if (request.GroupFolderId > 0 && !string.IsNullOrEmpty(request.Key))
  160. sql += $"and a.ParentId = @groupFolderId and (a.FolderName like '%{request.Key}%' or b.Name like '%{request.Key}%')";
  161. else if (request.GroupFolderId > 0 && string.IsNullOrEmpty(request.Key))
  162. sql += $"and a.ParentId = @groupFolderId ";
  163. else
  164. sql += $" and (a.FolderName like '%{request.Key}%' or b.Name like '%{request.Key}%')";
  165. sql +=
  166. $@" and a.UserId=@userId and a.FolderType={groupConst} and a.IsDelete=0 {sqlValue} and (b.id>0 or a.AttributeValue=2) ORDER BY a.IsTop DESC, a.LastModifiedDate DESC ,a.AttributeValue DESC LIMIT @page , @pageSize";
  167. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  168. var database = new Database(databaseType, _connectionString);
  169. var connection = database.GetConnection();
  170. var result =
  171. await connection
  172. .QueryAsync<GroupUserFindResult, Entity.Group, GroupUserFindResult>(sql,
  173. (groupUserFindResult, group) =>
  174. {
  175. groupUserFindResult.GroupName = group == null ? "" : group.Name;
  176. groupUserFindResult.AvatarUrl = group == null ? "" : StringUtils.AddDomainMin(group.AvatarUrl);
  177. groupUserFindResult.GroupId = group?.Id ?? 0;
  178. return groupUserFindResult;
  179. },
  180. new
  181. {
  182. groupFolderId = request.GroupFolderId,
  183. userId = request.UserId,
  184. page = (request.Page - 1) * request.PerPage,
  185. pageSize = request.PerPage * request.Page
  186. }, splitOn: "Id");
  187. pagedList.Items = result;
  188. var sqlCount =
  189. @"SELECT count(1) FROM tede_Middle a LEFT JOIN tede_group b ON a.MiddleId = b.Id WHERE 1=1 ";
  190. if (request.GroupFolderId == 0 && string.IsNullOrEmpty(request.Key))
  191. sqlCount += $"and a.ParentId = {request.GroupFolderId} ";
  192. else if (request.GroupFolderId > 0 && !string.IsNullOrEmpty(request.Key))
  193. sqlCount += $"and a.ParentId = {request.GroupFolderId} and (a.FolderName like '%{request.Key}%' or b.Name like '%{request.Key}%')";
  194. else if (request.GroupFolderId > 0 && string.IsNullOrEmpty(request.Key))
  195. sqlCount += $"and a.ParentId = {request.GroupFolderId} ";
  196. else
  197. sql += $" and (a.FolderName like '%{request.Key}%' or b.Name like '%{request.Key}%')";
  198. sqlCount +=
  199. $" and a.UserId={request.UserId} and a.FolderType={groupConst} and a.IsDelete=0 {sqlValue} and (b.id>0 or a.AttributeValue=2)";
  200. pagedList.Total = await FindGroupByGroupFolderIdCountAsync(sqlCount);
  201. return pagedList;
  202. }
  203. /// <summary>
  204. /// 条数
  205. /// </summary>
  206. /// <param name="sql"></param>
  207. /// <returns></returns>
  208. public async Task<int> FindGroupByGroupFolderIdCountAsync(string sql)
  209. {
  210. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  211. var database = new Database(databaseType, _connectionString);
  212. var connection = database.GetConnection();
  213. var result = await connection.ExecuteScalarAsync<int>(sql);
  214. return result;
  215. }
  216. /// <summary>
  217. /// 获取小组详情
  218. /// </summary>
  219. /// <param name="request"></param>
  220. /// <returns></returns>
  221. public async Task<GroupDetailResult> GroupDetailAsync(GroupDetailRequest request)
  222. {
  223. var groupDetail = await _repository.GetAsync(request.GroupId);
  224. if (groupDetail == null)
  225. throw new BusinessException("小组不存在");
  226. if (!string.IsNullOrEmpty(groupDetail.AvatarUrl))
  227. groupDetail.AvatarUrl = StringUtils.AddDomain(groupDetail.AvatarUrl);
  228. if (!string.IsNullOrEmpty(groupDetail.QRCoder))
  229. groupDetail.QRCoder = StringUtils.AddDomain(groupDetail.QRCoder);
  230. var sql =
  231. "SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM tede_group_user a inner join tede_user b on a.UserId=b.Id inner join tede_department c on b.DepartmentId=c.Id where a.GroupId=@groupId order by a.GroupUserRoleId";
  232. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  233. var database = new Database(databaseType, _connectionString);
  234. var connection = database.GetConnection();
  235. var result =
  236. await connection
  237. .QueryAsync<GroupUserListResult, User, Department, GroupUserListResult>(sql,
  238. (groupUserListResult, user, department) =>
  239. {
  240. groupUserListResult.DepartmentName = department.Name;
  241. groupUserListResult.Name = user.Name;
  242. groupUserListResult.AvatarUrl = StringUtils.AddDomainMin(user.AvatarUrl);
  243. return groupUserListResult;
  244. }, new { groupId = request.GroupId }, splitOn: "Name");
  245. var groupDetailResult = _mapper.Map<GroupDetailResult>(groupDetail);
  246. groupDetailResult.GroupUserListResult = result;
  247. var groupUser = await _groupUserRepository.GetAsync(Q.Where(nameof(GroupUser.UserId), request.UserId)
  248. .Where(nameof(GroupUser.GroupId), request.GroupId));
  249. //获取当前用户的权限
  250. groupDetailResult.GroupUserRoleId = groupUser != null ? groupUser.GroupUserRoleId : 0;
  251. groupDetailResult.IsUDisturb = groupUser != null ? groupUser.IsUDisturb : false;
  252. //groupDetailResult.IsAdmin = groupUser != null ? groupUser.UserId == groupDetailResult.UserId : false;
  253. groupDetailResult.IsUser = groupUser != null ? groupUser.UserId == request.UserId : false;
  254. groupDetailResult.CreatedDate = groupDetail.CreatedDate;
  255. return groupDetailResult;
  256. }
  257. /// <summary>
  258. /// 搜索小组成员
  259. /// </summary>
  260. /// <param name="request"></param>
  261. /// <returns></returns>
  262. public async Task<IEnumerable<GroupUserListResult>> SearchGroupUserAsync(TopicDetailListRequest request)
  263. {
  264. string sql =
  265. $@"SELECT a.*, b.Name, b.AvatarUrl, c.Name FROM tede_group_user a INNER JOIN tede_user b ON a.UserId = b.Id INNER JOIN
  266. tede_department c ON b.DepartmentId = c.Id
  267. WHERE a.GroupId = {request.GroupId} and b.Name like '%{request.Key}%'";
  268. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  269. var database = new Database(databaseType, _connectionString);
  270. var connection = database.GetConnection();
  271. var result =
  272. await connection
  273. .QueryAsync<GroupUserListResult, User, Department, GroupUserListResult>(sql,
  274. (groupUserListResult, user, department) =>
  275. {
  276. groupUserListResult.DepartmentName = department.Name;
  277. groupUserListResult.Name = user.Name;
  278. groupUserListResult.AvatarUrl = StringUtils.AddDomainMin(user.AvatarUrl);
  279. return groupUserListResult;
  280. }, splitOn: "Name");
  281. return result;
  282. }
  283. /// <summary>
  284. /// 获取小组详情
  285. /// </summary>
  286. /// <param name="guId"></param>
  287. /// <param name="userId"></param>
  288. /// <returns></returns>
  289. public async Task<GroupDetailResult> GroupDetailByGuIdAsync(string guId, int userId)
  290. {
  291. var groupDetail = await _repository.GetAsync(Q.Where(nameof(Entity.Group.Guid), guId));
  292. if (groupDetail == null)
  293. throw new BusinessException("小组不存在");
  294. if (!string.IsNullOrEmpty(groupDetail.AvatarUrl))
  295. groupDetail.AvatarUrl = StringUtils.AddDomainMin(groupDetail.AvatarUrl);
  296. if (!string.IsNullOrEmpty(groupDetail.QRCoder))
  297. groupDetail.QRCoder = StringUtils.AddDomain(groupDetail.QRCoder);
  298. var sql =
  299. "SELECT a.*,b.Name,b.AvatarUrl,c.Name FROM tede_group_user a inner join tede_user b on a.UserId=b.Id inner join tede_department c on b.DepartmentId=c.Id where a.GroupId=@groupId";
  300. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  301. var database = new Database(databaseType, _connectionString);
  302. var connection = database.GetConnection();
  303. var result =
  304. await connection
  305. .QueryAsync<GroupUserListResult, User, Department, GroupUserListResult>(sql,
  306. (groupUserListResult, user, department) =>
  307. {
  308. groupUserListResult.DepartmentName = department.Name;
  309. groupUserListResult.Name = user.Name;
  310. groupUserListResult.AvatarUrl = StringUtils.AddDomainMin(user.AvatarUrl);
  311. return groupUserListResult;
  312. }, new { groupId = groupDetail.Id }, splitOn: "Name");
  313. var groupDetailResult = _mapper.Map<GroupDetailResult>(groupDetail);
  314. groupDetailResult.GroupUserListResult = result;
  315. var groupUser = await _groupUserRepository.GetAsync(Q.Where(nameof(GroupUser.UserId), userId)
  316. .Where(nameof(GroupUser.Guid), guId));
  317. groupDetailResult.GroupUserRoleId = groupUser?.GroupUserRoleId ?? GroupUserRoleTyeConst.General;
  318. //获取当前用户的权限
  319. return groupDetailResult;
  320. }
  321. /// <summary>
  322. /// 获取用户未读取话题数量
  323. /// </summary>
  324. /// <param name="userId"></param>
  325. /// <param name="groupId"></param>
  326. /// <returns></returns>
  327. public async Task<int> GetUReadCountAsync(int userId, int groupId)
  328. {
  329. string sql =
  330. @"select count(1) from tede_topic a inner join tede_topic_addressee b on a.Id=b.TopicId where b.UserId=@userId and b.IsRead=0 and a.GroupId=@groupId";
  331. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  332. var database = new Database(databaseType, _connectionString);
  333. var connection = database.GetConnection();
  334. var result = await connection.ExecuteScalarAsync<int>(sql, new { userId, groupId });
  335. return result;
  336. }
  337. /// <summary>
  338. /// 获取小组的共享话题数量
  339. /// </summary>
  340. /// <param name="groupId"></param>
  341. /// <returns></returns>
  342. public async Task<int> SharingCountAsync(int groupId)
  343. {
  344. var sql =
  345. $"select count(1) from tede_group_user where GroupId={groupId}";
  346. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  347. var database = new Database(databaseType, _connectionString);
  348. var connection = database.GetConnection();
  349. var result = await connection.ExecuteScalarAsync<int>(sql, new { GroupId = groupId });
  350. return result;
  351. }
  352. public async Task<Entity.Group> GetAsync(int id)
  353. {
  354. return await _repository.GetAsync(id);
  355. }
  356. /// <summary>
  357. /// 是开启管理员同意加入
  358. /// </summary>
  359. /// <param name="groupId"></param>
  360. /// <returns></returns>
  361. public async Task<bool> SetGroupIsAdminAsync(int groupId)
  362. {
  363. var group = await GetAsync(groupId);
  364. return await _repository.UpdateAsync(Q.Set(nameof(Entity.Group.IsAdmin), !group.IsAdmin)
  365. .Where(nameof(Entity.Group.Id), groupId)) > 0;
  366. }
  367. /// <summary>
  368. /// 是否禁言
  369. /// </summary>
  370. /// <param name="groupId"></param>
  371. /// <returns></returns>
  372. public async Task<bool> SetGroupIsWordsAsync(int groupId)
  373. {
  374. var group = await GetAsync(groupId);
  375. return await _repository.UpdateAsync(Q.Set(nameof(Entity.Group.IsWords), !group.IsWords)
  376. .Where(nameof(Entity.Group.Id), groupId)) > 0;
  377. }
  378. public async Task<List<JobGroupResult>> ElasticSearchGroup()
  379. {
  380. var sql = "select a.Id,a.GuId,a.UserId,b.Id,b.Name,b.AvatarUrl,b.CreatedDate,c.Name from tede_middle a inner join tede_group b on a.MiddleId=b.Id inner join tede_user c on c.Id=b.UserId where a.FolderType=7 and a.IsUpload=0 order by a.CreatedDate desc limit 0,100";
  381. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  382. var database = new Database(databaseType, _connectionString);
  383. var connection = database.GetConnection();
  384. var items = await connection
  385. .QueryAsync<JobGroupResult, Entity.Group, User, JobGroupResult>(sql,
  386. (jobGroupResult, group, user) =>
  387. {
  388. jobGroupResult.MiddleId = jobGroupResult.Id;
  389. jobGroupResult.Id = group.Id;
  390. jobGroupResult.Name = group != null ? group.Name : "";
  391. jobGroupResult.AvatarUrl = group != null ? group.AvatarUrl : "";
  392. return jobGroupResult;
  393. },
  394. splitOn: "Id,Id,Name");
  395. return items.ToList();
  396. }
  397. /// <summary>
  398. /// 根据广场类别查询小组
  399. /// </summary>
  400. /// <param name="categoryId"></param>
  401. /// <returns></returns>
  402. public async Task<IEnumerable<Entity.Group>> GetAllAsync(int categoryId)
  403. {
  404. var sql = $@"SELECT
  405. *,
  406. (SELECT
  407. COUNT(1)
  408. FROM
  409. tede_group_user
  410. WHERE
  411. GroupId = a.Id) AS UserCount,
  412. (SELECT
  413. COUNT(1)
  414. FROM
  415. tede_topic
  416. WHERE
  417. GroupId = a.Id) AS GroupArticleCount
  418. FROM
  419. tede_group a
  420. WHERE
  421. a.GroupCategroyId = {categoryId} and a.IsShow=1";
  422. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  423. var database = new Database(databaseType, _connectionString);
  424. var connection = database.GetConnection();
  425. var result = await connection.QueryAsync<Entity.Group>(sql);
  426. //return await _repository.GetAllAsync(Q.Where(nameof(Entity.Group.GroupCategroyId), categoryId));
  427. return result;
  428. }
  429. /// <summary>
  430. /// 用户小组列表
  431. /// </summary>
  432. /// <param name="userId"></param>
  433. /// <returns></returns>
  434. public async Task<IEnumerable<UserGroupList>> GetAllByUserIdAsync(int userId)
  435. {
  436. string sql = $@"SELECT
  437. Id,
  438. Name,
  439. AvatarUrl,
  440. (SELECT
  441. COUNT(1)
  442. FROM
  443. tede_group_user
  444. WHERE
  445. GroupId = a.Id) AS UserCount
  446. FROM
  447. tede_group a
  448. WHERE
  449. a.id IN (SELECT
  450. GroupId
  451. FROM
  452. ccpph_tede.tede_group_user
  453. WHERE
  454. UserId = {userId})";
  455. var databaseType = StringUtils.ToEnum<DatabaseType>(_databaseTypeStr, DatabaseType.MySql);
  456. var database = new Database(databaseType, _connectionString);
  457. var connection = database.GetConnection();
  458. var items = await connection
  459. .QueryAsync<UserGroupList>(sql);
  460. foreach (var item in items)
  461. {
  462. item.AvatarUrl = StringUtils.AddDomain(item.AvatarUrl);
  463. }
  464. return items;
  465. }
  466. }
  467. }