package rest //@Service type DavService struct { Bean matterDao *MatterDao } //初始化方法 func (this *DavService) Init() { this.Bean.Init() //手动装填本实例的Bean. 这里必须要用中间变量方可。 b := CONTEXT.GetBean(this.matterDao) if b, ok := b.(*MatterDao); ok { this.matterDao = b } }