springbootAI 1.8.1__tar.gz → 1.8.3__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (219) hide show
  1. {springbootai-1.8.1/springbootAI.egg-info → springbootai-1.8.3}/PKG-INFO +30 -15
  2. {springbootai-1.8.1 → springbootai-1.8.3}/README.md +29 -14
  3. {springbootai-1.8.1 → springbootai-1.8.3}/pyproject.toml +1 -1
  4. {springbootai-1.8.1 → springbootai-1.8.3}/spring/__init__.py +1 -1
  5. {springbootai-1.8.1 → springbootai-1.8.3}/spring/aop/cloud_aop.py +32 -4
  6. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/__init__.py +2 -0
  7. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/gateway.py +25 -8
  8. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/seata.py +309 -40
  9. springbootai-1.8.3/spring/cloud/transaction_store.py +275 -0
  10. {springbootai-1.8.1 → springbootai-1.8.3}/spring/main.py +25 -4
  11. {springbootai-1.8.1 → springbootai-1.8.3}/spring/utils/__init__.py +2 -1
  12. springbootai-1.8.3/spring/utils/bean_utils.py +314 -0
  13. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/health.py +12 -2
  14. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/swagger.py +96 -7
  15. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/web_context.py +4 -1
  16. {springbootai-1.8.1 → springbootai-1.8.3/springbootAI.egg-info}/PKG-INFO +30 -15
  17. {springbootai-1.8.1 → springbootai-1.8.3}/springbootAI.egg-info/SOURCES.txt +4 -0
  18. springbootai-1.8.3/tests/test_bean_utils.py +316 -0
  19. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_new_features.py +2 -2
  20. springbootai-1.8.3/tests/test_seata_durable_store.py +168 -0
  21. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_swagger_module.py +29 -14
  22. {springbootai-1.8.1 → springbootai-1.8.3}/LICENSE +0 -0
  23. {springbootai-1.8.1 → springbootai-1.8.3}/MANIFEST.in +0 -0
  24. {springbootai-1.8.1 → springbootai-1.8.3}/requirements.txt +0 -0
  25. {springbootai-1.8.1 → springbootai-1.8.3}/setup.cfg +0 -0
  26. {springbootai-1.8.1 → springbootai-1.8.3}/setup.py +0 -0
  27. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/__init__.py +0 -0
  28. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/advisors.py +0 -0
  29. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/annotations.py +0 -0
  30. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/autoconfig.py +0 -0
  31. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/core.py +0 -0
  32. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/etl.py +0 -0
  33. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/memory.py +0 -0
  34. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/observability.py +0 -0
  35. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/providers.py +0 -0
  36. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/resilience.py +0 -0
  37. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/tools.py +0 -0
  38. {springbootai-1.8.1 → springbootai-1.8.3}/spring/ai/vectorstore.py +0 -0
  39. {springbootai-1.8.1 → springbootai-1.8.3}/spring/annotations/__init__.py +0 -0
  40. {springbootai-1.8.1 → springbootai-1.8.3}/spring/annotations/cache.py +0 -0
  41. {springbootai-1.8.1 → springbootai-1.8.3}/spring/annotations/cloud.py +0 -0
  42. {springbootai-1.8.1 → springbootai-1.8.3}/spring/annotations/conditional.py +0 -0
  43. {springbootai-1.8.1 → springbootai-1.8.3}/spring/annotations/core.py +0 -0
  44. {springbootai-1.8.1 → springbootai-1.8.3}/spring/annotations/messaging.py +0 -0
  45. {springbootai-1.8.1 → springbootai-1.8.3}/spring/aop/__init__.py +0 -0
  46. {springbootai-1.8.1 → springbootai-1.8.3}/spring/aop/comprehensive_aop.py +0 -0
  47. {springbootai-1.8.1 → springbootai-1.8.3}/spring/aop/method_interceptor.py +0 -0
  48. {springbootai-1.8.1 → springbootai-1.8.3}/spring/aop/proxy_factory.py +0 -0
  49. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/discovery.py +0 -0
  50. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/feign.py +0 -0
  51. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/load_balancer.py +0 -0
  52. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/sentinel.py +0 -0
  53. {springbootai-1.8.1 → springbootai-1.8.3}/spring/cloud/tracer.py +0 -0
  54. {springbootai-1.8.1 → springbootai-1.8.3}/spring/config/__init__.py +0 -0
  55. {springbootai-1.8.1 → springbootai-1.8.3}/spring/config/binding.py +0 -0
  56. {springbootai-1.8.1 → springbootai-1.8.3}/spring/config/config_loader.py +0 -0
  57. {springbootai-1.8.1 → springbootai-1.8.3}/spring/context/__init__.py +0 -0
  58. {springbootai-1.8.1 → springbootai-1.8.3}/spring/context/application_context.py +0 -0
  59. {springbootai-1.8.1 → springbootai-1.8.3}/spring/context/bean_definition.py +0 -0
  60. {springbootai-1.8.1 → springbootai-1.8.3}/spring/context/bean_factory.py +0 -0
  61. {springbootai-1.8.1 → springbootai-1.8.3}/spring/context/registry.py +0 -0
  62. {springbootai-1.8.1 → springbootai-1.8.3}/spring/context/scanner.py +0 -0
  63. {springbootai-1.8.1 → springbootai-1.8.3}/spring/core/__init__.py +0 -0
  64. {springbootai-1.8.1 → springbootai-1.8.3}/spring/core/graceful_shutdown.py +0 -0
  65. {springbootai-1.8.1 → springbootai-1.8.3}/spring/core/typing_utils.py +0 -0
  66. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/__init__.py +0 -0
  67. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/annotations.py +0 -0
  68. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/converters.py +0 -0
  69. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/easy_csv.py +0 -0
  70. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/exceptions.py +0 -0
  71. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/reader.py +0 -0
  72. {springbootai-1.8.1 → springbootai-1.8.3}/spring/csv/writer.py +0 -0
  73. {springbootai-1.8.1 → springbootai-1.8.3}/spring/data/__init__.py +0 -0
  74. {springbootai-1.8.1 → springbootai-1.8.3}/spring/data/page.py +0 -0
  75. {springbootai-1.8.1 → springbootai-1.8.3}/spring/data/repository.py +0 -0
  76. {springbootai-1.8.1 → springbootai-1.8.3}/spring/data/specification.py +0 -0
  77. {springbootai-1.8.1 → springbootai-1.8.3}/spring/datasource/__init__.py +0 -0
  78. {springbootai-1.8.1 → springbootai-1.8.3}/spring/datasource/annotations.py +0 -0
  79. {springbootai-1.8.1 → springbootai-1.8.3}/spring/datasource/context.py +0 -0
  80. {springbootai-1.8.1 → springbootai-1.8.3}/spring/datasource/dynamic.py +0 -0
  81. {springbootai-1.8.1 → springbootai-1.8.3}/spring/event/__init__.py +0 -0
  82. {springbootai-1.8.1 → springbootai-1.8.3}/spring/event/publisher.py +0 -0
  83. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/__init__.py +0 -0
  84. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/annotations.py +0 -0
  85. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/converters.py +0 -0
  86. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/easy_excel.py +0 -0
  87. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/exceptions.py +0 -0
  88. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/reader.py +0 -0
  89. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/style.py +0 -0
  90. {springbootai-1.8.1 → springbootai-1.8.3}/spring/excel/writer.py +0 -0
  91. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/__init__.py +0 -0
  92. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/accessor.py +0 -0
  93. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/auto_config.py +0 -0
  94. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/holder.py +0 -0
  95. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/locale.py +0 -0
  96. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/locale_resolver.py +0 -0
  97. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/message_source.py +0 -0
  98. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/middleware.py +0 -0
  99. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/properties.py +0 -0
  100. {springbootai-1.8.1 → springbootai-1.8.3}/spring/i18n/sources.py +0 -0
  101. {springbootai-1.8.1 → springbootai-1.8.3}/spring/logging/__init__.py +0 -0
  102. {springbootai-1.8.1 → springbootai-1.8.3}/spring/logging/loguru_logger.py +0 -0
  103. {springbootai-1.8.1 → springbootai-1.8.3}/spring/messaging/__init__.py +0 -0
  104. {springbootai-1.8.1 → springbootai-1.8.3}/spring/messaging/rabbitmq.py +0 -0
  105. {springbootai-1.8.1 → springbootai-1.8.3}/spring/monitoring/__init__.py +0 -0
  106. {springbootai-1.8.1 → springbootai-1.8.3}/spring/monitoring/prometheus.py +0 -0
  107. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/__init__.py +0 -0
  108. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/database.py +0 -0
  109. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/ddl_auto.py +0 -0
  110. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/migration.py +0 -0
  111. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/mybatis_integration.py +0 -0
  112. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/__init__.py +0 -0
  113. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/annotations/__init__.py +0 -0
  114. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/annotations/annotations.py +0 -0
  115. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/cache/__init__.py +0 -0
  116. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/cache/cache.py +0 -0
  117. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/cache/redis_cache.py +0 -0
  118. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/circuit_breaker/__init__.py +0 -0
  119. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/circuit_breaker/circuit_breaker.py +0 -0
  120. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/configuration.py +0 -0
  121. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/core/__init__.py +0 -0
  122. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/core/sql_session.py +0 -0
  123. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/core/sql_session_factory.py +0 -0
  124. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/dialect/__init__.py +0 -0
  125. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/dialect/dialect.py +0 -0
  126. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/dynamic_sql/__init__.py +0 -0
  127. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/dynamic_sql/dynamic_sql.py +0 -0
  128. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/interceptor/__init__.py +0 -0
  129. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/interceptor/interceptor.py +0 -0
  130. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/mapper/__init__.py +0 -0
  131. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/mapper/mapper.py +0 -0
  132. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/metrics/__init__.py +0 -0
  133. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/metrics/metrics.py +0 -0
  134. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/pool/__init__.py +0 -0
  135. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/pool/connection_pool.py +0 -0
  136. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/security/__init__.py +0 -0
  137. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/security/access_control.py +0 -0
  138. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/security/password_encoder.py +0 -0
  139. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/security/sensitive_data_masker.py +0 -0
  140. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/security/sql_injection_detector.py +0 -0
  141. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/transaction/__init__.py +0 -0
  142. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/transaction/transaction.py +0 -0
  143. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/type_handler/__init__.py +0 -0
  144. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/type_handler/type_handler.py +0 -0
  145. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/version.py +0 -0
  146. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/xml_parser/__init__.py +0 -0
  147. {springbootai-1.8.1 → springbootai-1.8.3}/spring/orm/pymybatis/xml_parser/xml_parser.py +0 -0
  148. {springbootai-1.8.1 → springbootai-1.8.3}/spring/retry/__init__.py +0 -0
  149. {springbootai-1.8.1 → springbootai-1.8.3}/spring/retry/retry_annotations.py +0 -0
  150. {springbootai-1.8.1 → springbootai-1.8.3}/spring/retry/retry_decorator.py +0 -0
  151. {springbootai-1.8.1 → springbootai-1.8.3}/spring/scheduling/__init__.py +0 -0
  152. {springbootai-1.8.1 → springbootai-1.8.3}/spring/scheduling/scheduler.py +0 -0
  153. {springbootai-1.8.1 → springbootai-1.8.3}/spring/security/__init__.py +0 -0
  154. {springbootai-1.8.1 → springbootai-1.8.3}/spring/security/jwt_utils.py +0 -0
  155. {springbootai-1.8.1 → springbootai-1.8.3}/spring/security/replay_protection.py +0 -0
  156. {springbootai-1.8.1 → springbootai-1.8.3}/spring/security/secret_manager.py +0 -0
  157. {springbootai-1.8.1 → springbootai-1.8.3}/spring/security/security_aop.py +0 -0
  158. {springbootai-1.8.1 → springbootai-1.8.3}/spring/security/security_context.py +0 -0
  159. {springbootai-1.8.1 → springbootai-1.8.3}/spring/test/__init__.py +0 -0
  160. {springbootai-1.8.1 → springbootai-1.8.3}/spring/test/slicing.py +0 -0
  161. {springbootai-1.8.1 → springbootai-1.8.3}/spring/tracing/__init__.py +0 -0
  162. {springbootai-1.8.1 → springbootai-1.8.3}/spring/tracing/skywalking.py +0 -0
  163. {springbootai-1.8.1 → springbootai-1.8.3}/spring/tx/__init__.py +0 -0
  164. {springbootai-1.8.1 → springbootai-1.8.3}/spring/tx/events.py +0 -0
  165. {springbootai-1.8.1 → springbootai-1.8.3}/spring/tx/synchronization.py +0 -0
  166. {springbootai-1.8.1 → springbootai-1.8.3}/spring/utils/banner.py +0 -0
  167. {springbootai-1.8.1 → springbootai-1.8.3}/spring/utils/logger.py +0 -0
  168. {springbootai-1.8.1 → springbootai-1.8.3}/spring/utils/redis_client.py +0 -0
  169. {springbootai-1.8.1 → springbootai-1.8.3}/spring/validation/__init__.py +0 -0
  170. {springbootai-1.8.1 → springbootai-1.8.3}/spring/validation/aop.py +0 -0
  171. {springbootai-1.8.1 → springbootai-1.8.3}/spring/validation/constraints.py +0 -0
  172. {springbootai-1.8.1 → springbootai-1.8.3}/spring/validation/exceptions.py +0 -0
  173. {springbootai-1.8.1 → springbootai-1.8.3}/spring/validation/validator.py +0 -0
  174. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/__init__.py +0 -0
  175. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/actuator.py +0 -0
  176. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/exception_handler.py +0 -0
  177. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/interceptor.py +0 -0
  178. {springbootai-1.8.1 → springbootai-1.8.3}/spring/web/result.py +0 -0
  179. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/__init__.py +0 -0
  180. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/annotations.py +0 -0
  181. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/broker.py +0 -0
  182. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/exceptions.py +0 -0
  183. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/handler.py +0 -0
  184. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/router.py +0 -0
  185. {springbootai-1.8.1 → springbootai-1.8.3}/spring/websocket/session.py +0 -0
  186. {springbootai-1.8.1 → springbootai-1.8.3}/springbootAI.egg-info/dependency_links.txt +0 -0
  187. {springbootai-1.8.1 → springbootai-1.8.3}/springbootAI.egg-info/entry_points.txt +0 -0
  188. {springbootai-1.8.1 → springbootai-1.8.3}/springbootAI.egg-info/requires.txt +0 -0
  189. {springbootai-1.8.1 → springbootai-1.8.3}/springbootAI.egg-info/top_level.txt +0 -0
  190. {springbootai-1.8.1 → springbootai-1.8.3}/sql/seata_undo_log.sql +0 -0
  191. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_actuator.py +0 -0
  192. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_ai_module.py +0 -0
  193. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_annotation_combinations.py +0 -0
  194. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_annotations_contract.py +0 -0
  195. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_aop_annotations_full.py +0 -0
  196. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_cache_annotations.py +0 -0
  197. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_cloud_embedded_full.py +0 -0
  198. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_conditional_annotations.py +0 -0
  199. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_config_binding.py +0 -0
  200. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_connection_resilience.py +0 -0
  201. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_core_annotations_full.py +0 -0
  202. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_csv_module.py +0 -0
  203. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_data_repository.py +0 -0
  204. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_datasource_routing.py +0 -0
  205. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_ddl_auto.py +0 -0
  206. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_di_config_event_full.py +0 -0
  207. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_excel_module.py +0 -0
  208. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_i18n_module.py +0 -0
  209. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_jpa_version_transient.py +0 -0
  210. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_orm_pymybatis_full.py +0 -0
  211. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_production_readiness.py +0 -0
  212. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_pymybatis_contract.py +0 -0
  213. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_security.py +0 -0
  214. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_security_full.py +0 -0
  215. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_test_slicing.py +0 -0
  216. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_transactional_events.py +0 -0
  217. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_validation_module.py +0 -0
  218. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_web_annotations_full.py +0 -0
  219. {springbootai-1.8.1 → springbootai-1.8.3}/tests/test_websocket_module.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: springbootAI
