27 lines
663 B
Go
27 lines
663 B
Go
package web
|
|
|
|
import (
|
|
"github.com/liwei1dao/lego/core"
|
|
"github.com/liwei1dao/lego/core/cbase"
|
|
"github.com/liwei1dao/lego/sys/gin"
|
|
"github.com/liwei1dao/lego/sys/gin/engine"
|
|
)
|
|
|
|
type Api_Comp struct {
|
|
cbase.ModuleCompBase
|
|
options *Options
|
|
gin gin.ISys
|
|
}
|
|
|
|
func (this *Api_Comp) Init(service core.IService, module core.IModule, comp core.IModuleComp, options core.IModuleOptions) (err error) {
|
|
err = this.ModuleCompBase.Init(service, module, comp, options)
|
|
this.options = options.(*Options)
|
|
this.gin, err = gin.NewSys(gin.SetListenPort(this.options.Port))
|
|
this.gin.GET("./test", this.test)
|
|
return
|
|
}
|
|
|
|
func (this *Api_Comp) test(c *engine.Context) {
|
|
|
|
}
|