Browse Source

Connected to SDAPI1

Dmitry Yu Okunev 2 years ago
parent
commit
5cd5636c17
2 changed files with 8 additions and 0 deletions
  1. 0 0
      .gitmodules
  2. 8 0
      app/init.go

+ 0 - 0
.gitmodules


+ 8 - 0
app/init.go

@@ -3,6 +3,7 @@ package app
 import (
 	"database/sql"
 	"devel.mephi.ru/dyokunev/cps-api/app/models"
+	asuModels "devel.mephi.ru/dyokunev/go-asu-models"
 	"encoding/base64"
 	"fmt"
 	_ "github.com/go-sql-driver/mysql"
@@ -30,6 +31,7 @@ var (
 var (
 	casClient *cas.Client
 	dbCps     *reform.DB
+	dbSdapi1  *reform.DB
 )
 
 const (
@@ -216,6 +218,12 @@ func initDB() {
 	dbCps, _ = initReformDb("cps")
 
 	models.EventSQL.SetDefaultDB(dbCps)
+
+	dbSdapi1, _ = initReformDb("sdapi1")
+
+	asuModels.FormularSQL.SetDefaultDB(dbSdapi1)
+	asuModels.UnitSQL.SetDefaultDB(dbSdapi1)
+	asuModels.PersonSQL.SetDefaultDB(dbSdapi1)
 }
 
 /*func waitForDB() {