25 lines
461 B
Go
25 lines
461 B
Go
package service
|
|
|
|
import (
|
|
"bsm/full/module/base/mgt/internal/config"
|
|
"bsm/full/module/base/mgt/internal/routers"
|
|
"github.com/gin-gonic/gin"
|
|
)
|
|
|
|
type Config = config.SrvConfig
|
|
|
|
type ExposeOptions struct {
|
|
Dependencies
|
|
Engine *gin.Engine
|
|
Config *Config
|
|
}
|
|
|
|
func Expose(options ExposeOptions) error {
|
|
applyDependencies(options.Dependencies)
|
|
if options.Config != nil {
|
|
config.Spec = *options.Config
|
|
}
|
|
routers.Register("mgt", options.Engine)
|
|
return nil
|
|
}
|