qinchaoyue před 10 hodinami
rodič
revize
5a89b969a3

+ 0 - 1
src/Hotline.Api/Controllers/IdentityController.cs

@@ -121,7 +121,6 @@ jxrWXHbT1FB6DqkdOnBbQqS1Azqz5HxLlSyEK3F60e3SgB5iZsDZ
     public async Task<Dictionary<string, object>> GetThirdTokenAsync([FromBody] ThirdTokenInDto dto)
         => await _identityAppService.GetThirdTokenAsync(dto, HttpContext.RequestAborted);
 
-
     /// <summary>
     /// 第三方登录
     /// </summary>

+ 10 - 1
src/Hotline.Api/Controllers/Snapshot/SnapshotController.cs

@@ -376,7 +376,7 @@ public class SnapshotController : BaseController
     }
 
     /// <summary>
-    /// 获取消息
+    /// 获取消息集合
     /// </summary>
     /// <param name="dto"></param>
     /// <returns></returns>
@@ -384,6 +384,15 @@ public class SnapshotController : BaseController
     public async Task<IList<GetNotifyOutDto>> GetNotificationAsync([FromQuery] GetNotifyInDto dto)
         => await _snapshotApplication.GetNotificationAsync(dto, HttpContext.RequestAborted);
 
+    /// <summary>
+    /// 获取消息详情
+    /// </summary>
+    /// <returns></returns>
+    [HttpGet("notification/{id}")]
+    public async Task<BulletinOutDto> GetNotificationDetailsAsync(string id)
+        => await _snapshotApplication.GetNotificationDetailsAsync(id, HttpContext.RequestAborted);
+
+
     #region 积分
     /// <summary>
     /// 积分榜

+ 8 - 0
src/Hotline.Application/Snapshot/Contracts/ISnapshotApplication.cs

@@ -236,4 +236,12 @@ public interface ISnapshotApplication
     Task<int> GetPointsTotalAsync(PointItemsInDto dto, CancellationToken requestAborted);
 
     Task<IList<GetNotifyOutDto>> GetNotificationAsync(GetNotifyInDto dto, CancellationToken requestAborted);
+
+    /// <summary>
+    /// 获取通知详情
+    /// </summary>
+    /// <param name="id"></param>
+    /// <param name="requestAborted"></param>
+    /// <returns></returns>
+    Task<BulletinOutDto> GetNotificationDetailsAsync(string id, CancellationToken requestAborted);
 }

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
src/Hotline.Application/Snapshot/DefaultSnapshotApplication.cs


+ 44 - 5
src/Hotline.Application/Snapshot/SnapshotApplicationBase.cs

@@ -42,6 +42,7 @@ using Microsoft.Extensions.Options;
 using XF.Utility.MQ;
 using System.Threading;
 using BulletinOutDto = Hotline.Share.Dtos.Article.BulletinOutDto;
+using Hotline.Article;
 using NPOI.SS.Formula.Functions;
 
 namespace Hotline.Application.Snapshot;
@@ -89,8 +90,9 @@ public abstract class SnapshotApplicationBase
     private readonly ISnapshotPointsRecordRepository _pointsRecordRepository;
     private readonly IOptionsSnapshot<MqConfiguration> _mqConfiguration;
     private readonly INotificationReceiverRepository _notificationReceiverRepository;
+    private readonly INotificationRepository _notificationRepository;
 
-    public SnapshotApplicationBase(IThirdIdentiyService thirdLoginService, IIndustryRepository industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRedPackRecordRepository redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository, ISystemLogRepository systemLog, IGuiderSystemService guiderSystemService, ICapPublisher capPublisher, Publisher publisher, IFileDomainService fileDomainService, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IOrderVisitRepository orderVisitRepository, IOrderVisitDetailRepository orderVisitDetailRepository, IRedPackGuiderAuditRepository redPackGuiderAuditRepository, IInviteCodeRecordRepository inviteCodeRecordRepository, IInviteCodeRepository inviteCodeRepository, ICitizenRepository citizenRepository, ISnapshotPointsRecordRepository snapshotPointsRecordRepository, IOptionsSnapshot<MqConfiguration> mqConfiguration, INotificationReceiverRepository notificationReceiverRepository)
+    public SnapshotApplicationBase(IThirdIdentiyService thirdLoginService, IIndustryRepository industryRepository, ISnapshotBulletinRepository bulletinRepository, ISessionContext sessionContext, IRedPackRecordRepository redPackRecordRepository, IRepository<Order> orderRepository, IThirdAccountRepository thirdAccountRepository, IOrderSnapshotRepository orderSnapshotRepository, ISystemSettingCacheManager systemSettingCacheManager, ISystemAreaDomainService systemAreaDomainService, IFileRepository fileRepository, ISystemDicDataCacheManager systemDicDataCacheManager, ISnapshotOrderPublishRepository snapshotOrderPublishRepository, IRepository<WorkflowTrace> workflowTraceRepository, IPractitionerRepository practitionerRepository, IRepository<SystemArea> systemAreaRepository, IVolunteerRepository volunteerRepository, IVolunteerReportRepository volunteerReportRepository, ISystemLogRepository systemLog, IGuiderSystemService guiderSystemService, ICapPublisher capPublisher, Publisher publisher, IFileDomainService fileDomainService, ICommunityInfoRepository communityInfoRepository, IRedPackAuditRepository redPackAuditRepository, IOrderVisitRepository orderVisitRepository, IOrderVisitDetailRepository orderVisitDetailRepository, IRedPackGuiderAuditRepository redPackGuiderAuditRepository, IInviteCodeRecordRepository inviteCodeRecordRepository, IInviteCodeRepository inviteCodeRepository, ICitizenRepository citizenRepository, ISnapshotPointsRecordRepository snapshotPointsRecordRepository, IOptionsSnapshot<MqConfiguration> mqConfiguration, INotificationReceiverRepository notificationReceiverRepository, INotificationRepository notificationRepository)
     {
         _thirdLoginService = thirdLoginService;
         _industryRepository = industryRepository;
@@ -126,6 +128,7 @@ public abstract class SnapshotApplicationBase
         _pointsRecordRepository = snapshotPointsRecordRepository;
         _mqConfiguration = mqConfiguration;
         _notificationReceiverRepository = notificationReceiverRepository;
+        _notificationRepository = notificationRepository;
     }
 
     #region 小程序
