Browse Source

弹窗公告接口

lifa 1 year ago
parent
commit
74494fb53a

+ 35 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/Dto/NoticeOutput.cs

@@ -0,0 +1,35 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+#region <<版本注释>>
+/* ---------------------------
+* 版权所有 (c) 2023 Frank 保留所有权利。
+* CLR版本:4.0.30319.42000
+* 机器名称:FRANK-WIN
+* 命名空间:ZhonTai.Admin.Services.DiTuiAPI.Dto
+* 唯一标识:516b6f6e-9980-412b-a688-3778ab716d20
+* 
+* 创建者:Frank
+* 电子邮箱: cfrank227@gmail.com
+* 创建时间:2023/5/25 9:24:11
+--------------------------*/
+#endregion <<版本注释>>
+
+namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
+{
+    public class NoticeOutput
+    {
+        /// <summary>
+        /// ID
+        /// </summary>
+        public long Id { get; set; }
+        public string Title { get; set; }
+        public string Desc { get; set; }
+        public string CreateTime { get; set; }
+        public string Unread { get; set; }
+    }
+}

+ 32 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/Dto/PopNoticeOutput.cs

@@ -0,0 +1,32 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+#region <<版本注释>>
+/* ---------------------------
+* 版权所有 (c) 2023 Frank 保留所有权利。
+* CLR版本:4.0.30319.42000
+* 机器名称:FRANK-WIN
+* 命名空间:ZhonTai.Admin.Services.DiTuiAPI.Dto
+* 唯一标识:8972a4bb-652d-49b0-8a14-64478e21898e
+* 
+* 创建者:Frank
+* 电子邮箱: cfrank227@gmail.com
+* 创建时间:2023/5/25 14:56:09
+--------------------------*/
+#endregion <<版本注释>>
+
+namespace ZhonTai.Admin.Services.DiTuiAPI.Dto
+{
+    public class PopNoticeOutput
+    {
+        public PopNoticeOutput(string content)
+        {
+            Content = content;
+        }
+        public string Content { get; set; }
+    }
+}

+ 27 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/INoticeService.cs

@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+
+
+#region <<版本注释>>
+/* ---------------------------
+* 版权所有 (c) 2023 Frank 保留所有权利。
+* CLR版本:4.0.30319.42000
+* 机器名称:FRANK-WIN
+* 命名空间:ZhonTai.Admin.Services.DiTuiAPI
+* 唯一标识:e507caa8-913e-4f69-8797-3e1b34ae1456
+* 
+* 创建者:Frank
+* 电子邮箱: cfrank227@gmail.com
+* 创建时间:2023/5/25 9:12:01
+--------------------------*/
+#endregion <<版本注释>>
+
+namespace ZhonTai.Admin.Services.DiTuiAPI
+{
+    public interface INoticeService
+    {
+    }
+}

+ 29 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/IndexService.cs

@@ -96,6 +96,7 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
             //notices.Add(new Notices("重要", "快手极速版直推版价格政策调整通知", "22"));
             //notices.Add(new Notices("最新", "12月平台项目重要通知请注意查看!12月平台项目重要通知请注意查看!", "33"));
             var notices = _noticeRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
