Просмотр исходного кода

添加页面默认样式编辑子接口

lichunlei 7 месяцев назад
Родитель
Сommit
943704d3a3

+ 73 - 0
Controllers/Admin/AppProjectPageStyleController.cs

@@ -0,0 +1,73 @@
+using Vo;
+using Microsoft.AspNetCore.Mvc;
+using Model;
+using Services;
+using Model.Base;
+using Vo.Admin;
+using Mapster;
+using Infrastructure;
+
+
+namespace Controllers.Admin
+{
+    /// <summary>
+    /// AppProjectPageStyle)Controller
+    /// </summary>
+    // [Route("${Router}$")]
+    // [ApiExplorerSettings(GroupName = "AppProjectPageStyle")]
+    public class AppProjectPageStyleController : BaseController
+    {
+        /// <summary>
+        /// api分组接口
+        /// </summary>
+        private readonly IAppProjectPageStyleService _AppProjectPageStyleService;
+
+
+        public AppProjectPageStyleController(IAppProjectPageStyleService AppProjectPageStyleService)
+        {
+            _AppProjectPageStyleService = AppProjectPageStyleService;
+
+        }
+
+        /// <summary>
+        /// 详情
+        /// </summary>
+        /// <param name="param">参数请求体</param>
+        /// <returns>详情</returns>
+        [HttpGet]
+        [Route("/v1/omega_source/AppProjectPageStyle/getAppProjectPageStyleQuery")]
+        public IActionResult getAppProjectPageStyleQuery([FromQuery] AppProjectPageStyle param)
+        {
+            var response = _AppProjectPageStyleService.GetFirst(m => m.id == param.id).Adapt<GetAppProjectPageStyleQueryVo>();
+            return SUCCESS(response);
+        }
+
+
+        /// <summary>
+        /// 编辑
+        /// </summary>
+        /// <param name="param">参数请求体</param>
+        /// <returns>编辑</returns>
+        [HttpPut]
+        [Route("/v1/omega_source/AppProjectPageStyle/updateAppProjectPageStyle")]
+        public IActionResult updateAppProjectPageStyle([FromBody] AppProjectPageStyle param)
+        {
+            var modal = param.Adapt<AppProjectPageStyle>().ToCreate(HttpContext);
+            var item = _AppProjectPageStyleService.GetFirst(m => m.appId == param.appId);
+            if(item == null)
+            {
+                _AppProjectPageStyleService.Add(modal);
+            }
+            else
+            {
+                modal.id = item.id;
+                _AppProjectPageStyleService.Update(modal, true);
+            }
+            return SUCCESS("ok");
+        }
+
+
+
+
+    }
+}

+ 113 - 0
Model/Database/AppProjectPageStyle.cs

