mirror of
https://github.com/astaxie/beego.git
synced 2024-11-21 21:20:54 +00:00
Fix: adapter's controller must implement ControllerInterface
This commit is contained in:
parent
6aa6c55f07
commit
8cc74652a2
@ -18,7 +18,6 @@ import (
|
|||||||
"mime/multipart"
|
"mime/multipart"
|
||||||
"net/url"
|
"net/url"
|
||||||
|
|
||||||
"github.com/astaxie/beego/pkg/adapter/context"
|
|
||||||
"github.com/astaxie/beego/pkg/adapter/session"
|
"github.com/astaxie/beego/pkg/adapter/session"
|
||||||
webContext "github.com/astaxie/beego/pkg/server/web/context"
|
webContext "github.com/astaxie/beego/pkg/server/web/context"
|
||||||
|
|
||||||
@ -61,14 +60,13 @@ func (p ControllerCommentsSlice) Swap(i, j int) {
|
|||||||
// http context, template and view, session and xsrf.
|
// http context, template and view, session and xsrf.
|
||||||
type Controller web.Controller
|
type Controller web.Controller
|
||||||
|
|
||||||
|
func (c *Controller) Init(ctx *webContext.Context, controllerName, actionName string, app interface{}) {
|
||||||
|
(*web.Controller)(c).Init(ctx, controllerName, actionName, app)
|
||||||
|
}
|
||||||
|
|
||||||
// ControllerInterface is an interface to uniform all controller handler.
|
// ControllerInterface is an interface to uniform all controller handler.
|
||||||
type ControllerInterface web.ControllerInterface
|
type ControllerInterface web.ControllerInterface
|
||||||
|
|
||||||
// Init generates default values of controller operations.
|
|
||||||
func (c *Controller) Init(ctx *context.Context, controllerName, actionName string, app interface{}) {
|
|
||||||
(*web.Controller)(c).Init((*webContext.Context)(ctx), controllerName, actionName, app)
|
|
||||||
}
|
|
||||||
|
|
||||||
// Prepare runs after Init before request function execution.
|
// Prepare runs after Init before request function execution.
|
||||||
func (c *Controller) Prepare() {
|
func (c *Controller) Prepare() {
|
||||||
(*web.Controller)(c).Prepare()
|
(*web.Controller)(c).Prepare()
|
||||||
|
@ -27,12 +27,11 @@ type DriverType orm.DriverType
|
|||||||
|
|
||||||
// Enum the Database driver
|
// Enum the Database driver
|
||||||
const (
|
const (
|
||||||
_ DriverType = iota // int enum type
|
DRMySQL = DriverType(orm.DRMySQL)
|
||||||
DRMySQL = orm.DRMySQL
|
DRSqlite = DriverType(orm.DRSqlite) // sqlite
|
||||||
DRSqlite = orm.DRSqlite // sqlite
|
DROracle = DriverType(orm.DROracle) // oracle
|
||||||
DROracle = orm.DROracle // oracle
|
DRPostgres = DriverType(orm.DRPostgres) // pgsql
|
||||||
DRPostgres = orm.DRPostgres // pgsql
|
DRTiDB = DriverType(orm.DRTiDB) // TiDB
|
||||||
DRTiDB = orm.DRTiDB // TiDB
|
|
||||||
)
|
)
|
||||||
|
|
||||||
type DB orm.DB
|
type DB orm.DB
|
||||||
|
Loading…
Reference in New Issue
Block a user