3
- Version: 1.8.1
3
+ Version: 1.8.3
4
4
  Summary: Python版Spring Boot框架,集成PyMyBatis ORM
5
5
  Author-email: YuConggen <1516933915@qq.com>
6
6
  License-Expression: MIT
@@ -86,7 +86,7 @@ Dynamic: license-file
86
86
 
87
87
  SpringBootAI 是一个借鉴 Spring Boot 编程模型的 Python Web 框架,提供装饰器式组件扫描、依赖注入、FastAPI 路由、配置加载、安全能力、内嵌的 PyMyBatis ORM,以及企业级 AI 模块(对齐 Spring AI 2.0:ChatClient/Advisor/Tools/RAG/Function Calling)。本指南为框架核心综合使用文档;**AI / ORM / Cloud / Excel 等模块的完整注解与功能说明已分离为独立文档**(见下方“模块文档”),本指南相应章节保留概览与跳转链接。
88
88
 
89
- - SpringBootAI 版本:`1.8.1`
89
+ - SpringBootAI 版本:`1.8.3`
90
90
  - 内嵌 PyMyBatis 版本:`1.4.0`
91
91
  - Python:3.10+
92
92
  - 状态:Beta(企业试点)
@@ -95,10 +95,12 @@ SpringBootAI 是一个借鉴 Spring Boot 编程模型的 Python Web 框架,提
95
95
 
