refactor: reorganize modules and add Linux build tooling
This commit is contained in:
7
module/ec/market/cmd/cli/main.go
Normal file
7
module/ec/market/cmd/cli/main.go
Normal file
@@ -0,0 +1,7 @@
|
||||
package main
|
||||
|
||||
import "log"
|
||||
|
||||
func main() {
|
||||
log.Println("Hello World!")
|
||||
}
|
||||
45
module/ec/market/cmd/main/main.go
Normal file
45
module/ec/market/cmd/main/main.go
Normal file
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* @Author: david.yan(david.yan@qq.com)
|
||||
* @Date: 2021-11-26 15:25:03
|
||||
*/
|
||||
package service
|
||||
|
||||
import (
|
||||
"bsm/full/module/ec/market/internal/config"
|
||||
"bsm/full/module/ec/market/internal/impl"
|
||||
"bsm/full/module/ec/market/internal/server"
|
||||
"git.apinb.com/bsm-sdk/core/service"
|
||||
)
|
||||
|
||||
var (
|
||||
ServiceKey = "Market"
|
||||
)
|
||||
|
||||
func Run() {
|
||||
config.New(ServiceKey)
|
||||
impl.NewImpl()
|
||||
|
||||
// 初始化服务
|
||||
s := server.New(config.Spec.Addr)
|
||||
srv := service.New(
|
||||
s.Grpc,
|
||||
&service.Options{
|
||||
Addr: config.Spec.Addr,
|
||||
MsConf: config.Spec.MicroService,
|
||||
EtcdClient: impl.Etcd,
|
||||
GatewayCtx: s.Ctx,
|
||||
GatewayConf: config.Spec.Gateway,
|
||||
GatewayMux: s.Mux,
|
||||
},
|
||||
)
|
||||
|
||||
// 停止服务
|
||||
defer srv.Stop()
|
||||
|
||||
// 启动服务
|
||||
srv.Start()
|
||||
}
|
||||
|
||||
func main() {
|
||||
Run()
|
||||
}
|
||||
Reference in New Issue
Block a user