2015-03-17 7 views

ответ

0

There is no features like this yet there is an alternative solution 
 
where you can import your controller into another controller. 
 
ex - In ControllerA 
 
type ControllerA struct { 
 
\t ControllerB 
 
} 
 
func (this *ControllerA) Test() { 
 
    res := this.DoSomething("Asdasd") 
 
    fmt.Println(res) 
 
} 
 

 
In Controller B 
 
type ControllerB struct { 
 
\t beego.Controller 
 
} 
 
func (this *ControllerB) DoSomething(name string) string{ 
 
    return name 
 
}

1

Beego ОРМ еще не поддерживает. Если вам это действительно нужно. вы можете попробовать GORM http://jinzhu.me/gorm/.