From c60905e9e7f992a7f8c79c3812e92a44b2d606f5 Mon Sep 17 00:00:00 2001 From: "Somhairle H. Marisol" Date: Sun, 20 Sep 2026 22:59:00 +0800 Subject: feat(core): 建立 fund-lab 可运行基线 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit [变更性质] - 本提交冻结当前可构建、可测试的应用基线,不包含 PostgreSQL 持久化。 [新增功能] - 建立 F# Domain、API、Worker、Web 及测试项目。 - 增加 Bearer 认证、健康检查、账本领域模型和中文空状态页面。 [实现方案] - 使用环境变量模板注入认证配置,并排除数据、凭证和构建产物。 - 保留 19 个 Domain 测试和 5 个 API 测试作为后续变更基准。 [影响范围] - 为后续 3a PostgreSQL FOF 创建/读取切片提供可回滚基线。 - 当前仍不接入真实基金数据、真实交易或数据库。 --- src/FundLab.Web/App.fs | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 src/FundLab.Web/App.fs (limited to 'src/FundLab.Web/App.fs') diff --git a/src/FundLab.Web/App.fs b/src/FundLab.Web/App.fs new file mode 100644 index 0000000..630a8e9 --- /dev/null +++ b/src/FundLab.Web/App.fs @@ -0,0 +1,41 @@ +module FundLab.Web + +open Elmish +open Elmish.React +open Feliz + +type Model = + { + hasFund: bool + } + +type Msg = + | CreateFundRequested + +let init () = + { hasFund = false } + +let update message model = + match message with + | CreateFundRequested -> model + +let view model dispatch = + Html.main [ + prop.className "empty-state" + prop.children [ + Html.p [ prop.className "eyebrow"; prop.text "FUND LAB" ] + Html.h1 "尚未创建基金" + Html.p "先创建一支人民币模拟基金,再选择基金代码和持仓金额。" + Html.p (if model.hasFund then "已创建基金" else "尚未选择投资") + Html.button [ + prop.className "primary-action" + prop.text "创建基金" + prop.onClick (fun _ -> dispatch CreateFundRequested) + ] + ] + ] + +let start () = + Program.mkSimple init update view + |> Program.withReactSynchronous "fund-lab-root" + |> Program.run -- cgit v1.2.3