commit c6465480a91cd9ae98ecd5f1a655a19484bcc70f
Author: MSuMshk <2039814060@qq.com>
Date: Mon Mar 9 13:13:41 2026 +0800
feat: initialize mini api skeleton
diff --git a/.dockerignore b/.dockerignore
new file mode 100644
index 0000000..f110f32
--- /dev/null
+++ b/.dockerignore
@@ -0,0 +1,37 @@
+.git/
+.gitignore
+.gitattributes
+.gitmodules
+.github/
+.svn/
+.hg/
+.vs/
+.idea/
+.vscode/
+*.suo
+*.user
+*.userosscache
+*.sln.docstates
+**/*.csproj.user
+**/bin/
+**/obj/
+**/TestResults/
+**/coverage/
+**/artifacts/
+**/node_modules/
+**/bower_components/
+**/dist/
+**/build/
+**/.next/
+**/.nuxt/
+**/.output/
+*.log
+*.tmp
+*.temp
+*.swp
+*.bak
+*.cache
+*.pid
+*.pdb
+.DS_Store
+Thumbs.db
diff --git a/.editorconfig b/.editorconfig
new file mode 100644
index 0000000..6c8b717
--- /dev/null
+++ b/.editorconfig
@@ -0,0 +1,13 @@
+# EditorConfig
+root = true
+
+[*.cs]
+dotnet_diagnostic.SA1600.severity = error
+dotnet_diagnostic.SA1601.severity = error
+dotnet_diagnostic.SA1615.severity = error
+dotnet_diagnostic.SA1629.severity = none
+dotnet_diagnostic.SA1202.severity = none
+dotnet_diagnostic.SA1200.severity = none
+dotnet_diagnostic.SA1623.severity = none
+dotnet_diagnostic.SA1111.severity = none
+dotnet_diagnostic.SA1101.severity = none
diff --git a/.gitignore b/.gitignore
new file mode 100644
index 0000000..497ab73
--- /dev/null
+++ b/.gitignore
@@ -0,0 +1,11 @@
+.vs/
+bin/
+obj/
+**/bin/
+**/obj/
+.claude/
+*.log
+/src/Api/TakeoutSaaS.MiniApi/TakeoutSaaS.MiniApi.csproj.user
+
+# 保留根目录 scripts 目录提交
+!scripts/
diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 0000000..c0e417a
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,6 @@
+[submodule "TakeoutSaaS.BuildingBlocks"]
+ path = TakeoutSaaS.BuildingBlocks
+ url = git@github.com:msumshk/TakeoutSaaS.BuildingBlocks.git
+[submodule "TakeoutSaaS.Docs"]
+ path = TakeoutSaaS.Docs
+ url = git@github.com:msumshk/TakeoutSaaS.Docs.git
diff --git a/Directory.Build.props b/Directory.Build.props
new file mode 100644
index 0000000..68d6405
--- /dev/null
+++ b/Directory.Build.props
@@ -0,0 +1,15 @@
+
+
+ net10.0
+ enable
+ enable
+ latest
+ false
+
+
+
+
+
+
+
+
diff --git a/NuGet.Config b/NuGet.Config
new file mode 100644
index 0000000..6049492
--- /dev/null
+++ b/NuGet.Config
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
new file mode 100644
index 0000000..e77984c
--- /dev/null
+++ b/README.md
@@ -0,0 +1,33 @@
+# TakeoutSaaS.C-Side-Mini-Program-API
+
+本仓库承载 `TakeoutSaaS.MiniApi`,面向 C 端微信小程序,路由前缀为 `/api/mini/v1`。
+
+## 子模块
+
+- `TakeoutSaaS.BuildingBlocks/`:共享基础组件
+- `TakeoutSaaS.Docs/`:文档、部署资料与脚本
+
+## 初始化
+
+```bash
+git submodule update --init --recursive
+dotnet restore
+dotnet build TakeoutSaaS.sln
+```
+
+## 运行
+
+```bash
+dotnet run --project src/Api/TakeoutSaaS.MiniApi/TakeoutSaaS.MiniApi.csproj
+```
+
+默认开发地址:
+
+- `http://localhost:2683`
+- Swagger:`http://localhost:2683/api/docs`
+- 健康检查:`http://localhost:2683/healthz`
+
+## 文档入口
+
+- `TakeoutSaaS.Docs/README.md`
+- `TakeoutSaaS.Docs/Document/README.md`
diff --git a/TakeoutSaaS.BuildingBlocks b/TakeoutSaaS.BuildingBlocks
new file mode 160000
index 0000000..5b07973
--- /dev/null
+++ b/TakeoutSaaS.BuildingBlocks
@@ -0,0 +1 @@
+Subproject commit 5b07973a39fc3bdb52f2e7c870aed7b6ea3ab388
diff --git a/TakeoutSaaS.Docs b/TakeoutSaaS.Docs
new file mode 160000
index 0000000..6680599
--- /dev/null
+++ b/TakeoutSaaS.Docs
@@ -0,0 +1 @@
+Subproject commit 66805999120ba0e2df1e3c11100f523e2d3a7fef
diff --git a/TakeoutSaaS.sln b/TakeoutSaaS.sln
new file mode 100644
index 0000000..097640c
--- /dev/null
+++ b/TakeoutSaaS.sln
@@ -0,0 +1,114 @@
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.0.31903.59
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{827E0CD3-B72D-47B6-A68D-7590B98EB39B}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Api", "Api", "{81034408-37C8-1011-444E-4C15C2FADA8E}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TakeoutSaaS.MiniApi", "src\Api\TakeoutSaaS.MiniApi\TakeoutSaaS.MiniApi.csproj", "{B2B0CCBE-B471-4282-9040-41FD4A30E368}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Application", "Application", "{22BAF98C-8415-17C4-B26A-D537657BC863}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TakeoutSaaS.Application", "src\Application\TakeoutSaaS.Application\TakeoutSaaS.Application.csproj", "{9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Domain", "Domain", "{8B290487-4C16-E85E-E807-F579CBE9FC4D}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TakeoutSaaS.Domain", "src\Domain\TakeoutSaaS.Domain\TakeoutSaaS.Domain.csproj", "{826F81CA-4E07-4C28-BB49-F32B2AF2F279}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Infrastructure", "Infrastructure", "{9048EB7F-3875-A59E-E36B-5BD4C6F2A282}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TakeoutSaaS.Infrastructure", "src\Infrastructure\TakeoutSaaS.Infrastructure\TakeoutSaaS.Infrastructure.csproj", "{713544AA-AD1B-45AE-9A95-D27C102C7160}"
+EndProject
+Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Modules", "Modules", "{EC447DCF-ABFA-6E24-52A5-D7FD48A5C558}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TakeoutSaaS.Module.Tenancy", "src\Modules\TakeoutSaaS.Module.Tenancy\TakeoutSaaS.Module.Tenancy.csproj", "{FEC3EAFC-BED6-4A4F-B956-084F41D012BB}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Debug|x64 = Debug|x64
+ Debug|x86 = Debug|x86
+ Release|Any CPU = Release|Any CPU
+ Release|x64 = Release|x64
+ Release|x86 = Release|x86
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Debug|x64.Build.0 = Debug|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Debug|x86.Build.0 = Debug|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Release|x64.ActiveCfg = Release|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Release|x64.Build.0 = Release|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Release|x86.ActiveCfg = Release|Any CPU
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368}.Release|x86.Build.0 = Release|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Debug|x64.Build.0 = Debug|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Debug|x86.Build.0 = Debug|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Release|Any CPU.Build.0 = Release|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Release|x64.ActiveCfg = Release|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Release|x64.Build.0 = Release|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Release|x86.ActiveCfg = Release|Any CPU
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D}.Release|x86.Build.0 = Release|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Debug|x64.Build.0 = Debug|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Debug|x86.Build.0 = Debug|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Release|Any CPU.Build.0 = Release|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Release|x64.ActiveCfg = Release|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Release|x64.Build.0 = Release|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Release|x86.ActiveCfg = Release|Any CPU
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279}.Release|x86.Build.0 = Release|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Debug|x64.Build.0 = Debug|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Debug|x86.Build.0 = Debug|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Release|Any CPU.Build.0 = Release|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Release|x64.ActiveCfg = Release|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Release|x64.Build.0 = Release|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Release|x86.ActiveCfg = Release|Any CPU
+ {713544AA-AD1B-45AE-9A95-D27C102C7160}.Release|x86.Build.0 = Release|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Debug|x64.ActiveCfg = Debug|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Debug|x64.Build.0 = Debug|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Debug|x86.ActiveCfg = Debug|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Debug|x86.Build.0 = Debug|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Release|Any CPU.Build.0 = Release|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Release|x64.ActiveCfg = Release|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Release|x64.Build.0 = Release|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Release|x86.ActiveCfg = Release|Any CPU
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB}.Release|x86.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(NestedProjects) = preSolution
+ {81034408-37C8-1011-444E-4C15C2FADA8E} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {B2B0CCBE-B471-4282-9040-41FD4A30E368} = {81034408-37C8-1011-444E-4C15C2FADA8E}
+ {22BAF98C-8415-17C4-B26A-D537657BC863} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {9ED9512C-35CC-42D7-8EA3-317DF63F2C2D} = {22BAF98C-8415-17C4-B26A-D537657BC863}
+ {8B290487-4C16-E85E-E807-F579CBE9FC4D} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {826F81CA-4E07-4C28-BB49-F32B2AF2F279} = {8B290487-4C16-E85E-E807-F579CBE9FC4D}
+ {9048EB7F-3875-A59E-E36B-5BD4C6F2A282} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {713544AA-AD1B-45AE-9A95-D27C102C7160} = {9048EB7F-3875-A59E-E36B-5BD4C6F2A282}
+ {EC447DCF-ABFA-6E24-52A5-D7FD48A5C558} = {827E0CD3-B72D-47B6-A68D-7590B98EB39B}
+ {FEC3EAFC-BED6-4A4F-B956-084F41D012BB} = {EC447DCF-ABFA-6E24-52A5-D7FD48A5C558}
+ EndGlobalSection
+EndGlobal
diff --git a/src/Api/Directory.Build.props b/src/Api/Directory.Build.props
new file mode 100644
index 0000000..474a084
--- /dev/null
+++ b/src/Api/Directory.Build.props
@@ -0,0 +1,5 @@
+
+
+
+
+
diff --git a/src/Api/TakeoutSaaS.MiniApi/Controllers/BootstrapController.cs b/src/Api/TakeoutSaaS.MiniApi/Controllers/BootstrapController.cs
new file mode 100644
index 0000000..2df413b
--- /dev/null
+++ b/src/Api/TakeoutSaaS.MiniApi/Controllers/BootstrapController.cs
@@ -0,0 +1,30 @@
+using MediatR;
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using TakeoutSaaS.Application.App.Mini.Bootstrap;
+using TakeoutSaaS.Shared.Abstractions.Results;
+using TakeoutSaaS.Shared.Web.Api;
+
+namespace TakeoutSaaS.MiniApi.Controllers;
+
+///
+/// 小程序端启动引导接口。
+///
+[ApiVersion("1.0")]
+[Route("api/mini/v{version:apiVersion}/bootstrap")]
+public sealed class BootstrapController(ISender sender) : BaseApiController
+{
+ ///
+ /// 返回当前服务基础能力与运行环境信息。
+ ///
+ /// 取消令牌。
+ /// 引导信息。
+ [HttpGet]
+ [AllowAnonymous]
+ [ProducesResponseType(typeof(ApiResponse), StatusCodes.Status200OK)]
+ public async Task> GetAsync(CancellationToken cancellationToken)
+ {
+ var response = await sender.Send(new GetMiniBootstrapQuery(), cancellationToken);
+ return ApiResponse.Ok(response);
+ }
+}
diff --git a/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs b/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs
new file mode 100644
index 0000000..be7cfa3
--- /dev/null
+++ b/src/Api/TakeoutSaaS.MiniApi/Controllers/HealthController.cs
@@ -0,0 +1,33 @@
+using Microsoft.AspNetCore.Authorization;
+using Microsoft.AspNetCore.Mvc;
+using TakeoutSaaS.Shared.Abstractions.Results;
+using TakeoutSaaS.Shared.Web.Api;
+
+namespace TakeoutSaaS.MiniApi.Controllers;
+
+///
+/// 小程序端健康检查。
+///
+[ApiVersion("1.0")]
+[Route("api/mini/v{version:apiVersion}/health")]
+public sealed class HealthController : BaseApiController
+{
+ ///
+ /// 获取服务健康状态。
+ ///
+ /// 健康状态。
+ [HttpGet]
+ [AllowAnonymous]
+ [ProducesResponseType(typeof(ApiResponse