96
96
  ## 模块文档
97
97
 
98
- 各模块的注解参考与功能说明已从本指南分离为独立文档,按需查阅:
98
+ 第一次使用请先读 [新手入门指南](doc/BEGINNER_GUIDE.md)。它从安装开始,带你创建第一个接口,并解释 Controller、Service、Bean、依赖注入和配置文件是什么。各模块文档统一按“解决什么问题 -> 如何启用 -> 最小示例 -> 如何验证 -> 常见错误 -> 生产边界”组织,按需查阅即可,不要求一次读完。
99
99
 
100
100
  | 模块 | 文档 | 安装 | 说明 |
101
101
  |------|------|------|------|
102
+ | 新手入门 | [BEGINNER_GUIDE.md](doc/BEGINNER_GUIDE.md) | 随核心包 | 从零安装、创建项目、运行接口、打开 Swagger、选择后续模块 |
103
+ | 常用注解模块 | [ANNOTATION_MODULES.md](doc/ANNOTATION_MODULES.md) | 随核心包 | Bean Validation / 条件装配 / 缓存增强 / CSV / `@Version` / `@Transient` |
102
104
  | AI(对齐 Spring AI 2.0) | [AI_MODULE.md](doc/AI_MODULE.md) | `pip install springbootAI[ai]` | ChatClient / Advisor / Tools / RAG / Function Calling / ETL / 多厂商 LangChain 化 / 韧性 / 观测 |
103
105
  | 内嵌 PyMyBatis ORM 与 DDL | [ORM_MODULE.md](doc/ORM_MODULE.md) | 随核心包 | Mapper 注解 / XML Mapper / 分页 / SQL 安全 / DDL 自动建表 |
104
106
  | Spring Cloud(对齐 Cloud Alibaba) | [CLOUD_MODULE.md](doc/CLOUD_MODULE.md) | 随核心包 | 服务注册发现 / 配置刷新 / Feign / Sentinel / Gateway / 负载均衡 / 分布式事务 |
@@ -107,10 +109,19 @@ SpringBootAI 是一个借鉴 Spring Boot 编程模型的 Python Web 框架,提
107
109
  | Swagger / OpenAPI(对齐 SpringDoc) | [SWAGGER_MODULE.md](doc/SWAGGER_MODULE.md) | 随核心包 | `@Tag` / `@Operation` / `@ApiResponse` / `@Parameter` / `@Schema` / `@SecurityScheme` 注解驱动 API 文档 + Swagger2 别名 |
108
110
  | P0/P1/P2 八大模块 | [EIGHT_MODULES.md](doc/EIGHT_MODULES.md) | 随核心包 | Spring Data Repository / Actuator / 多数据源读写分离 / 事务事件 / 配置松散绑定 / 测试切片 / i18n / WebSocket |
109
111
  | 安全 | [SECURITY.md](doc/SECURITY.md) | 随核心包 | JWT 生成校验 / 密码加密(SHA256/MD5/BCrypt)/ SQL 注入防护 / 访问控制 |
112
+ | BeanUtils(属性复制工具) | [BEAN_UTILS.md](doc/BEAN_UTILS.md) | 随核心包 | `copy_properties` / `clone` / `get_property` / `set_property` / `populate` / `describe` 对齐 Spring + Apache Commons BeanUtils |
110
113
  | 测试报告 | [TEST_REPORT.md](doc/TEST_REPORT.md) | — | 全量测试用例与覆盖范围 |
111
114
 
112
115
  > 所有模块文档统一存放于 [`doc/`](doc/) 目录。本指南正文中出现的"已分离至独立文档"链接均指向 `doc/` 下的对应文件。
113
116
 
117
+ ### 新手推荐阅读顺序
118
+
119
+ 1. 按 [新手入门指南](doc/BEGINNER_GUIDE.md) 跑通 `/api/hello/{name}`。
120
+ 2. 阅读本页第 4、6、7 章,理解配置、依赖注入和 Controller。
121
+ 3. 做数据库 CRUD 时阅读 [ORM_MODULE.md](doc/ORM_MODULE.md)。
122
+ 4. 需要输入校验、缓存或条件开关时阅读 [ANNOTATION_MODULES.md](doc/ANNOTATION_MODULES.md)。
123
+ 5. 最后再按业务需要选择安全、Cloud、AI、Excel、WebSocket 或性能测试文档。
124
+
114
125
  ## 目录
115
126
 
