xmo / mine-service
mineadmin Service package
Installs: 41 484
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 2
Forks: 0
Open Issues: 0
Requires
- php: >=8.1
This package is auto-updated.
Last update: 2024-11-16 06:31:23 UTC
README
提供了一套类似 SpringBoot 注解,以及类似 mybatis-plus CrudService的契约
现已实现注解
使用前需要use对应命名空间 Mine\Annotation
Component
Defined
DependProxy
Override
PostConstruct
Service
有部分情况在使用Service
注解时会造成前后加载顺序不一致,可以在项目的config/container.php
修改为以下
<?php /** * Initialize a dependency injection container that implemented PSR-11 and return the container. */ declare(strict_types=1); /** * This file is part of MineAdmin. * * @link https://www.mineadmin.com * @document https://doc.mineadmin.com * @contact root@imoi.cn * @license https://github.com/mineadmin/MineAdmin/blob/master/LICENSE */ use Hyperf\Context\ApplicationContext; use Hyperf\Di\Container; use Hyperf\Di\Definition\DefinitionSourceFactory; use Mine\Annotation\DependProxyCollector; // https://github.com/kanyxmo/mine/pull/14 $container = new Container((new DefinitionSourceFactory())()); DependProxyCollector::walk([$container, 'define']); if (! $container instanceof \Psr\Container\ContainerInterface) { throw new RuntimeException('The dependency injection container is invalid.'); } return ApplicationContext::setContainer($container);