@@ -410,6 +413,34 @@ public abstract class SnapshotApplicationBase
         return items;
     }
 
+    /// <summary>
+    /// 获取通知详情
+    /// </summary>
+    /// <param name="id"></param>
+    /// <param name="requestAborted"></param>
+    /// <returns></returns>
+    public async Task<BulletinOutDto> GetNotificationDetailsAsync(string id, CancellationToken token)
+    {
+        var outDto = await _notificationRepository.Queryable()
+            .LeftJoin<SnapshotBulletin>((notify, bulletin) => notify.ExternalId == bulletin.Id)
+            .Where((notify, bulletin) => notify.Id == id)
+            .Select((notify, bulletin) => new BulletinOutDto
+            {
+                Id = bulletin.Id,
+                Title = bulletin.Title,
+                CreationTime = bulletin.CreationTime,
+                Content = bulletin.Content,
+                VideoPath = bulletin.VideoPath
+            })
+            .FirstAsync(token);
+        await _notificationReceiverRepository.Updateable()
+            .SetColumns(m => m.IsRead, true)
+            .Where(m => m.NotificationId == id && m.ReceiverId == _sessionContext.UserId)
+            .ExecuteCommandAsync(token);
+
+        return outDto;
+    }
+
     /// <summary>
     /// 获取工单详情
     /// </summary>
@@ -1064,7 +1095,7 @@ public abstract class SnapshotApplicationBase
         outDto.VideoBulletin = await _notificationReceiverRepository.Queryable()
             .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
             .LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
-            .Where((receiver, notify) => receiver.ReceiverId == _sessionContext.UserId)
+            .Where((receiver, notify, bulletin) => receiver.ReceiverId == _sessionContext.UserId && bulletin.Shape == EBulletinShape.Video)
             .GroupBy((receiver, notify, bulletin) => new 
             {
                 notify.Title,
@@ -1087,7 +1118,10 @@ public abstract class SnapshotApplicationBase
         {
             Items = await _notificationReceiverRepository.Queryable()
                 .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
-                .Select((receiver, notify) => new PointsBulletinItemsOutDto
+                .LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
+                .Where((receiver, notify, bulletin) => bulletin.Shape == EBulletinShape.Message)
+                .GroupBy((receiver, notify, bulletin) => new { notify.ExternalId, notify.Title})
+                .Select((receiver, notify, bulletin) => new PointsBulletinItemsOutDto
                 {
                     BulletinId = notify.ExternalId,
                     Title = notify.Title,
@@ -1095,8 +1129,13 @@ public abstract class SnapshotApplicationBase
                 .Take(2)
                 .ToListAsync(),
             UnReadCount = await _notificationReceiverRepository.Queryable()
-            .Where(m => m.IsRead == false && m.ReceiverId == _sessionContext.UserId)
-            .CountAsync()
+                .LeftJoin<Notification>((receiver, notify) => notify.Id == receiver.NotificationId)
+                .LeftJoin<SnapshotBulletin>((receiver, notify, bulletin) => bulletin.Id == notify.ExternalId)
+                .Where((receiver, notify, bulletin) => receiver.IsRead == false 
+                && receiver.ReceiverId == _sessionContext.UserId 
+                && bulletin.Shape == EBulletinShape.Message)
+                .GroupBy((receiver, notify, bulletin) => new { receiver.ReceiverId, receiver.NotificationId})
+                .CountAsync()
         };
 
         return outDto;

Rozdílová data souboru nebyla zobrazena, protože soubor je příliš velký
+ 0 - 0
src/Hotline.Application/Snapshot/ZiGongSnapshotApplication.cs


+ 5 - 0
src/Hotline.Share/Dtos/Article/BulletinDto.cs

@@ -586,6 +586,11 @@ namespace Hotline.Share.Dtos.Article
         /// </summary>
         public string Content { get; set; }
 
+        /// <summary>
+        /// 视频地址
+        /// </summary>
+        public string? VideoPath { get; set; }
+
         public DateTime CreationTime { get; set; }
     }
 }

+ 23 - 0
src/Hotline/SeedData/SystemMenuSeedData.cs

@@ -0,0 +1,23 @@
+using Hotline.Settings;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using XF.Domain.Entities;
+
+namespace Hotline.SeedData;
+
+public class SystemMenuSeedData : ISeedData<SystemDicData>
+{
+    public IEnumerable<SystemDicData> HasData()
+    {
+        return new List<SystemDicData>();
+    }
+
+    public IEnumerable<SystemMenu> GetData()
+    {
+         throw new  NotImplementedException();
+        //return [new() { Id = }];
+    }
+}

Některé soubory nejsou zobrazeny, neboť je v těchto rozdílových datech změněno mnoho souborů