116
127
  1. [框架概述与定位](#1-框架概述与定位)
@@ -142,7 +153,7 @@ SpringBootAI 借鉴了 Spring Boot 的注解和分层习惯,但运行时是 Py
142
153
 
143
154
  | 组件 | 当前版本 |
144
155
  |------|----------|
145
- | `spring` 框架 API | 1.8.0 |
156
+ | `spring` 框架 API | 1.8.3 |
146
157
  | `spring.orm.pymybatis` | 1.4.0 |
147
158
  | Python | 3.10+ |
148
159
 
@@ -158,7 +169,7 @@ SpringBootAI 借鉴了 Spring Boot 的注解和分层习惯,但运行时是 Py
158
169
  - 自动化 ORM 契约测试使用 SQLite;MySQL、PostgreSQL、Oracle 需单独验证。
159
170
  - 本地 `@Transactional` 支持全部七种 Spring 传播模式;`REQUIRES_NEW` 和 `NOT_SUPPORTED` 需要连接池有额外可用连接。
160
171
  - Profile 会筛选 `@Profile` Bean,但不会自动合并 `application-{profile}.yml`。
161
- - Nacos、RabbitMQ、Prometheus 依赖外部服务;Sentinel、Seata HTTP-AT、OpenTelemetry 追踪均已内嵌实现无需外部 Server。
172
+ - Nacos、RabbitMQ、Prometheus 依赖外部服务;Sentinel 和 OpenTelemetry 追踪可内嵌运行。HTTP 事务模式是持久化补偿协调器,不提供 Seata AT 强一致性;生产强一致场景必须使用真实 Seata Server 或可靠消息方案。
162
173
  - 限流、分布式锁、幂等和缓存语义依赖 Redis 等后端,降级路径需要故障注入。
163
174
 
164
175
  ### 1.4 注解使用总览
@@ -193,7 +204,7 @@ SpringBootAI 注解会先把元数据放到 `__spring_annotations__`。之后是
193
204
  | Nacos 服务发现 | ✅ 可用 | 服务注册/发现/订阅,支持无认证开发模式 |
194
205
  | Sentinel 限流熔断 | ✅ 可用 | 内嵌引擎,QPS 限流、异常比例/异常数/慢调用熔断、热点参数限流,无需 Dashboard |
195
206
  | 分布式追踪 | ✅ 可用 | 原生 OpenTelemetry(W3C traceparent),自动 HTTP/Feign 注入,无需 OAP Server |
196
- | Seata 分布式事务 | ✅ 可用 | 内嵌 HTTP-AT 模式,分支注册/提交/回滚,XID 自动传播,无需 Seata Server |
207
+ | Seata 分布式事务 | ⚠️ 有边界 | `distributed` 对接真实 Seata SDK/Server;`http` 仅提供显式启用的持久化补偿,支持重启恢复和 XID 传播,不等同 AT |
197
208
  | API Gateway | ✅ 可用 | 轻量 ASGI/WSGI 网关,路由转发、路径重写、过滤器链、负载均衡 |
198
209
  | Prometheus 监控 | ✅ 可用 | Counter/Gauge/Histogram 指标暴露 |
199
210
  | Feign 声明式 HTTP | ✅ 可用 | 声明式接口、Fallback 降级、自动传播 XID 和 trace 头 |
@@ -1491,7 +1502,7 @@ class ScheduledTasks:
1491
1502
  | `@SentinelResource` | 限流、业务异常 fallback | 受管 Bean 方法会包装;已内嵌限流熔断引擎,无需 Sentinel Dashboard |
1492
1503
  | `@EnableGateway` | 启用 API Gateway | 元数据标记;配合 `GatewayRouter` 使用,内嵌轻量 ASGI/WSGI 网关 |
1493
1504
  | `@LoadBalanced` | 给 `@Bean` 工厂返回对象添加负载均衡标记 | `@Bean` 方法上会执行,但实际请求仍需配合框架负载均衡客户端 |
1494
- | `@GlobalTransactional` | 通过 Seata 管理全局事务 | 受管 Bean 方法会调用 Seata manager;已内嵌 HTTP-AT 模式,XID 自动通过 Feign 传播;不支持嵌套 |
1505
+ | `@GlobalTransactional` | 通过 Seata 管理全局事务 | 受管 Bean 方法调用 Seata manager;HTTP 模式为持久化补偿且要求幂等回调,强一致生产场景使用 `distributed`;不支持嵌套 |
1495
1506
  | `@Valid` | 非空/嵌套对象基础检查 | 受管 Bean 方法会执行简化校验,不等同 Jakarta Bean Validation |
1496
1507
  | `@Validated` | 分组校验 | 会执行简化检查,但 `groups` 当前未驱动真正的分组规则 |
1497
1508
  | `@RabbitListener` | 注册 RabbitMQ 消费者 | 可直接装饰受管 Bean 方法;容器声明队列/交换机、注册回调,并在刷新后启动后台消费;支持同步和异步回调 |
@@ -1964,7 +1975,7 @@ class AdminController:
1964
1975
 
1965
1976
  ### 11.1 @Cacheable
1966
1977
 
1967
- 当前 `@Cacheable` 使用 `BeanFactory` 内的本地缓存,默认最多 1000 项、TTL 300 秒。`value` 是缓存命名空间;`key="user_id"` 取同名参数,`key="user_{user_id}"` 使用模板,其他字符串作为固定键;`condition="enabled"`、`condition="!skip_cache"` 或 callable 决定是否缓存。同步方法缓存普通返回值,异步方法会先 `await` 再缓存最终结果,不会缓存 coroutine。缓存不跨进程,也没有对应的自动驱逐注解。写操作后的业务缓存失效不由 ORM 查询缓存自动替代。
1978
+ 当前缓存默认由 `BeanFactory` 提供本地内存实现,最多 1000 项、TTL 300 秒,不跨进程。`@Cacheable` 负责“先查缓存,未命中才执行方法”;`@CachePut` 负责执行方法后写入新值;`@CacheEvict` 负责删除一个键或清空一个命名空间;`@CacheConfig` 和 `@Caching` 用于统一命名空间或组合多个操作。`value` 是缓存命名空间;`key="user_id"` 取同名参数,`key="user_{user_id}"` 使用模板,其他字符串作为固定键;`condition="enabled"`、`condition="!skip_cache"` 或 callable 决定是否缓存。同步方法缓存普通返回值,异步方法会先 `await` 再缓存最终结果,不会缓存 coroutine。写操作后的业务缓存失效仍需由业务方法显式使用 `@CachePut`/`@CacheEvict`;生产多 worker 或多实例应接入共享 Redis,并自行验证一致性和故障降级。
1968
1979
 
1969
1980
  ### 11.2 @Retryable
1970
1981
 
@@ -2018,7 +2029,7 @@ class CleanupJob:
2018
2029
 
2019
2030
  `@SentinelResource`、`@GlobalTransactional` 和方法级 `@LoadBalanced` 有 AOP 消费路径;`@EnableDiscoveryClient`、`@FeignClient` 等当前主要是元数据,Nacos 实际初始化由 `discovery.enabled` 和 `ApplicationContext` 启动流程控制。Nacos 客户端需要 `nacos-sdk-python`、`NACOS_SERVER`、`NACOS_USERNAME`、`NACOS_PASSWORD`;Nacos 2.2+ Docker 服务端还需要 Base64 token 和 identity 环境变量。
2020
2031
 
2021
- 配置 `rabbitmq.enabled: true` 并提供 host、port、username、password、virtual_host。开发环境也应在真实 Nacos、RabbitMQ、Redis 等环境执行集成、断线和重复投递测试。Sentinel、Seata HTTP-AT、OpenTelemetry 追踪、API Gateway 均已内嵌实现,无需外部 Server。
2032
+ 配置 `rabbitmq.enabled: true` 并提供 host、port、username、password、virtual_host。开发环境也应在真实 Nacos、RabbitMQ、Redis 等环境执行集成、断线和重复投递测试。HTTP 事务模式会将协调元数据写入 `seata.store_path`,并在 worker 启动后周期恢复;它是补偿事务,不是 Seata AT,也不能单独满足支付、订单、库存的一致性要求。
2022
2033
 
2023
2034
  ---
2024
2035
 
@@ -2228,7 +2239,7 @@ class UserMapper:
2228
2239
  | `@LoadBalanced` | 同名注解 | 使用 Python 负载均衡实现;不要复用 `RestTemplate` 用法 |
2229
2240
  | Sentinel `@SentinelResource` | 同名注解 | 已内嵌限流熔断引擎,无需 Dashboard;如需更强大治理能力可对接外部 Sentinel Dashboard |
2230
2241
  | Spring Cloud Gateway | `@EnableGateway` + `GatewayRouter` | 内嵌轻量 ASGI/WSGI 网关;复杂网关需求可使用 Kong/APISIX 等专业网关 |
2231
- | Seata `@GlobalTransactional` | 同名注解 | 已内嵌 HTTP-AT 模式,无需 Seata Server,XID 自动通过 Feign 传播;如需更强一致性保障可对接外部 Seata Server |
2242
+ | Seata `@GlobalTransactional` | 同名注解 | `http` 模式是持久化补偿协调器,依赖幂等分支回调;企业强一致场景必须配置真实 Seata Server 与兼容 SDK |
2232
2243
 
2233
2244
  **Cloud 高级功能迁移对照**:
2234
2245
 
@@ -2236,7 +2247,7 @@ class UserMapper:
2236
2247
  |---|---|---|
2237
2248
  | Sentinel Dashboard + `@SentinelResource` | `@SentinelResource` | 内嵌引擎,无需 Dashboard;支持 QPS 限流、异常比例/异常数/慢调用熔断、热点参数限流 |
2238
2249
  | SkyWalking Agent + OAP Server | `@Trace` + 内嵌 Tracer | 原生 OpenTelemetry(W3C traceparent),无需 OAP Server;自动注入 HTTP/Feign 追踪头 |
2239
- | Seata Server + `@GlobalTransactional` | `@GlobalTransactional` | 内嵌 HTTP-AT 模式,无需 Seata Server;支持分支注册/提交/回滚,XID 自动传播 |
2250
+ | Seata Server + `@GlobalTransactional` | `@GlobalTransactional` | `distributed` 模式对接 Seata Server;`http` 仅用于补偿流程和故障演练,不提供 AT 语义 |
2240
2251
  | Spring Cloud Gateway | `GatewayRouter` | 轻量 ASGI/WSGI 网关,支持路由转发、路径重写、过滤器链、负载均衡 |
2241
2252
  | JPA `hibernate.ddl-auto` | `@entity` + `ddl-auto` 配置 | 支持 create/update/validate/create-drop;自动扫描实体包,自动建表/添加列/创建索引 |
2242
2253
 
@@ -2322,7 +2333,7 @@ Java 的 profile 文件自动合并不是当前功能。部署流程应生成最
2322
2333
  4. 用目标 MySQL/PostgreSQL/Oracle 版本执行相同测试,特别验证自增主键、事务隔离、超时和连接中断。
2323
2334
  5. 启动 ASGI 应用,检查 `/docs`、`/actuator/health/liveness` 和 `/actuator/health/readiness`。
2324
2335
  6. 接入 Nacos、RabbitMQ、Redis 等外部中间件,并演练断线、重复投递和回滚。
2325
- 7. 验证内嵌 Cloud 功能:`@SentinelResource` 限流熔断、`@Trace` 追踪、`@GlobalTransactional` 分布式事务、`GatewayRouter` 网关、`@entity` + `ddl-auto` 自动建表。这些功能无需部署外部 Server,但应在真实流量和故障注入下验证。
2336
+ 7. 验证 Cloud 功能:`@SentinelResource` 限流熔断、`@Trace` 追踪、`@GlobalTransactional` 补偿流程、`GatewayRouter` 网关、`@entity` + `ddl-auto` 自动建表。HTTP 补偿模式必须验证重复回调、进程重启和部分失败;强一致事务需部署真实 Seata Server 并执行集成测试。
2326
2337
 
2327
2338
  ---
2328
2339
 
@@ -2446,9 +2457,13 @@ logging:
2446
2457
  | `DISCOVERY_ENABLED` | 是否启用 Nacos 服务发现 | false |
2447
2458
  | `NACOS_SERVER` | Nacos 地址 | localhost:8848 |
2448
2459
  | `NACOS_USERNAME` / `NACOS_PASSWORD` | Nacos 客户端账号/密码 | 空 |
2460
+ | `SEATA_HTTP_STORE_PATH` | HTTP 补偿协调 SQLite 文件路径(同主机多 worker 共享) | `./data/seata-http.sqlite3` |
2461
+ | `SEATA_HTTP_RECOVER_ON_STARTUP` | 初始化时扫描并恢复未完成补偿 | true |
2462
+ | `SEATA_HTTP_RECOVERY_GRACE_MS` | 接管其他 worker 的 COMMITTING/ROLLING_BACK 前等待时间 | 30000 |
2463
+ | `SEATA_HTTP_RECOVERY_INTERVAL_S` | worker 内周期恢复间隔,0 表示关闭 | 30 |
2449
2464
  | `SPRING_DISABLE_DOCKER_IP_DETECT` | 设为 1 禁用 Docker 容器 IP 自动检测 | 0 |
2450
2465
 
2451
- > Sentinel、OpenTelemetry 追踪、Seata HTTP-AT、API Gateway 已内嵌实现,没有对应环境变量。
2466
+ > HTTP 补偿模式使用 `SEATA_HTTP_*` 配置,仍不提供 Seata AT;生产强一致事务必须配置 `SEATA_MODE=distributed`、真实 Server 和兼容 SDK。
2452
2467
 
2453
2468
  ### 14.5 启动应用
2454
2469
 
@@ -2526,7 +2541,7 @@ curl http://localhost:8080/actuator/health
2526
2541
  }
