上传代码

This commit is contained in:
liwei1dao 2022-06-01 14:52:33 +08:00
parent 0e1f31c0b9
commit 126ff41523
6 changed files with 24 additions and 13 deletions

2
.gitignore vendored
View File

@ -15,5 +15,7 @@ bin/conf
.vscode .vscode
./bin/conf ./bin/conf
./bin/log ./bin/log
./bin/gateway
./bin/worker
~$*.xlsx ~$*.xlsx
cmd/luban/ cmd/luban/

6
linux-build.bat Normal file
View File

@ -0,0 +1,6 @@
set GOOS=linux
set CGO_ENABLED=0
del bin/gateway,bin/worker
go build -o bin/gateway services/gateway/main.go
go build -o bin/worker services/worker/main.go
REM pause

View File

@ -24,5 +24,6 @@ func (this *User_Comp) Login(ctx context.Context, session comm.IUserSession, rsp
session.SendMsg("LogigResp", &pb.UserLoginResp{ session.SendMsg("LogigResp", &pb.UserLoginResp{
Code: 200, Code: 200,
}) })
return nil return nil
} }

View File

@ -2,9 +2,7 @@ package services
import ( import (
"fmt" "fmt"
"go_dreamfactory/sys/cache"
"go_dreamfactory/sys/configure" "go_dreamfactory/sys/configure"
"go_dreamfactory/sys/db"
"github.com/liwei1dao/lego/base/rpcx" "github.com/liwei1dao/lego/base/rpcx"
"github.com/liwei1dao/lego/sys/log" "github.com/liwei1dao/lego/sys/log"
@ -16,16 +14,6 @@ type ServiceBase struct {
func (this *ServiceBase) InitSys() { func (this *ServiceBase) InitSys() {
this.RPCXService.InitSys() this.RPCXService.InitSys()
if err := cache.OnInit(this.GetSettings().Sys["cache"]); err != nil {
panic(fmt.Sprintf("init sys.cache err: %s", err.Error()))
} else {
log.Infof("init sys.cache success!")
}
if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil {
panic(fmt.Sprintf("init sys.db err: %s", err.Error()))
} else {
log.Infof("init sys.db success!")
}
if err := configure.OnInit(this.GetSettings().Sys["configure"]); err != nil { if err := configure.OnInit(this.GetSettings().Sys["configure"]); err != nil {
panic(fmt.Sprintf("init sys.configure err: %s", err.Error())) panic(fmt.Sprintf("init sys.configure err: %s", err.Error()))
} else { } else {

View File

@ -2,12 +2,16 @@ package main
import ( import (
"flag" "flag"
"fmt"
"go_dreamfactory/modules/web" "go_dreamfactory/modules/web"
"go_dreamfactory/services" "go_dreamfactory/services"
"go_dreamfactory/sys/cache"
"go_dreamfactory/sys/db"
"github.com/liwei1dao/lego" "github.com/liwei1dao/lego"
"github.com/liwei1dao/lego/base/rpcx" "github.com/liwei1dao/lego/base/rpcx"
"github.com/liwei1dao/lego/core" "github.com/liwei1dao/lego/core"
"github.com/liwei1dao/lego/sys/log"
) )
var ( var (
@ -41,4 +45,14 @@ type Service struct {
func (this *Service) InitSys() { func (this *Service) InitSys() {
this.ServiceBase.InitSys() this.ServiceBase.InitSys()
if err := cache.OnInit(this.GetSettings().Sys["cache"]); err != nil {
panic(fmt.Sprintf("init sys.cache err: %s", err.Error()))
} else {
log.Infof("init sys.cache success!")
}
if err := db.OnInit(this.GetSettings().Sys["db"]); err != nil {
panic(fmt.Sprintf("init sys.db err: %s", err.Error()))
} else {
log.Infof("init sys.db success!")
}
} }

View File

@ -147,6 +147,6 @@ func (this *Configure) loaderConfigure(name string, handle *configurehandle) (er
} }
this.clock.Lock() this.clock.Lock()
this.configure[name] = returnValues[0].Interface() this.configure[name] = returnValues[0].Interface()
this.clock.Lock() this.clock.Unlock()
return return
} }