作者 陈志颖

chore:项目数据库生成配置

package main
import (
"fmt"
"github.com/beego/beego/v2/server/web"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego"
)
func main() {
fmt.Print("Server Started!")
// web主服务
web.Run()
}
... ...
... ... @@ -30,11 +30,18 @@ func init() {
&models.ContractUndertakerFeedback{},
&models.CooperationApplication{},
&models.CooperationContract{},
&models.CooperationContractChangeLog{},
&models.CooperationContractRelevant{},
&models.CooperationContractUndertaker{},
&models.CooperationMode{},
&models.CooperationProject{},
&models.CreditAccount{},
&models.DividendsEstimate{},
&models.DividendsIncentivesRule{},
&models.DividendsOrder{},
&models.DividendsReturnedOrder{},
&models.MoneyIncentivesRule{},
&models.OrderGood{},
} {
err := DB.Model(model).CreateTable(&orm.CreateTableOptions{
Temp: false,
... ...
... ... @@ -13,8 +13,8 @@ func init() {
Logger.SetServiceName(constant.SERVICE_NAME)
Logger.SetLevel(constant.LOG_LEVEL)
if constant.ENABLE_KAFKA_LOG {
w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)
Logger.AddHook(w)
}
//if constant.ENABLE_KAFKA_LOG {
// w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)
// Logger.AddHook(w)
//}
}
... ...
... ... @@ -9,6 +9,7 @@ import (
"strconv"
"time"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application"
. "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
_ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego/routers"
)
... ... @@ -17,7 +18,7 @@ func init() {
web.BConfig.AppName = "allied-creation-cooperation"
web.BConfig.CopyRequestBody = true
web.BConfig.RunMode = "dev"
web.BConfig.Listen.HTTPPort = 8080
web.BConfig.Listen.HTTPPort = 8082
web.BConfig.Listen.EnableAdmin = false
web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego"
if os.Getenv("RUN_MODE") != "" {
... ...