2527
2542
  ```
2528
2543
 
2529
- > Sentinel、OpenTelemetry 追踪、Seata HTTP-AT、API Gateway 已内嵌实现,不属于外部依赖组件,因此不显示在聚合健康检查中;可通过应用日志或 `@SentinelResource`、`@Trace`、`@GlobalTransactional` 注解的实际调用验证。
2544
+ > Sentinel、OpenTelemetry 追踪和 API Gateway 可内嵌运行;HTTP 补偿协调器的未完成事务会纳入恢复日志。它不属于强一致外部事务协调器,不能替代 Seata Server。
2530
2545
 
2531
2546
  ### 14.7 部署故障排查
2532
2547
 
@@ -2751,7 +2766,7 @@ export LOG_LEVEL=INFO
2751
2766
  export LOG_DIR=logs
2752
2767
  ```
2753
2768
 
2754
- > Sentinel 限流熔断、OpenTelemetry 分布式追踪、Seata HTTP-AT 分布式事务、API Gateway 均为内嵌实现,无对应环境变量。AI 模块环境变量见第 12.2 节。
2769
+ > Sentinel 限流熔断、OpenTelemetry 分布式追踪和 API Gateway 可内嵌实现;HTTP 补偿事务通过 `SEATA_HTTP_*` 配置。AI 模块环境变量见第 12.2 节。
2755
2770
 
2756
2771
  ## 附录 B:Docker Compose 示例
2757
2772
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  SpringBootAI 是一个借鉴 Spring Boot 编程模型的 Python Web 框架,提供装饰器式组件扫描、依赖注入、FastAPI 路由、配置加载、安全能力、内嵌的 PyMyBatis ORM,以及企业级 AI 模块(对齐 Spring AI 2.0:ChatClient/Advisor/Tools/RAG/Function Calling)。本指南为框架核心综合使用文档;**AI / ORM / Cloud / Excel 等模块的完整注解与功能说明已分离为独立文档**(见下方“模块文档”),本指南相应章节保留概览与跳转链接。
4
4
 
5
- - SpringBootAI 版本:`1.8.1`
5
+ - SpringBootAI 版本:`1.8.3`
6
6
  - 内嵌 PyMyBatis 版本:`1.4.0`
7
7
  - Python:3.10+
8
8
  - 状态:Beta(企业试点)
@@ -11,10 +11,12 @@ SpringBootAI 是一个借鉴 Spring Boot 编程模型的 Python Web 框架,提
11
11
 
12
12
  ## 模块文档
13
13
 
14
- 各模块的注解参考与功能说明已从本指南分离为独立文档,按需查阅:
14
+ 第一次使用请先读 [新手入门指南](doc/BEGINNER_GUIDE.md)。它从安装开始,带你创建第一个接口,并解释 Controller、Service、Bean、依赖注入和配置文件是什么。各模块文档统一按“解决什么问题 -> 如何启用 -> 最小示例 -> 如何验证 -> 常见错误 -> 生产边界”组织,按需查阅即可,不要求一次读完。
15
15
 
16
16
  | 模块 | 文档 | 安装 | 说明 |
17
17
  |------|------|------|------|
18
+ | 新手入门 | [BEGINNER_GUIDE.md](doc/BEGINNER_GUIDE.md) | 随核心包 | 从零安装、创建项目、运行接口、打开 Swagger、选择后续模块 |
19
+ | 常用注解模块 | [ANNOTATION_MODULES.md](doc/ANNOTATION_MODULES.md) | 随核心包 | Bean Validation / 条件装配 / 缓存增强 / CSV / `@Version` / `@Transient` |
18
20
  | AI(对齐 Spring AI 2.0) | [AI_MODULE.md](doc/AI_MODULE.md) | `pip install springbootAI[ai]` | ChatClient / Advisor / Tools / RAG / Function Calling / ETL / 多厂商 LangChain 化 / 韧性 / 观测 |
19
21
  | 内嵌 PyMyBatis ORM 与 DDL | [ORM_MODULE.md](doc/ORM_MODULE.md) | 随核心包 | Mapper 注解 / XML Mapper / 分页 / SQL 安全 / DDL 自动建表 |
20
22
  | Spring Cloud(对齐 Cloud Alibaba) | [CLOUD_MODULE.md](doc/CLOUD_MODULE.md) | 随核心包 | 服务注册发现 / 配置刷新 / Feign / Sentinel / Gateway / 负载均衡 / 分布式事务 |
