lcl 9 сар өмнө
parent
commit
3138229751

+ 94 - 0
Controller/Client/AppController.cs

@@ -0,0 +1,94 @@
+using Attribute;
+using Common;
+using Dto;
+using Vo;
+using Enums;
+using Filters;
+using Infrastructure;
+using Infrastructure.Model;
+using Mapster;
+using Microsoft.AspNetCore.Mvc;
+using Middleware;
+using Model;
+using Services.Client;
+using Model.Base;
+
+namespace Controllers
+{
+    /// <summary>
+    /// App)Controller
+    /// </summary>
+    // [Route("app")]
+    // [ApiExplorerSettings(GroupName = "App")]
+    public class AppController : BaseController
+    {
+        /// <summary>
+        /// api分组接口
+        /// </summary>
+        private readonly IAppBottomNavsService _AppBottomNavsService;
+        private readonly IFileUpdateInfoService _FileUpdateInfoService;
+        private readonly IPageUpdateInfoService _PageUpdateInfoService;
+
+
+        public AppController(IAppBottomNavsService AppBottomNavsService,IFileUpdateInfoService FileUpdateInfoService,IPageUpdateInfoService PageUpdateInfoService)
+        {
+            _AppBottomNavsService = AppBottomNavsService;
+            _FileUpdateInfoService = FileUpdateInfoService;
+            _PageUpdateInfoService = PageUpdateInfoService;
+
+        }
+
+        /// <summary>
+        /// APP底部导航列表
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP底部导航列表</returns>
+        [HttpGet]
+        [Route("/v1/kxsconfig/app/appBottomNavs")]
+        public IActionResult AppBottomNavs([FromQuery] AppAppBottomNavsDto parm)
+        {
+            var response = _AppBottomNavsService.AppBottomNavs(parm);
+            return SUCCESS(response);
+        }
+
+
+
+
+        /// <summary>
+        /// APP静态资源
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP静态资源</returns>
+        [HttpGet]
+        [Route("/v1/kxsconfig/app/staticFiles")]
+        public IActionResult StaticFiles([FromQuery] AppStaticFilesDto parm)
+        {
+            var response = _FileUpdateInfoService.StaticFiles(parm);
+            return SUCCESS(response);
+        }
+
+
+
+
+        /// <summary>
+        /// APP页面数据检查
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP页面数据检查</returns>
+        [HttpGet]
+        [Route("/v1/kxsconfig/app/pageInfo")]
+        public IActionResult PageInfo([FromQuery] AppPageInfoDto parm)
+        {
+            var response = _PageUpdateInfoService.Queryable()
+                .First(x => x.modulePath == parm.modulePath)
+                .Adapt<AppPageInfoVo>() ?? new AppPageInfoVo();
+            return SUCCESS(response);
+        }
+
+
+
+
+
+
+    }
+}

+ 7 - 0
Model/Database/AppBottomNavs.cs

@@ -164,6 +164,13 @@ namespace Model
         public DateTime? updateDate { get; set; }
 
 
+        /// <summary>
+        /// 分类
+        /// </summary>
+        [SugarColumn(ColumnDescription = "分类", Length = 50, ColumnName = "kind")]
+        public string kind { get; set; }
+
+
 
     }
 }

+ 7 - 0
Model/Database/FileUpdateInfo.cs

@@ -73,6 +73,13 @@ namespace Model
         public DateTime? updateDate { get; set; }
 
 
+        /// <summary>
+        /// 分类
+        /// </summary>
+        [SugarColumn(ColumnDescription = "分类", Length = 50, ColumnName = "kind")]
+        public string kind { get; set; }
+
+
 
     }
 }

+ 7 - 0
Model/Database/PageUpdateInfo.cs

@@ -185,6 +185,13 @@ namespace Model
         public DateTime? updateDate { get; set; }
 
 
+        /// <summary>
+        /// 分类
+        /// </summary>
+        [SugarColumn(ColumnDescription = "分类", Length = 50, ColumnName = "kind")]
+        public string kind { get; set; }
+
+
 
     }
 }

+ 21 - 0
Model/Dto/Client/AppAppBottomNavsDto.cs

