初始提交:浏览器首页 MyHomePage 全栈项目
# 项目概述 个人浏览器首页导航应用,支持书签分类管理、搜索引擎快捷搜索、 必应每日壁纸轮播、前后端分离部署,适配 1Panel 服务器(Docker 模式)。 # 技术栈 - 前端:Vue 3 + TypeScript + Vite + Pinia + Capacitor(Android 打包) - 后端:.NET 8 + SqlSugar(多数据库) + SQLite/MySQL + Swashbuckle - 部署:1Panel 应用商店自定义应用(Docker Compose 模式) # 项目结构 - backend/ .NET 8 API 后端(8 个 Controller + 15 个 Service) - frontend/ Vue 3 前端(19 个组件 + 9 个 API 模块 + 5 个 Store) - docker/ Docker 部署文件(后端镜像 + Nginx 反代) - docs/ 部署手册(1Panel 实战版) - scripts/ E2E 测试脚本 # 已实现功能 - 书签管理:增删改查 + 树形分类 + 拖拽排序 + 主色自适应 - 搜索引擎:8 个内置引擎 + 自定义引擎 + favicon 自动抓取 - 必应壁纸:每日轮播 + 多分辨率自动选择 + 1.6MP 质量优先 - 全局设置:主题/行为/数据/工具 4 分类 + 跨设备同步 - 文件上传:图标/书签/通用(容器持久化 + 跨域 URL 拼接) - 同步:基于变更日志的设备间数据同步 - 跨域部署:前后端分离 + runtime config.json 无需重新编译 # 进度记录 - 已完成 P0~P52 共 53 个开发节点(详细见 说明文档.md) - 当前版本:v1.0 部署就绪 # 部署文档 - README.md:项目说明 + 快速开始 - 说明文档.md:完整开发进度(中文) - docs/DEPLOY.md:1Panel 部署手册(Docker 模式)
This commit is contained in:
@@ -0,0 +1,59 @@
|
||||
using MyHomePage.Api.Models.Entities;
|
||||
|
||||
namespace MyHomePage.Api.Models.Dtos;
|
||||
|
||||
/// <summary>设置输出 DTO</summary>
|
||||
public class SettingDto
|
||||
{
|
||||
public string ThemeMode { get; set; } = "dark";
|
||||
public string AccentColor { get; set; } = "#6c5ce7";
|
||||
public string? BackgroundImage { get; set; }
|
||||
public string BackgroundType { get; set; } = "preset";
|
||||
public bool OpenLinksInNewTab { get; set; } = true;
|
||||
|
||||
/// <summary>搜索框行为(P46):true = 搜索结果在新选项卡打开(默认);false = 当前选项卡打开</summary>
|
||||
public bool OpenSearchInNewTab { get; set; } = true;
|
||||
|
||||
// ===== P34 360 在线壁纸模式 =====
|
||||
/// <summary>是否启用 360 在线壁纸(按分类随机 + 定时切换)</summary>
|
||||
public bool WallpaperEnabled { get; set; } = false;
|
||||
/// <summary>360 壁纸分类 ID,空字符串 = 全部/推荐</summary>
|
||||
public string WallpaperCategoryId { get; set; } = "";
|
||||
/// <summary>自动切换间隔(分钟),0 = 不自动切换</summary>
|
||||
public int WallpaperInterval { get; set; } = 30;
|
||||
|
||||
public DateTime UpdatedAt { get; set; }
|
||||
|
||||
/// <summary>从实体构造 DTO,统一所有 Controller / Service 的转换逻辑,避免漏字段。</summary>
|
||||
public static SettingDto FromEntity(Setting s) => new()
|
||||
{
|
||||
ThemeMode = s.ThemeMode,
|
||||
AccentColor = s.AccentColor,
|
||||
BackgroundImage = s.BackgroundImage,
|
||||
BackgroundType = s.BackgroundType,
|
||||
OpenLinksInNewTab = s.OpenLinksInNewTab != 0,
|
||||
OpenSearchInNewTab = s.OpenSearchInNewTab != 0,
|
||||
WallpaperEnabled = s.WallpaperEnabled != 0,
|
||||
WallpaperCategoryId = s.WallpaperCategoryId ?? "",
|
||||
WallpaperInterval = s.WallpaperInterval,
|
||||
UpdatedAt = s.UpdatedAt
|
||||
};
|
||||
}
|
||||
|
||||
/// <summary>设置更新入参(全部可选)</summary>
|
||||
public class SettingUpdateRequest
|
||||
{
|
||||
public string? ThemeMode { get; set; }
|
||||
public string? AccentColor { get; set; }
|
||||
public string? BackgroundImage { get; set; }
|
||||
public string? BackgroundType { get; set; }
|
||||
public bool? OpenLinksInNewTab { get; set; }
|
||||
|
||||
/// <summary>搜索框行为(P46):true = 搜索结果在新选项卡打开(默认);false = 当前选项卡打开</summary>
|
||||
public bool? OpenSearchInNewTab { get; set; }
|
||||
|
||||
// ===== P34 360 在线壁纸 =====
|
||||
public bool? WallpaperEnabled { get; set; }
|
||||
public string? WallpaperCategoryId { get; set; }
|
||||
public int? WallpaperInterval { get; set; }
|
||||
}
|
||||
Reference in New Issue
Block a user