作者 陈志颖

chore:项目数据库生成配置

1 package main 1 package main
2 2
3 import ( 3 import (
4 - "fmt"  
5 "github.com/beego/beego/v2/server/web" 4 "github.com/beego/beego/v2/server/web"
6 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg" 5 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/infrastructure/pg"
7 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego" 6 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego"
8 ) 7 )
9 8
10 func main() { 9 func main() {
11 - fmt.Print("Server Started!")  
12 -  
13 // web主服务 10 // web主服务
14 web.Run() 11 web.Run()
15 } 12 }
@@ -30,11 +30,18 @@ func init() { @@ -30,11 +30,18 @@ func init() {
30 &models.ContractUndertakerFeedback{}, 30 &models.ContractUndertakerFeedback{},
31 &models.CooperationApplication{}, 31 &models.CooperationApplication{},
32 &models.CooperationContract{}, 32 &models.CooperationContract{},
  33 + &models.CooperationContractChangeLog{},
  34 + &models.CooperationContractRelevant{},
  35 + &models.CooperationContractUndertaker{},
33 &models.CooperationMode{}, 36 &models.CooperationMode{},
34 &models.CooperationProject{}, 37 &models.CooperationProject{},
  38 + &models.CreditAccount{},
35 &models.DividendsEstimate{}, 39 &models.DividendsEstimate{},
36 &models.DividendsIncentivesRule{}, 40 &models.DividendsIncentivesRule{},
  41 + &models.DividendsOrder{},
  42 + &models.DividendsReturnedOrder{},
37 &models.MoneyIncentivesRule{}, 43 &models.MoneyIncentivesRule{},
  44 + &models.OrderGood{},
38 } { 45 } {
39 err := DB.Model(model).CreateTable(&orm.CreateTableOptions{ 46 err := DB.Model(model).CreateTable(&orm.CreateTableOptions{
40 Temp: false, 47 Temp: false,
@@ -13,8 +13,8 @@ func init() { @@ -13,8 +13,8 @@ func init() {
13 Logger.SetServiceName(constant.SERVICE_NAME) 13 Logger.SetServiceName(constant.SERVICE_NAME)
14 Logger.SetLevel(constant.LOG_LEVEL) 14 Logger.SetLevel(constant.LOG_LEVEL)
15 15
16 - if constant.ENABLE_KAFKA_LOG {  
17 - w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)  
18 - Logger.AddHook(w)  
19 - } 16 + //if constant.ENABLE_KAFKA_LOG {
  17 + // w, _ := logrus.NewKafkaWriter(constant.KAFKA_HOSTS, constant.TOPIC_LOG_STASH, false)
  18 + // Logger.AddHook(w)
  19 + //}
20 } 20 }
@@ -9,6 +9,7 @@ import ( @@ -9,6 +9,7 @@ import (
9 "strconv" 9 "strconv"
10 "time" 10 "time"
11 11
  12 + _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/application"
12 . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log" 13 . "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/log"
13 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego/routers" 14 _ "gitlab.fjmaimaimai.com/allied-creation/allied-creation-cooperation/pkg/port/beego/routers"
14 ) 15 )
@@ -17,7 +18,7 @@ func init() { @@ -17,7 +18,7 @@ func init() {
17 web.BConfig.AppName = "allied-creation-cooperation" 18 web.BConfig.AppName = "allied-creation-cooperation"
18 web.BConfig.CopyRequestBody = true 19 web.BConfig.CopyRequestBody = true
19 web.BConfig.RunMode = "dev" 20 web.BConfig.RunMode = "dev"
20 - web.BConfig.Listen.HTTPPort = 8080 21 + web.BConfig.Listen.HTTPPort = 8082
21 web.BConfig.Listen.EnableAdmin = false 22 web.BConfig.Listen.EnableAdmin = false
22 web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego" 23 web.BConfig.WebConfig.CommentRouterPath = "/pkg/port/beego"
23 if os.Getenv("RUN_MODE") != "" { 24 if os.Getenv("RUN_MODE") != "" {