optz.
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"bsm/full/module/base/fts/internal/config"
|
||||
"bsm/full/module/base/fts/internal/routers"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func Expose(engine *gin.Engine) error {
|
||||
type Config = config.SrvConfig
|
||||
|
||||
func Expose(engine *gin.Engine, cfg *Config) error {
|
||||
if cfg != nil {
|
||||
config.Spec = *cfg
|
||||
}
|
||||
routers.Register("fts", engine)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -1,11 +1,17 @@
|
||||
package service
|
||||
|
||||
import (
|
||||
"bsm/full/module/base/mgt/internal/config"
|
||||
"bsm/full/module/base/mgt/internal/routers"
|
||||
"github.com/gin-gonic/gin"
|
||||
)
|
||||
|
||||
func Expose(engine *gin.Engine) error {
|
||||
type Config = config.SrvConfig
|
||||
|
||||
func Expose(engine *gin.Engine, cfg *Config) error {
|
||||
if cfg != nil {
|
||||
config.Spec = *cfg
|
||||
}
|
||||
routers.Register("mgt", engine)
|
||||
return nil
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/base/passport/internal/config"
|
||||
"bsm/full/module/base/passport/internal/server"
|
||||
pb "bsm/full/module/base/passport/pb"
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
@@ -12,9 +13,15 @@ import (
|
||||
type ExposeOptions struct {
|
||||
GRPC *grpc.Server
|
||||
Gateway *gwRuntime.ServeMux
|
||||
Config *Config
|
||||
}
|
||||
|
||||
type Config = config.SrvConfig
|
||||
|
||||
func Expose(options ExposeOptions) error {
|
||||
if options.Config != nil {
|
||||
config.Spec = *options.Config
|
||||
}
|
||||
server.New(options.GRPC)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/base/sender/internal/config"
|
||||
"bsm/full/module/base/sender/internal/server"
|
||||
pb "bsm/full/module/base/sender/pb"
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
@@ -12,9 +13,15 @@ import (
|
||||
type ExposeOptions struct {
|
||||
GRPC *grpc.Server
|
||||
Gateway *gwRuntime.ServeMux
|
||||
Config *Config
|
||||
}
|
||||
|
||||
type Config = config.SrvConfig
|
||||
|
||||
func Expose(options ExposeOptions) error {
|
||||
if options.Config != nil {
|
||||
config.Spec = *options.Config
|
||||
}
|
||||
server.New(options.GRPC)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
@@ -3,6 +3,7 @@ package service
|
||||
import (
|
||||
"context"
|
||||
|
||||
"bsm/full/module/finance/wallet/internal/config"
|
||||
"bsm/full/module/finance/wallet/internal/server"
|
||||
pb "bsm/full/module/finance/wallet/pb"
|
||||
gwRuntime "github.com/grpc-ecosystem/grpc-gateway/v2/runtime"
|
||||
@@ -12,9 +13,15 @@ import (
|
||||
type ExposeOptions struct {
|
||||
GRPC *grpc.Server
|
||||
Gateway *gwRuntime.ServeMux
|
||||
Config *Config
|
||||
}
|
||||
|
||||
type Config = config.SrvConfig
|
||||
|
||||
func Expose(options ExposeOptions) error {
|
||||
if options.Config != nil {
|
||||
config.Spec = *options.Config
|
||||
}
|
||||
server.New(options.GRPC)
|
||||
|
||||
ctx := context.Background()
|
||||
|
||||
Reference in New Issue
Block a user