+                .Where(m => m.IsAlter == 0)
                 .OrderByDescending(m=>m.Rank)
                 .ToList(m => new Notices()
                 {
@@ -275,6 +276,34 @@ namespace ZhonTai.Admin.Services.DiTuiAPI
             return projectOutput;
         }
 
+        /// <summary>
+        /// 弹窗公告
+        /// </summary>
+        /// <returns></returns>
+        [HttpGet]
+        [NoOprationLog]
+        public async Task<PopNoticeOutput> PopNoticeAsync()
+        {
+            //Expression<Func<ProjectEntity, bool>> where = (a => a.UserName == input.UserName);
+            Expression<Func<ProjectEntity, bool>> where = null;
+            //where = where.Or(input.Mobile.NotNull(), a => a.Mobile == input.Mobile)
+            //    .Or(input.Email.NotNull(), a => a.Email == input.Email);
+            var notice = await _noticeRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
+                .Where(a => a.IsAlter == 1)
+                .OrderByDescending(a => a.CreatedTime)
+                .FirstAsync(a => new PopNoticeOutput(a.Content));
+            // var notices = _noticeRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
+            //.OrderByDescending(m => m.Rank)
+            //.ToList(m => new Notices()
+            //{
+            //    Id = m.Id.ToString(),
+            //    Title = m.Title,
+            //    Tags = m.Tags
+            //});
+            return notice;
+        }
+
+
         private static bool IsInt(string inString)
         {
             Regex regex = new Regex("^[0-9]*[1-9][0-9]*$");

+ 127 - 0
src/platform/ZhonTai.Admin/Services/DiTuiAPI/NoticeService.cs

@@ -0,0 +1,127 @@
+using Microsoft.AspNetCore.Mvc;
+using NPOI.SS.Formula.PTG;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Threading.Tasks;
+using ZhonTai.Admin.Core.Attributes;
+using ZhonTai.Admin.Core.Consts;
+using ZhonTai.Admin.Repositories.Notice;
+using ZhonTai.Admin.Services.DiTuiAPI.Dto;
+using ZhonTai.DynamicApi;
+using ZhonTai.DynamicApi.Attributes;
+
+
+#region <<版本注释>>
+/* ---------------------------
+* 版权所有 (c) 2023 Frank 保留所有权利。
+* CLR版本:4.0.30319.42000
+* 机器名称:FRANK-WIN
+* 命名空间:ZhonTai.Admin.Services.DiTuiAPI
+* 唯一标识:2de10604-3043-4cef-b46f-96757f867b17
+* 
+* 创建者:Frank
+* 电子邮箱: cfrank227@gmail.com
+* 创建时间:2023/5/25 9:11:42
+--------------------------*/
+#endregion <<版本注释>>
+
+namespace ZhonTai.Admin.Services.DiTuiAPI
+{
+    [DynamicApi(Area = AdminConsts.DiTuiName)]
+    public class NoticeService : BaseService, INoticeService, IDynamicApi
+    {
+        private NoticeRepository _noticeRepository;
+
+        public NoticeService(NoticeRepository noticeRepository)
+        {
+            _noticeRepository = noticeRepository;
+        }
+
+
+        ///// <summary>
+        ///// 首页信息
+        ///// </summary>
+        ///// <returns></returns>
+        //[HttpGet]
+        //[NoOprationLog]
+        //public async Task<IndexOutput> IndexAsync()
+        //{
+        //    var uId = User?.Id;
+        //    var tenantId = User.TenantId;
+
+
+        //    IndexOutput indexOutPut = await _orgRepository.Select.DisableGlobalFilter()
+        //        .Where(a => a.TenantId == User.TenantId)
+        //        .FirstAsync(a => new IndexOutput(a.Id, a.Name));
+
+
+
+        //    //IndexOutput indexOutPut = new IndexOutput();
+        //    //indexOutPut.Name = "99地推";
+        //    indexOutPut.Tips = "推广要求:杜绝任何虚假、作弊、违法行为!";
+
+        //    List<Imgs> imgsList = new List<Imgs>();
+        //    imgsList.Add(new Imgs(
+        //        "https://test-dt.zhongjie51.com/assetsImg/lunbo1.png",
+        //        "1",
+        //        "11",
+        //        "2023-01-11 11:11:11",
+        //        "2023-11-11 11:11:11",
+        //        "99"
+        //        ));
+        //    imgsList.Add(new Imgs(
+        //        "https://test-dt.zhongjie51.com/assetsImg/lunbo2.png",
+        //        "2",
+        //        "222",
+        //        "2023-02-02 12:12:12",
+        //        "2023-12-22 14:59:49",
+        //        "99"
+        //        ));
+        //    imgsList.Add(new Imgs(
+        //        "https://test-dt.zhongjie51.com/assetsImg/lunbo3.png",
+        //        "3",
+        //        "333",
+        //        "2023-03-03 12:12:12",
+        //        "2023-12-30 14:59:49",
+        //        "99"
+        //        ));
+
+        //    indexOutPut.Imgs = imgsList;
+
+
+        //    //List<Notices> notices = new List<Notices>();
+        //    // 公告
+        //    //notices.Add(new Notices("最新","平台悬赏任务、游戏试玩任务上线通知…","11"));
+        //    //notices.Add(new Notices("重要", "快手极速版直推版价格政策调整通知", "22"));
+        //    //notices.Add(new Notices("最新", "12月平台项目重要通知请注意查看!12月平台项目重要通知请注意查看!", "33"));
+        //    var notices = _noticeRepository.Select.DisableGlobalFilter(FilterNames.Tenant)
+        //        .OrderByDescending(m => m.Rank)
+        //        .ToList(m => new Notices()
+        //        {
+        //            Id = m.Id.ToString(),
+        //            Title = m.Title,
+        //            Tags = m.Tags
+        //        });
+
+        //    indexOutPut.Notices = notices;
+
+        //    List<Settlement> settlements = new List<Settlement>();
+        //    settlements.Add(new Settlement("抖音电商1分购-高价版", "未结算"));
+        //    settlements.Add(new Settlement("京喜特价-发货版", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("抖音电商1分购-稳定版", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("兴业数字人民币", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("抖音极速地推版", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("易行通ETC(自助发货)", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("抖美团外卖-关注公众号", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("抖音电商1分购-高价版", "已结算至03月20日"));
+        //    settlements.Add(new Settlement("抖音电商1分购-高价版", "已结算至03月20日"));
+        //    ;
+        //    indexOutPut.settlement = settlements;
+
+        //    return indexOutPut;
+        //}
+
+    }
+}

+ 11 - 1
src/platform/ZhonTai.Admin/ZhonTai.Admin.xml

@@ -3124,6 +3124,11 @@
             查单链接
             </summary>
         </member>
+        <member name="P:ZhonTai.Admin.Domain.ProjectLink.ProjectLinkEntity.UsedUserId">
+            <summary>
+            用户ID
+            </summary>
+        </member>
         <member name="T:ZhonTai.Admin.Domain.Project.ProjectConfigEntity">
             <summary>
             项目配置
@@ -3284,6 +3289,11 @@
             项目统计
             </summary>
         </member>
+        <member name="P:ZhonTai.Admin.Domain.Project.ProjectStatEntity.UsedUserId">
+            <summary>
+            用户ID
+            </summary>
+        </member>
         <member name="P:ZhonTai.Admin.Domain.Project.ProjectStatEntity.ProjectId">
             <summary>
             项目Id
@@ -6054,7 +6064,7 @@
             </summary>
             <returns></returns>
         </member>
-        <member name="M:ZhonTai.Admin.Services.DiTuiAPI.IndexService.PopNoticeAsync(System.String)">
+        <member name="M:ZhonTai.Admin.Services.DiTuiAPI.IndexService.PopNoticeAsync">
             <summary>
             弹窗公告
             </summary>