Download the PHP package tourze/resource-manage-bundle without Composer
On this page you can find all versions of the php package tourze/resource-manage-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download tourze/resource-manage-bundle
More information about tourze/resource-manage-bundle
Files in tourze/resource-manage-bundle
Download tourze/resource-manage-bundle
More information about tourze/resource-manage-bundle
Files in tourze/resource-manage-bundle
Vendor tourze
Package resource-manage-bundle
Short Description Symfony bundle for resource management and distribution system
License MIT
Package resource-manage-bundle
Short Description Symfony bundle for resource management and distribution system
License MIT
Please rate this library. Is it a good library?
Informations about the package resource-manage-bundle
Resource Management Bundle
中文
A universal resource distribution and management framework that supports unified management and distribution of various resource types.
Installation
系统概述
资源管理系统是一个通用的资源发放和管理框架,支持多种类型资源的统一管理和分发。系统采用接口定义和依赖注入的方式,实现了高度的可扩展性和灵活性。
核心组件
1. ResourceIdentity 接口
定义了资源的基本标识接口,包含:
- getResourceId(): 获取资源唯一标识
- getResourceLabel(): 获取资源显示名称
2. ResourceProvider 接口
资源提供者的统一接口,负责具体资源类型的管理和发放:
- getCode(): 资源类型的唯一标识
- getLabel(): 资源类型的显示名称
- getIdentities(): 获取该类型下所有可用的资源列表
- findIdentity(): 查找特定资源
- sendResource(): 发放资源给用户
3. ResourceManager 服务
资源管理器,负责:
- 统一管理所有资源提供者
- 提供资源选择数据
- 统一的资源发放入口
已实现的资源类型
1. 优惠券资源 (CouponResourceProvider)
- 类型标识:coupon
- 功能:管理和发放优惠券
- 特点:与优惠券系统集成,支持优惠券的查找和发放
2. 实物奖品资源 (SpuOfferResourceProvider)
- 类型标识:material
- 功能:管理和发放实物商品
- 特点:与商品系统集成,支持商品库存管理和订单创建
3. 文本资源 (TextResourceProvider)
- 类型标识:text
- 功能:用于发放文本类型的安慰奖
- 特点:无实际发放行为,用于安慰奖场景
4. 虚拟资源 (VirtualResourceProvider)
- 类型标识:virtual
- 功能:用于发放虚拟奖品
- 特点:无实际发放行为,用于虚拟奖品场景
如何实现新的资源类型
-
创建资源实体类并实现 ResourceIdentity 接口
-
创建资源提供者类并实现 ResourceProvider 接口
- 资源提供者会自动注册到系统中(通过 AutoconfigureTag 注解)
使用示例
注意事项
- 资源类型的 Code 必须全局唯一
- 实现新的资源类型时,需要同时实现资源标识和提供者
- 资源发放时需要处理异常情况
- 建议为新增的资源类型添加单元测试
License
This project is licensed under the MIT License - see the LICENSE file for details.
All versions of resource-manage-bundle with dependencies
PHP Build Version
Package Version
Requires
doctrine/dbal Version
^4.0
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
symfony/config Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/http-kernel Version ^7.3
symfony/property-access Version ^7.3
symfony/security-core Version ^7.3
symfony/yaml Version ^7.3
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/enum-extra Version 1.0.*
tourze/symfony-dependency-service-loader Version 1.0.*
doctrine/doctrine-bundle Version ^2.13
doctrine/orm Version ^3.0
doctrine/persistence Version ^4.1
symfony/config Version ^7.3
symfony/dependency-injection Version ^7.3
symfony/doctrine-bridge Version ^7.3
symfony/framework-bundle Version ^7.3
symfony/http-kernel Version ^7.3
symfony/property-access Version ^7.3
symfony/security-core Version ^7.3
symfony/yaml Version ^7.3
tourze/doctrine-timestamp-bundle Version 1.1.*
tourze/enum-extra Version 1.0.*
tourze/symfony-dependency-service-loader Version 1.0.*
The package tourze/resource-manage-bundle contains the following files
Loading the files please wait ...