@@ -0,0 +1,21 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Model.Base;
+
+namespace Dto
+{
+    /// <summary>
+    /// 底部导航列表
+    /// </summary>
+    public class AppAppBottomNavsDto
+    {
+        /// <summary>
+        /// 分类
+        /// </summary>
+        [Required(ErrorMessage = "分类不能为空")]
+        public string? kind { get; set; }
+
+
+
+    }
+}

+ 28 - 0
Model/Dto/Client/AppPageInfoDto.cs

@@ -0,0 +1,28 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Model.Base;
+
+namespace Dto
+{
+    /// <summary>
+    /// 页面数据检查
+    /// </summary>
+    public class AppPageInfoDto
+    {
+        /// <summary>
+        /// 模板路径
+        /// </summary>
+        [Required(ErrorMessage = "模板路径不能为空")]
+        public string? modulePath { get; set; }
+
+
+        /// <summary>
+        /// 分类
+        /// </summary>
+        [Required(ErrorMessage = "分类不能为空")]
+        public string? kind { get; set; }
+
+
+
+    }
+}

+ 21 - 0
Model/Dto/Client/AppStaticFilesDto.cs

@@ -0,0 +1,21 @@
+using System;
+using System.ComponentModel.DataAnnotations;
+using Model.Base;
+
+namespace Dto
+{
+    /// <summary>
+    /// 静态资源
+    /// </summary>
+    public class AppStaticFilesDto
+    {
+        /// <summary>
+        /// 分类
+        /// </summary>
+        [Required(ErrorMessage = "分类不能为空")]
+        public string? kind { get; set; }
+
+
+
+    }
+}

+ 120 - 0
Model/Vo/Client/AppAppBottomNavsVo.cs

@@ -0,0 +1,120 @@
+using Newtonsoft.Json;
+
+namespace Vo
+{
+    /// <summary>
+    /// 底部导航列表
+    /// </summary>
+    public class AppAppBottomNavsVo
+    {
+        /// <summary>
+        /// 标题
+        /// </summary>
+        public string title { get; set; }
+
+
+        /// <summary>
+        /// 选中图标
+        /// </summary>
+        public string selectIcon { get; set; }
+
+
+        /// <summary>
+        /// 未选中图标
+        /// </summary>
+        public string normalIcon { get; set; }
+
+
+        /// <summary>
+        /// 选中文字颜色
+        /// </summary>
+        public string selectTextColor { get; set; }
+
+
+        /// <summary>
+        /// 未选中文字颜色
+        /// </summary>
+        public string normalTextColor { get; set; }
+
+
+        /// <summary>
+        /// 关联页面文件
+        /// </summary>
+        public string pageName { get; set; }
+
+
+        /// <summary>
+        /// 空页面提示信息
+        /// </summary>
+        public string noPageHint { get; set; }
+
+
+        /// <summary>
+        /// 背景色
+        /// </summary>
+        public string backgroudColor { get; set; }
+
+
+        /// <summary>
+        /// 按钮样式
+        /// </summary>
+        public string style { get; set; }
+
+
+        /// <summary>
+        /// 滚动图片
+        /// </summary>
+        public string scrollerAnimationImages { get; set; }
+
+
+        /// <summary>
+        /// PAG文件
+        /// </summary>
+        public string pagPath { get; set; }
+
+
+        /// <summary>
+        /// 是否显示标题
+        /// </summary>
+        public bool showTitle { get; set; }
+
+
+        /// <summary>
+        /// pag文件路径
+        /// </summary>
+        public string pagLocalPath { get; set; }
+
+
+        /// <summary>
+        /// pag默认图标
+        /// </summary>
+        public string pagDefaultIcon { get; set; }
+
+
+        /// <summary>
+        /// 图标尺寸
+        /// </summary>
+        public int iconSize { get; set; }
+
+
+        /// <summary>
+        /// 状态栏底色
+        /// </summary>
+        public string statusBarColor { get; set; }
+
+
+        /// <summary>
+        /// ID
+        /// </summary>
+        public int id { get; set; }
+
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        public int status { get; set; }
+
+
+
+    }
+}

+ 138 - 0
Model/Vo/Client/AppPageInfoVo.cs

