OSharp.Plugin.Mall 10.0.3

dotnet add package OSharp.Plugin.Mall --version 10.0.3
                    
NuGet\Install-Package OSharp.Plugin.Mall -Version 10.0.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="OSharp.Plugin.Mall" Version="10.0.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="OSharp.Plugin.Mall" Version="10.0.3" />
                    
Directory.Packages.props
<PackageReference Include="OSharp.Plugin.Mall" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add OSharp.Plugin.Mall --version 10.0.3
                    
#r "nuget: OSharp.Plugin.Mall, 10.0.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package OSharp.Plugin.Mall@10.0.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=OSharp.Plugin.Mall&version=10.0.3
                    
Install as a Cake Addin
#tool nuget:?package=OSharp.Plugin.Mall&version=10.0.3
                    
Install as a Cake Tool

OSharp.Plugin.Core

简洁的插件核心库,提供插件加载、注册与基础扩展点(示例库)。该包主要用于在 .NET 项目中集成插件机制与扩展点。

功能

  • 插件发现与加载
  • 插件生命周期管理
  • 基础扩展点接口与示例实现

安装

从 NuGet 安装(替换为实际包名):

# 使用 dotnet CLI
dotnet add package OSharp.Plugin.Core --version x.y.z

# 使用 NuGet 包管理器控制台
Install-Package OSharp.Plugin.Core -Version x.y.z

using OSharp.Plugin.Core;

// 根据库的实际 API 调整以下示例
var manager = new PluginManager(); // 示例构造
manager.LoadPlugins("Plugins");    // 从指定目录加载插件
manager.InitializeAll();

OSharp.Plugin.Mall

简要说明

OSharp.Plugin.Mall 提供电商(商城)相关的功能模块:商品、分类、库存、订单、商户与支付对接等核心业务逻辑。该插件旨在把常见的电商功能封装为可插拔模块,方便在 OSharp 平台中快速集成电商能力。

主要功能

  • 商品(Products)管理:规格、价格、库存、上下架
  • 商品分类与属性管理
  • 订单(Orders)处理:下单、支付、发货、售后
  • 商户/店铺(Merchants)管理
  • 购物车、促销与优惠券(视实现情况)
  • 与支付/第三方平台的集成点(可扩展)

目录结构(概要)

  • Products/ —— 商品相关实现
  • Orders/ —— 订单相关实现
  • Merchants/ —— 商户/店铺模块
  • Services/ —— 业务服务实现
  • AutoMapperConfiguration.cs —— AutoMapper 配置
  • MallPack.cs —— 插件注册入口类(如存在)

安装与引用

  1. 本地项目引用(开发与调试)
# 在主项目目录执行
dotnet add reference ../Plugins/OSharp.Plugin.Mall/OSharp.Plugin.Mall.csproj
  1. 通过 NuGet(已发布时)
dotnet add package OSharp.Plugin.Mall --version x.y.z

集成要点

  • 数据库迁移: 插件包含自己的实体与 EF Core 配置。请将插件的实体纳入主项目的数据迁移流程或为插件单独管理迁移:

    dotnet ef migrations add InitMall --project Plugins/OSharp.Plugin.Mall --startup-project Presentation/OSharp.Api
    dotnet ef database update --project Plugins/OSharp.Plugin.Mall --startup-project Presentation/OSharp.Api
    
  • 服务与控制器 将插件程序集添加到 MVC ApplicationPart,注册插件需要的服务(如仓储、支付服务等):

    services.AddApplicationPart(typeof(MallPack).Assembly);
    services.AddMallServices(Configuration); // 假设存在的扩展方法
    

开发与测试建议

  • 使用 InMemory EF Core 进行服务层单元测试,覆盖订单流程的核心路径(下单、支付回调、库存扣减、发货流程)。
  • 对支付/第三方集成,封装接口并使用模拟实现进行测试。

性能与运维考虑

  • 订单与库存是高并发点,关注并发扣减库存的正确性与事务一致性。
  • 对关键操作(下单、支付回调)添加幂等与重试机制。

贡献

  • 提交 Issue 或 PR,按照项目约定添加必要的迁移脚本与测试。

许可证

详见仓库根目录 LICENSE 文件。

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages (1)

Showing the top 1 NuGet packages that depend on OSharp.Plugin.Mall:

Package Downloads
OSharp.Plugin.MobileApp

OSharp小程序组件,封装着小程序所需功能

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
10.0.3 41 1/23/2026
10.0.2 47 1/23/2026
10.0.1 39 1/23/2026
10.0.0 87 1/21/2026
8.2.1 460 12/9/2025
8.2.0 209 12/4/2025
8.1.9 430 11/20/2025
8.1.8 211 10/31/2025
8.1.7 210 10/27/2025
8.1.6 236 9/30/2025
8.1.5 209 9/24/2025
8.1.4 342 9/18/2025
8.1.3 328 9/18/2025
8.1.2 334 9/18/2025
8.1.1 208 9/3/2025