@@ -23,10 +25,19 @@ SpringBootAI 是一个借鉴 Spring Boot 编程模型的 Python Web 框架,提
23
25
  | Swagger / OpenAPI(对齐 SpringDoc) | [SWAGGER_MODULE.md](doc/SWAGGER_MODULE.md) | 随核心包 | `@Tag` / `@Operation` / `@ApiResponse` / `@Parameter` / `@Schema` / `@SecurityScheme` 注解驱动 API 文档 + Swagger2 别名 |
24
26
  | P0/P1/P2 八大模块 | [EIGHT_MODULES.md](doc/EIGHT_MODULES.md) | 随核心包 | Spring Data Repository / Actuator / 多数据源读写分离 / 事务事件 / 配置松散绑定 / 测试切片 / i18n / WebSocket |
25
27
  | 安全 | [SECURITY.md](doc/SECURITY.md) | 随核心包 | JWT 生成校验 / 密码加密(SHA256/MD5/BCrypt)/ SQL 注入防护 / 访问控制 |
28
+ | BeanUtils(属性复制工具) | [BEAN_UTILS.md](doc/BEAN_UTILS.md) | 随核心包 | `copy_properties` / `clone` / `get_property` / `set_property` / `populate` / `describe` 对齐 Spring + Apache Commons BeanUtils |
26
29
  | 测试报告 | [TEST_REPORT.md](doc/TEST_REPORT.md) | — | 全量测试用例与覆盖范围 |
27
30
 
28
31
  > 所有模块文档统一存放于 [`doc/`](doc/) 目录。本指南正文中出现的"已分离至独立文档"链接均指向 `doc/` 下的对应文件。
29
32
 
33
+ ### 新手推荐阅读顺序
34
+
35
+ 1. 按 [新手入门指南](doc/BEGINNER_GUIDE.md) 跑通 `/api/hello/{name}`。
36
+ 2. 阅读本页第 4、6、7 章,理解配置、依赖注入和 Controller。
37
+ 3. 做数据库 CRUD 时阅读 [ORM_MODULE.md](doc/ORM_MODULE.md)。
38
+ 4. 需要输入校验、缓存或条件开关时阅读 [ANNOTATION_MODULES.md](doc/ANNOTATION_MODULES.md)。
39
+ 5. 最后再按业务需要选择安全、Cloud、AI、Excel、WebSocket 或性能测试文档。
40
+
30
41
  ## 目录
31
42
 