@@ -0,0 +1,138 @@
+using Newtonsoft.Json;
+
+namespace Vo
+{
+    /// <summary>
+    /// 页面数据检查
+    /// </summary>
+    public class AppPageInfoVo
+    {
+        /// <summary>
+        /// 模板更新版本
+        /// </summary>
+        public int moduleVersion { get; set; }
+
+
+        /// <summary>
+        /// 模板路径
+        /// </summary>
+        public string modulePath { get; set; }
+
+
+        /// <summary>
+        /// 背景色
+        /// </summary>
+        public string backgroudColor { get; set; }
+
+
+        /// <summary>
+        /// 前景色
+        /// </summary>
+        public string textColor { get; set; }
+
+
+        /// <summary>
+        /// 苹果状态栏
+        /// </summary>
+        public string statusBarStyle { get; set; }
+
+
+        /// <summary>
+        /// 是否显示头部
+        /// </summary>
+        public bool showTitle { get; set; }
+
+
+        /// <summary>
+        /// 顶部标题
+        /// </summary>
+        public string title { get; set; }
+
+
+        /// <summary>
+        /// 是否显示滚动条
+        /// </summary>
+        public bool showScrollBar { get; set; }
+
+
+        /// <summary>
+        /// 是否侧滑返回
+        /// </summary>
+        public bool skidFlag { get; set; }
+
+
+        /// <summary>
+        /// 左侧按钮1
+        /// </summary>
+        public string leftBtn1 { get; set; }
+
+
+        /// <summary>
+        /// 左侧按钮2
+        /// </summary>
+        public string leftBtn2 { get; set; }
+
+
+        /// <summary>
+        /// 右侧按钮1
+        /// </summary>
+        public string rightBtn1 { get; set; }
+
+
+        /// <summary>
+        /// 右侧按钮2
+        /// </summary>
+        public string rightBtn2 { get; set; }
+
+
+        /// <summary>
+        /// 左侧按钮1点击事件
+        /// </summary>
+        public string leftAction1 { get; set; }
+
+
+        /// <summary>
+        /// 左侧按钮2点击事件
+        /// </summary>
+        public string leftAction2 { get; set; }
+
+
+        /// <summary>
+        /// 右侧按钮1点击事件
+        /// </summary>
+        public string rightAction1 { get; set; }
+
+
+        /// <summary>
+        /// 右侧按钮2点击事件
+        /// </summary>
+        public string rightAction2 { get; set; }
+
+
+        /// <summary>
+        /// 是否强制更新
+        /// </summary>
+        public bool mustUpdate { get; set; }
+
+
+        /// <summary>
+        /// ID
+        /// </summary>
+        public int id { get; set; }
+
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        public int status { get; set; }
+
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        public DateTime? createDate { get; set; }
+
+
+
+    }
+}

+ 48 - 0
Model/Vo/Client/AppStaticFilesVo.cs

@@ -0,0 +1,48 @@
+using Newtonsoft.Json;
+
+namespace Vo
+{
+    /// <summary>
+    /// 静态资源
+    /// </summary>
+    public class AppStaticFilesVo
+    {
+        /// <summary>
+        /// 更新版本
+        /// </summary>
+        public int versionNum { get; set; }
+
+
+        /// <summary>
+        /// 路径
+        /// </summary>
+        public string path { get; set; }
+
+
+        /// <summary>
+        /// 文件名
+        /// </summary>
+        public string fileName { get; set; }
+
+
+        /// <summary>
+        /// ID
+        /// </summary>
+        public int id { get; set; }
+
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        public int status { get; set; }
+
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        public DateTime? createDate { get; set; }
+
+
+
+    }
+}

+ 41 - 0
Services/Client/AppBottomNavsService.cs

