Service.php 462 B

12345678910111213141516171819202122232425
  1. <?php
  2. namespace think\annotation;
  3. class Service extends \think\Service
  4. {
  5. use InteractsWithInject, InteractsWithRoute, InteractsWithModel;
  6. protected Reader $reader;
  7. public function boot(Reader $reader)
  8. {
  9. $this->reader = $reader;
  10. //自动注入
  11. $this->autoInject();
  12. //注解路由
  13. $this->registerAnnotationRoute();
  14. //模型注解方法提示
  15. $this->detectModelAnnotations();
  16. }
  17. }