32
43
  1. [框架概述与定位](#1-框架概述与定位)
@@ -58,7 +69,7 @@ SpringBootAI 借鉴了 Spring Boot 的注解和分层习惯,但运行时是 Py
58
69
 
59
70
  | 组件 | 当前版本 |
60
71
  |------|----------|
61
- | `spring` 框架 API | 1.8.0 |
72
+ | `spring` 框架 API | 1.8.3 |
62
73
  | `spring.orm.pymybatis` | 1.4.0 |
63
74
  | Python | 3.10+ |
64
75
 
@@ -74,7 +85,7 @@ SpringBootAI 借鉴了 Spring Boot 的注解和分层习惯,但运行时是 Py
74
85
  - 自动化 ORM 契约测试使用 SQLite;MySQL、PostgreSQL、Oracle 需单独验证。
75
86
  - 本地 `@Transactional` 支持全部七种 Spring 传播模式;`REQUIRES_NEW` 和 `NOT_SUPPORTED` 需要连接池有额外可用连接。
76
87
  - Profile 会筛选 `@Profile` Bean,但不会自动合并 `application-{profile}.yml`。
77
- - Nacos、RabbitMQ、Prometheus 依赖外部服务;Sentinel、Seata HTTP-AT、OpenTelemetry 追踪均已内嵌实现无需外部 Server。
88
+ - Nacos、RabbitMQ、Prometheus 依赖外部服务;Sentinel 和 OpenTelemetry 追踪可内嵌运行。HTTP 事务模式是持久化补偿协调器,不提供 Seata AT 强一致性;生产强一致场景必须使用真实 Seata Server 或可靠消息方案。
78
89
  - 限流、分布式锁、幂等和缓存语义依赖 Redis 等后端,降级路径需要故障注入。
79
90
 
80
91
  ### 1.4 注解使用总览
@@ -109,7 +120,7 @@ SpringBootAI 注解会先把元数据放到 `__spring_annotations__`。之后是
109
120
  | Nacos 服务发现 | ✅ 可用 | 服务注册/发现/订阅,支持无认证开发模式 |
110
121
  | Sentinel 限流熔断 | ✅ 可用 | 内嵌引擎,QPS 限流、异常比例/异常数/慢调用熔断、热点参数限流,无需 Dashboard |
111
122
  | 分布式追踪 | ✅ 可用 | 原生 OpenTelemetry(W3C traceparent),自动 HTTP/Feign 注入,无需 OAP Server |
112
- | Seata 分布式事务 | ✅ 可用 | 内嵌 HTTP-AT 模式,分支注册/提交/回滚,XID 自动传播,无需 Seata Server |
123
+ | Seata 分布式事务 | ⚠️ 有边界 | `distributed` 对接真实 Seata SDK/Server;`http` 仅提供显式启用的持久化补偿,支持重启恢复和 XID 传播,不等同 AT |
113
124
  | API Gateway | ✅ 可用 | 轻量 ASGI/WSGI 网关,路由转发、路径重写、过滤器链、负载均衡 |
114
125
  | Prometheus 监控 | ✅ 可用 | Counter/Gauge/Histogram 指标暴露 |
115
126
  | Feign 声明式 HTTP | ✅ 可用 | 声明式接口、Fallback 降级、自动传播 XID 和 trace 头 |
@@ -1407,7 +1418,7 @@ class ScheduledTasks:
1407
1418
  | `@SentinelResource` | 限流、业务异常 fallback | 受管 Bean 方法会包装;已内嵌限流熔断引擎,无需 Sentinel Dashboard |
1408
1419
  | `@EnableGateway` | 启用 API Gateway | 元数据标记;配合 `GatewayRouter` 使用,内嵌轻量 ASGI/WSGI 网关 |
1409
1420
  | `@LoadBalanced` | 给 `@Bean` 工厂返回对象添加负载均衡标记 | `@Bean` 方法上会执行,但实际请求仍需配合框架负载均衡客户端 |
1410
- | `@GlobalTransactional` | 通过 Seata 管理全局事务 | 受管 Bean 方法会调用 Seata manager;已内嵌 HTTP-AT 模式,XID 自动通过 Feign 传播;不支持嵌套 |
1421
+ | `@GlobalTransactional` | 通过 Seata 管理全局事务 | 受管 Bean 方法调用 Seata manager;HTTP 模式为持久化补偿且要求幂等回调,强一致生产场景使用 `distributed`;不支持嵌套 |
1411
1422
  | `@Valid` | 非空/嵌套对象基础检查 | 受管 Bean 方法会执行简化校验,不等同 Jakarta Bean Validation |
1412
1423
  | `@Validated` | 分组校验 | 会执行简化检查,但 `groups` 当前未驱动真正的分组规则 |
1413
1424
  | `@RabbitListener` | 注册 RabbitMQ 消费者 | 可直接装饰受管 Bean 方法;容器声明队列/交换机、注册回调,并在刷新后启动后台消费;支持同步和异步回调 |
@@ -1880,7 +1891,7 @@ class AdminController:
1880
1891
 
1881
1892
  ### 11.1 @Cacheable
1882
1893
 
1883
- 当前 `@Cacheable` 使用 `BeanFactory` 内的本地缓存,默认最多 1000 项、TTL 300 秒。`value` 是缓存命名空间;`key="user_id"` 取同名参数,`key="user_{user_id}"` 使用模板,其他字符串作为固定键;`condition="enabled"`、`condition="!skip_cache"` 或 callable 决定是否缓存。同步方法缓存普通返回值,异步方法会先 `await` 再缓存最终结果,不会缓存 coroutine。缓存不跨进程,也没有对应的自动驱逐注解。写操作后的业务缓存失效不由 ORM 查询缓存自动替代。
1894
+ 当前缓存默认由 `BeanFactory` 提供本地内存实现,最多 1000 项、TTL 300 秒,不跨进程。`@Cacheable` 负责“先查缓存,未命中才执行方法”;`@CachePut` 负责执行方法后写入新值;`@CacheEvict` 负责删除一个键或清空一个命名空间;`@CacheConfig` 和 `@Caching` 用于统一命名空间或组合多个操作。`value` 是缓存命名空间;`key="user_id"` 取同名参数,`key="user_{user_id}"` 使用模板,其他字符串作为固定键;`condition="enabled"`、`condition="!skip_cache"` 或 callable 决定是否缓存。同步方法缓存普通返回值,异步方法会先 `await` 再缓存最终结果,不会缓存 coroutine。写操作后的业务缓存失效仍需由业务方法显式使用 `@CachePut`/`@CacheEvict`;生产多 worker 或多实例应接入共享 Redis,并自行验证一致性和故障降级。
1884
1895
 
1885
1896
  ### 11.2 @Retryable
1886
1897
 
@@ -1934,7 +1945,7 @@ class CleanupJob:
1934
1945
 
1935
1946
  `@SentinelResource`、`@GlobalTransactional` 和方法级 `@LoadBalanced` 有 AOP 消费路径;`@EnableDiscoveryClient`、`@FeignClient` 等当前主要是元数据,Nacos 实际初始化由 `discovery.enabled` 和 `ApplicationContext` 启动流程控制。Nacos 客户端需要 `nacos-sdk-python`、`NACOS_SERVER`、`NACOS_USERNAME`、`NACOS_PASSWORD`;Nacos 2.2+ Docker 服务端还需要 Base64 token 和 identity 环境变量。
1936
1947
 
1937
- 配置 `rabbitmq.enabled: true` 并提供 host、port、username、password、virtual_host。开发环境也应在真实 Nacos、RabbitMQ、Redis 等环境执行集成、断线和重复投递测试。Sentinel、Seata HTTP-AT、OpenTelemetry 追踪、API Gateway 均已内嵌实现,无需外部 Server。
1948
+ 配置 `rabbitmq.enabled: true` 并提供 host、port、username、password、virtual_host。开发环境也应在真实 Nacos、RabbitMQ、Redis 等环境执行集成、断线和重复投递测试。HTTP 事务模式会将协调元数据写入 `seata.store_path`,并在 worker 启动后周期恢复;它是补偿事务,不是 Seata AT,也不能单独满足支付、订单、库存的一致性要求。
1938
1949
 
1939
1950
  ---
1940
1951
 
@@ -2144,7 +2155,7 @@ class UserMapper:
2144
2155
  | `@LoadBalanced` | 同名注解 | 使用 Python 负载均衡实现;不要复用 `RestTemplate` 用法 |
2145
2156
  | Sentinel `@SentinelResource` | 同名注解 | 已内嵌限流熔断引擎,无需 Dashboard;如需更强大治理能力可对接外部 Sentinel Dashboard |
2146
2157
  | Spring Cloud Gateway | `@EnableGateway` + `GatewayRouter` | 内嵌轻量 ASGI/WSGI 网关;复杂网关需求可使用 Kong/APISIX 等专业网关 |
2147
- | Seata `@GlobalTransactional` | 同名注解 | 已内嵌 HTTP-AT 模式,无需 Seata Server,XID 自动通过 Feign 传播;如需更强一致性保障可对接外部 Seata Server |
2158
+ | Seata `@GlobalTransactional` | 同名注解 | `http` 模式是持久化补偿协调器,依赖幂等分支回调;企业强一致场景必须配置真实 Seata Server 与兼容 SDK |
2148
2159
 
2149
2160
  **Cloud 高级功能迁移对照**:
2150
2161
 
@@ -2152,7 +2163,7 @@ class UserMapper:
2152
2163
  |---|---|---|
2153
2164
  | Sentinel Dashboard + `@SentinelResource` | `@SentinelResource` | 内嵌引擎,无需 Dashboard;支持 QPS 限流、异常比例/异常数/慢调用熔断、热点参数限流 |
2154
2165
  | SkyWalking Agent + OAP Server | `@Trace` + 内嵌 Tracer | 原生 OpenTelemetry(W3C traceparent),无需 OAP Server;自动注入 HTTP/Feign 追踪头 |
2155
- | Seata Server + `@GlobalTransactional` | `@GlobalTransactional` | 内嵌 HTTP-AT 模式,无需 Seata Server;支持分支注册/提交/回滚,XID 自动传播 |
2166
+ | Seata Server + `@GlobalTransactional` | `@GlobalTransactional` | `distributed` 模式对接 Seata Server;`http` 仅用于补偿流程和故障演练,不提供 AT 语义 |
2156
2167
  | Spring Cloud Gateway | `GatewayRouter` | 轻量 ASGI/WSGI 网关,支持路由转发、路径重写、过滤器链、负载均衡 |
2157
2168
  | JPA `hibernate.ddl-auto` | `@entity` + `ddl-auto` 配置 | 支持 create/update/validate/create-drop;自动扫描实体包,自动建表/添加列/创建索引 |
2158
2169
 
@@ -2238,7 +2249,7 @@ Java 的 profile 文件自动合并不是当前功能。部署流程应生成最
2238
2249
  4. 用目标 MySQL/PostgreSQL/Oracle 版本执行相同测试,特别验证自增主键、事务隔离、超时和连接中断。
2239
2250
  5. 启动 ASGI 应用,检查 `/docs`、`/actuator/health/liveness` 和 `/actuator/health/readiness`。
2240
2251
  6. 接入 Nacos、RabbitMQ、Redis 等外部中间件,并演练断线、重复投递和回滚。
2241
- 7. 验证内嵌 Cloud 功能:`@SentinelResource` 限流熔断、`@Trace` 追踪、`@GlobalTransactional` 分布式事务、`GatewayRouter` 网关、`@entity` + `ddl-auto` 自动建表。这些功能无需部署外部 Server,但应在真实流量和故障注入下验证。
2252
+ 7. 验证 Cloud 功能:`@SentinelResource` 限流熔断、`@Trace` 追踪、`@GlobalTransactional` 补偿流程、`GatewayRouter` 网关、`@entity` + `ddl-auto` 自动建表。HTTP 补偿模式必须验证重复回调、进程重启和部分失败;强一致事务需部署真实 Seata Server 并执行集成测试。
2242
2253
 
2243
2254
  ---
2244
2255
 
@@ -2362,9 +2373,13 @@ logging:
2362
2373
  | `DISCOVERY_ENABLED` | 是否启用 Nacos 服务发现 | false |
2363
2374
  | `NACOS_SERVER` | Nacos 地址 | localhost:8848 |
2364
2375
  | `NACOS_USERNAME` / `NACOS_PASSWORD` | Nacos 客户端账号/密码 | 空 |
2376
+ | `SEATA_HTTP_STORE_PATH` | HTTP 补偿协调 SQLite 文件路径(同主机多 worker 共享) | `./data/seata-http.sqlite3` |
2377
+ | `SEATA_HTTP_RECOVER_ON_STARTUP` | 初始化时扫描并恢复未完成补偿 | true |
2378
+ | `SEATA_HTTP_RECOVERY_GRACE_MS` | 接管其他 worker 的 COMMITTING/ROLLING_BACK 前等待时间 | 30000 |
2379
+ | `SEATA_HTTP_RECOVERY_INTERVAL_S` | worker 内周期恢复间隔,0 表示关闭 | 30 |
2365
2380
  | `SPRING_DISABLE_DOCKER_IP_DETECT` | 设为 1 禁用 Docker 容器 IP 自动检测 | 0 |
2366
2381
 
2367
- > Sentinel、OpenTelemetry 追踪、Seata HTTP-AT、API Gateway 已内嵌实现,没有对应环境变量。
2382
+ > HTTP 补偿模式使用 `SEATA_HTTP_*` 配置,仍不提供 Seata AT;生产强一致事务必须配置 `SEATA_MODE=distributed`、真实 Server 和兼容 SDK。
2368
2383
 
2369
2384
  ### 14.5 启动应用
2370
2385
 
@@ -2442,7 +2457,7 @@ curl http://localhost:8080/actuator/health
2442
2457
  }