@@ -0,0 +1,41 @@
+using Attribute;
+using Dto;
+using Vo;
+using Model;
+using Model.Base;
+
+using Repository;
+using Service;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Services.Client
+{
+    /// <summary>
+    /// app底部导航Service业务层处理
+    /// </summary>
+    [AppService(ServiceType = typeof(IAppBottomNavsService), ServiceLifetime = LifeTime.Transient)]
+    public class AppBottomNavsService : BaseService<AppBottomNavs>, IAppBottomNavsService
+    {
+        /// <summary>
+        /// APP-底部导航列表
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP底部导航列表</returns>
+        public PagedInfo<AppAppBottomNavsVo> AppBottomNavs([FromQuery] AppAppBottomNavsDto parm)
+        {
+            //开始拼装查询条件
+            var predicate = Expressionable.Create<AppBottomNavs>();
+            predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
+            var response = Queryable()
+                .Where(predicate.ToExpression())
+                .OrderByDescending(m => m.id)
+                .ToPage<AppBottomNavs, AppAppBottomNavsVo>(new PagerInfo());
+            return response;
+        }
+
+
+
+
+
+    }
+}

+ 41 - 0
Services/Client/FileUpdateInfoService.cs

@@ -0,0 +1,41 @@
+using Attribute;
+using Dto;
+using Vo;
+using Model;
+using Model.Base;
+
+using Repository;
+using Service;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Services.Client
+{
+    /// <summary>
+    /// 资源文件更新信息Service业务层处理
+    /// </summary>
+    [AppService(ServiceType = typeof(IFileUpdateInfoService), ServiceLifetime = LifeTime.Transient)]
+    public class FileUpdateInfoService : BaseService<FileUpdateInfo>, IFileUpdateInfoService
+    {
+        /// <summary>
+        /// APP-静态资源
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP静态资源</returns>
+        public PagedInfo<AppStaticFilesVo> StaticFiles([FromQuery] AppStaticFilesDto parm)
+        {
+            //开始拼装查询条件
+            var predicate = Expressionable.Create<FileUpdateInfo>();
+            predicate = predicate.AndIF(!string.IsNullOrEmpty(parm.kind), m => m.kind.Contains(parm.kind));
+            var response = Queryable()
+                .Where(predicate.ToExpression())
+                .OrderByDescending(m => m.id)
+                .ToPage<FileUpdateInfo, AppStaticFilesVo>(new PagerInfo());
+            return response;
+        }
+
+
+
+
+
+    }
+}

+ 23 - 0
Services/Client/PageUpdateInfoService.cs

@@ -0,0 +1,23 @@
+using Attribute;
+using Dto;
+using Vo;
+using Model;
+using Model.Base;
+
+using Repository;
+using Service;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Services.Client
+{
+    /// <summary>
+    /// 页面模板更新信息Service业务层处理
+    /// </summary>
+    [AppService(ServiceType = typeof(IPageUpdateInfoService), ServiceLifetime = LifeTime.Transient)]
+    public class PageUpdateInfoService : BaseService<PageUpdateInfo>, IPageUpdateInfoService
+    {
+
+
+
+    }
+}

+ 21 - 0
Services/IService/Client/IAppBottomNavsService.cs

@@ -0,0 +1,21 @@
+using Dto;
+using Vo;
+using Model;
+using Model.Base;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Services.Client
+{
+    public interface IAppBottomNavsService : IBaseService<AppBottomNavs>
+    {
+        /// <summary>
+        /// APP-底部导航列表
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP底部导航列表</returns>
+        PagedInfo<AppAppBottomNavsVo> AppBottomNavs([FromQuery] AppAppBottomNavsDto parm);
+
+
+
+    }
+}

+ 21 - 0
Services/IService/Client/IFileUpdateInfoService.cs

@@ -0,0 +1,21 @@
+using Dto;
+using Vo;
+using Model;
+using Model.Base;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Services.Client
+{
+    public interface IFileUpdateInfoService : IBaseService<FileUpdateInfo>
+    {
+        /// <summary>
+        /// APP-静态资源
+        /// </summary>
+        /// <param name="parm">请求参数</param>
+        /// <returns>APP静态资源</returns>
+        PagedInfo<AppStaticFilesVo> StaticFiles([FromQuery] AppStaticFilesDto parm);
+
+
+
+    }
+}

+ 15 - 0
Services/IService/Client/IPageUpdateInfoService.cs

@@ -0,0 +1,15 @@
+using Dto;
+using Vo;
+using Model;
+using Model.Base;
+using Microsoft.AspNetCore.Mvc;
+
+namespace Services.Client
+{
+    public interface IPageUpdateInfoService : IBaseService<PageUpdateInfo>
+    {
+
+
+
+    }
+}