记录一下一些坑
Grails3.2-
版能够直接在domain
中注入service
,在Grails3.2+
中默认关闭了自动注入功能
在
application.groovy
中配置全局映射,若没有此脚本需新建
grails.gorm.default.mapping = { autowire true }
在须要注入bean
的domain
中添加映射
static mapping = { autowire true }
在
application.yml
中新增或修改配置
--- grails: gorm: autowire: true