2443
2458
  ```
2444
2459
 
2445
- > Sentinel、OpenTelemetry 追踪、Seata HTTP-AT、API Gateway 已内嵌实现,不属于外部依赖组件,因此不显示在聚合健康检查中;可通过应用日志或 `@SentinelResource`、`@Trace`、`@GlobalTransactional` 注解的实际调用验证。
2460
+ > Sentinel、OpenTelemetry 追踪和 API Gateway 可内嵌运行;HTTP 补偿协调器的未完成事务会纳入恢复日志。它不属于强一致外部事务协调器,不能替代 Seata Server。
2446
2461
 
2447
2462
  ### 14.7 部署故障排查
2448
2463
 
@@ -2667,7 +2682,7 @@ export LOG_LEVEL=INFO
2667
2682
  export LOG_DIR=logs
2668
2683
  ```
2669
2684
 
2670
- > Sentinel 限流熔断、OpenTelemetry 分布式追踪、Seata HTTP-AT 分布式事务、API Gateway 均为内嵌实现,无对应环境变量。AI 模块环境变量见第 12.2 节。
2685
+ > Sentinel 限流熔断、OpenTelemetry 分布式追踪和 API Gateway 可内嵌实现;HTTP 补偿事务通过 `SEATA_HTTP_*` 配置。AI 模块环境变量见第 12.2 节。
2671
2686
 
2672
2687
  ## 附录 B:Docker Compose 示例
2673
2688
 
@@ -12,7 +12,7 @@ build-backend = "setuptools.build_meta"
12
12
  [project]
13
13
  # 发行名 springbootAI(PyPI 包名,pip install springbootAI);导入包名仍为 spring
14
14
  name = "springbootAI"
15
- version = "1.8.1"
15
+ version = "1.8.3"
16
16
  description = "Python版Spring Boot框架,集成PyMyBatis ORM"
17
17
  readme = "README.md"
18
18
  license = "MIT"
@@ -5,7 +5,7 @@ from .config import *
5
5
  from .utils import *
6
6
  from .main import create_app, run, SpringApplication, run_cli
7
7
 
8
- __version__ = "1.8.1"
8
+ __version__ = "1.8.3"
9
9
  __author__ = "yuconggen"
10
10
  __license__ = "MIT"
11
11
 
@@ -3,6 +3,7 @@ Spring Cloud AOP 切面实现(企业级版本)
3
3
  使用真实的分布式组件:Seata事务、Nacos服务发现、Sentinel限流熔断等
4
4
  """
5
5
  from typing import Any, Callable, Dict, List, Optional, Type
6
+ import asyncio
6
7
  import time
7
8
  import functools
8
9
  import threading
@@ -139,17 +140,44 @@ def global_transactional_decorator(annotation: GlobalTransactional):
139
140
  if seata_manager.is_in_transaction():
140
141
  logger.warning("[GlobalTransactional] Nested transaction detected, skipping")
141
142
  return await func(*args, **kwargs)
142
- tx_id = begin_transaction()
143
+ if seata_manager.get_mode() == "http":
144
+ tx_id = await asyncio.to_thread(begin_transaction)
145
+ transaction_context = await asyncio.to_thread(
146
+ seata_manager.get_transaction_context, tx_id
147
+ )
148
+ if transaction_context is None:
149
+ seata_manager._cleanup_context()
150
+ raise RuntimeError(
151
+ f"Unable to bind durable HTTP transaction context: {tx_id}"
152
+ )
153
+ seata_manager.bind_transaction_context(transaction_context)
154
+ else:
155
+ tx_id = begin_transaction()
143
156
  start_time = time.monotonic()
144
157
  try:
145
158
  result = await func(*args, **kwargs)
146
- commit_transaction(tx_id, time.monotonic() - start_time)
147
- return result
148
159
  except Exception:
149
160
  if seata_manager.is_in_transaction():
150
- seata_manager.rollback_transaction(tx_id)
161
+ try:
162
+ await asyncio.to_thread(
163
+ seata_manager.rollback_transaction, tx_id
164
+ )
165
+ finally:
166
+ # Context changes in to_thread stay in its copied
167
+ # context, so clear the event-loop task explicitly.
168
+ seata_manager._cleanup_context()
151
169
  raise
152
170
 
171
+ try:
172
+ await asyncio.to_thread(
173
+ commit_transaction,
174
+ tx_id,
175
+ time.monotonic() - start_time,
176
+ )
177
+ return result
178
+ finally:
179
+ seata_manager._cleanup_context()
180
+
153
181
  return async_wrapper
154
182
 
155
183
  @functools.wraps(func)
@@ -18,6 +18,7 @@ from spring.cloud.seata import (
18
18
  SeataTransactionManager,
19
19
  BranchStatus,
20
20
  )
21
+ from spring.cloud.transaction_store import SQLiteTransactionStore
21
22
  from spring.cloud.sentinel import (
22
23
  sentinel_engine,
23
24
  SentinelEngine,
@@ -63,6 +64,7 @@ __all__ = [
63
64
  'FeignClientProxy', 'FeignClientFactory', 'create_feign_client', 'create_declared_feign_client',
64
65
  # 分布式事务
65
66
  'seata_manager', 'init_seata', 'SeataTransactionManager', 'BranchStatus',
67
+ 'SQLiteTransactionStore',
66
68
  # 熔断限流
67
69
  'sentinel_engine', 'SentinelEngine', 'FlowRule', 'DegradeRule',
68
70
  'SystemRule', 'HotParamRule', 'BlockException', 'sentinel_protect',
@@ -185,9 +185,10 @@ class GatewayRouter:
185
185
  作为异步 Starlette/FastAPI endpoint 使用。上游 I/O 不会阻塞事件循环。
186
186
 
187
187
  Usage:
188
- gateway = GatewayRouter(discovery_client=nacos_discovery)
189
- gateway.route("/api/users/**", "user-service", strip_prefix=True)
190
- app.add_route("/api/{path:path}", gateway.handle_asgi, methods=["GET","POST","PUT","DELETE"])
188
+ gateway = GatewayRouter(timeout=5)
189
+ gateway.route("/api/users/**", uri="http://127.0.0.1:8081",
190
+ strip_prefix=True)
191
+ gateway.install(app, "/api/{path:path}")
191
192
  """
192
193
 
193
194
  _HOP_BY_HOP_HEADERS = {
@@ -216,11 +217,27 @@ class GatewayRouter:
216
217
  def install(self, app, path: str = "/{path:path}",
217
218
  methods: Optional[List[str]] = None) -> "GatewayRouter":
218
219
  """Register the gateway route and its HTTP-client shutdown hook."""
219
- app.add_api_route(
220
- path,
221
- self.handle_asgi,
222
- methods=methods or ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"],
223
- )
220
+ route_methods = methods or ["GET", "POST", "PUT", "PATCH", "DELETE", "OPTIONS"]
221
+ path_id = re.sub(r"[^a-zA-Z0-9]+", "_", path).strip("_") or "root"
222
+ existing_operation_ids = {
223
+ getattr(route, "operation_id", None) for route in app.routes
224
+ }
225
+ for method in route_methods:
226
+ normalized_method = method.upper()
227
+ base_operation_id = f"gateway_{normalized_method.lower()}_{path_id}"
228
+ operation_id = base_operation_id
229
+ suffix = 2
230
+ while operation_id in existing_operation_ids:
231
+ operation_id = f"{base_operation_id}_{suffix}"
232
+ suffix += 1
233
+ existing_operation_ids.add(operation_id)
234
+ app.add_api_route(
235
+ path,
236
+ self.handle_asgi,
237
+ methods=[normalized_method],
238
+ name=operation_id,
239
+ operation_id=operation_id,
240
+ )
224
241
  app.router.add_event_handler("shutdown", self.aclose)
225
242
  return self
226
243