@@ -0,0 +1,113 @@
+using Mapster;
+
+
+namespace Model
+{
+    /// <summary>
+    /// APP页面模板默认样式 app_project_page_style
+    /// </summary>
+    [SugarTable("app_project_page_style", "APP页面模板默认样式")]
+    [Tenant("0")]
+    public class AppProjectPageStyle
+    {
+        /// <summary>
+        /// APP项目ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "APP项目ID", ColumnName = "app_id")]
+        public int appId { get; set; }
+
+
+        /// <summary>
+        /// 背景色
+        /// </summary>
+        [SugarColumn(ColumnDescription = "背景色", Length = 6, ColumnName = "backgroud_color")]
+        public string? backgroudColor { get; set; }
+
+
+        /// <summary>
+        /// 前景色
+        /// </summary>
+        [SugarColumn(ColumnDescription = "前景色", Length = 6, ColumnName = "text_color")]
+        public string? textColor { get; set; }
+
+
+        /// <summary>
+        /// 苹果状态栏
+        /// </summary>
+        [SugarColumn(ColumnDescription = "苹果状态栏", Length = 10, ColumnName = "status_bar_style")]
+        public string? statusBarStyle { get; set; }
+
+
+        /// <summary>
+        /// 显示头部
+        /// </summary>
+        [SugarColumn(ColumnDescription = "显示头部", ColumnName = "show_title")]
+        public bool showTitle { get; set; }
+
+
+        /// <summary>
+        /// 页面滚动条
+        /// </summary>
+        [SugarColumn(ColumnDescription = "页面滚动条", ColumnName = "show_scroll_bar")]
+        public bool showScrollBar { get; set; }
+
+
+        /// <summary>
+        /// 手势侧滑返回
+        /// </summary>
+        [SugarColumn(ColumnDescription = "手势侧滑返回", ColumnName = "skid_flag")]
+        public bool skidFlag { get; set; }
+
+
+        /// <summary>
+        /// 顶部标题位置
+        /// </summary>
+        [SugarColumn(ColumnDescription = "顶部标题位置", Length = 10, ColumnName = "title_position")]
+        public string? titlePosition { get; set; }
+
+
+        /// <summary>
+        /// ID
+        /// </summary>
+        [SugarColumn(ColumnDescription = "ID", IsPrimaryKey = true, IsIdentity = true, ColumnName = "id")]
+        public int id { get; set; }
+
+
+        /// <summary>
+        /// 状态
+        /// </summary>
+        [SugarColumn(ColumnDescription = "状态", ColumnName = "status")]
+        public int status { get; set; }
+
+
+        /// <summary>
+        /// 排序
+        /// </summary>
+        [SugarColumn(ColumnDescription = "排序", ColumnName = "sort")]
+        public int sort { get; set; }
+
+
+        /// <summary>
+        /// 版本号
+        /// </summary>
+        [SugarColumn(ColumnDescription = "版本号", ColumnName = "version")]
+        public int version { get; set; }
+
+
+        /// <summary>
+        /// 创建时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "创建时间", ColumnName = "create_date")]
+        public DateTime? createDate { get; set; }
+
+
+        /// <summary>
+        /// 更新时间
+        /// </summary>
+        [SugarColumn(ColumnDescription = "更新时间", ColumnName = "update_date")]
+        public DateTime? updateDate { get; set; }
+
+
+
+    }
+}

+ 60 - 0
Model/Vo/Admin/GetAppProjectPageStyleQueryVo.cs

@@ -0,0 +1,60 @@
+using Newtonsoft.Json;
+
+namespace Vo.Admin
+{
+    /// <summary>
+    /// 详情
+    /// </summary>
+    public class GetAppProjectPageStyleQueryVo
+    {
+        /// <summary>
+        /// APP项目ID
+        /// </summary>
+        public int appId { 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 bool showScrollBar { get; set; }
+
+
+        /// <summary>
+        /// 手势侧滑返回
+        /// </summary>
+        public bool skidFlag { get; set; }
+
+
+        /// <summary>
+        /// 顶部标题位置
+        /// </summary>
+        public string titlePosition { get; set; }
+
+
+
+    }
+}

+ 19 - 0
Services/AppProjectPageStyleService.cs

@@ -0,0 +1,19 @@
+using Attribute;
+using Model;
+using Model.Base;
+using Repository;
+using Service;
+using Microsoft.AspNetCore.Mvc;
+
+
+namespace Services
+{
+    /// <summary>
+    /// APP页面模板默认样式Service业务层处理
+    /// </summary>
+    [AppService(ServiceType = typeof(IAppProjectPageStyleService), ServiceLifetime = LifeTime.Transient)]
+    public class AppProjectPageStyleService : BaseService<AppProjectPageStyle>, IAppProjectPageStyleService
+    {
+
+    }
+}

+ 12 - 0
Services/IService/IAppProjectPageStyleService.cs

@@ -0,0 +1,12 @@
+using Model;
+using Model.Base;
+using Microsoft.AspNetCore.Mvc;
+
+
+namespace Services
+{
+    public interface IAppProjectPageStyleService : IBaseService<AppProjectPageStyle>
+    {
+
+    }
+}