EricKIm преди 5 месеца
родител
ревизия
a76fc44287
променени са 1 файла, в които са добавени 0 реда и са изтрити 128 реда
  1. 0 128
      controller.go

+ 0 - 128
controller.go

@@ -17,10 +17,6 @@ func (c *Controller) Init() (int, string) {
 
 	var gtb GateTokenBase
 
-	// gtb := &struct {
-	// 	GateTokenBase
-	// }{}
-
 	var gtbStr string
 	var err error
 	if XConfig["IsYDBFixed"] == "Yes" {
@@ -48,34 +44,6 @@ func (c *Controller) Init() (int, string) {
 
 		if err := json.Unmarshal([]byte(gtbStr), &gtb); err == nil {
 			c.Gtb = gtb
-			// c.Gtb.ConnString = gtb.ConnString
-			// c.Gtb.RemoteIp = gtb.RemoteIp
-			// c.Gtb.DeviceDesc = gtb.DeviceDesc
-			// c.Gtb.FrontIp = gtb.FrontIp
-			// c.Gtb.FrontHost = gtb.FrontHost
-			// c.Gtb.Referer = gtb.Referer
-			// c.Gtb.SsoSubId = gtb.SsoSubId
-			// c.Gtb.UserId = gtb.UserId
-			// c.Gtb.UserPermId = gtb.UserPermId
-			// c.Gtb.MemberId = gtb.MemberId
-			// c.Gtb.MemberPermId = gtb.MemberPermId
-			// c.Gtb.SgroupId = gtb.SgroupId
-			// c.Gtb.BranchId = gtb.BranchId
-			// c.Gtb.StorageId = gtb.StorageId
-			// c.Gtb.AgroupId = gtb.AgroupId
-			// c.Gtb.MemberBuyerId = gtb.MemberBuyerId
-			// c.Gtb.MemberCompanyId = gtb.MemberCompanyId
-			// c.Gtb.CompanySort = gtb.CompanySort
-			// c.Gtb.SalesQtyPoint = gtb.SalesQtyPoint
-			// c.Gtb.SalesPrcPoint = gtb.SalesPrcPoint
-			// c.Gtb.SalesAmtPoint = gtb.SalesAmtPoint
-			// c.Gtb.SalesAmtPoint = gtb.SalesAmtPoint
-			// c.Gtb.PurchPrcPoint = gtb.PurchPrcPoint
-			// c.Gtb.PurchAmtPoint = gtb.PurchAmtPoint
-			// c.Gtb.StockQtyPoint = gtb.StockQtyPoint
-			// c.Gtb.StockPrcPoint = gtb.StockPrcPoint
-			// c.Gtb.StockAmtPoint = gtb.StockAmtPoint
-			// c.Gtb.AccAmtPoint = gtb.AccAmtPoint
 		} else {
 			return 505, e.LogStr("QWFAEC1AFVDS", "AfterBase64Content Format mismatch: "+c.GateToken)
 		}
@@ -91,82 +59,7 @@ func (c *Controller) Init() (int, string) {
 	return 200, ""
 }
 
-// func (c *Controller) GetYDB() (int, string) {
-
-// 	gtb := &struct {
-// 		GateTokenBase
-// 	}{}
-
-// 	var gtbStr string
-// 	var err error
-// 	if XConfig["IsYDBFixed"] == "Yes" {
-
-// 		data, err := ioutil.ReadFile("models/custom.yml")
-// 		if err != nil {
-// 			return 507, e.LogStr("ASDFQEWFA", "Can NOT Read custom.yml")
-// 		}
-
-// 		var config Config
-// 		if err := yaml.Unmarshal(data, &config); err == nil {
-// 			c.Gtb = config.Source
-// 			c.Gtb.ConnString = config.Source.ConnStr // custom.yml의 Variable name 이 서로 달라서 복사해줌.
-// 		} else {
-// 			return 507, e.LogStr("ASDWEWFA", "connString in custom.yml format mismatch ")
-// 		}
-
-// 	} else {
-// 		if gtbStr, err = MdbView(c.GateToken); err != nil {
-// 			// if c.ConnString, err = MdbView(c.GateToken); err != nil {
-// 			return 505, e.LogStr("QWFAECAFVD", "GateToken Not Found: "+c.GateToken)
-// 		}
-
-// 		if err := json.Unmarshal([]byte(gtbStr), gtb); err == nil {
-// 			c.Gtb.ConnString = gtb.ConnString
-// 			c.Gtb.RemoteIp = gtb.RemoteIp
-// 			c.Gtb.DeviceDesc = gtb.DeviceDesc
-// 			c.Gtb.FrontIp = gtb.FrontIp
-// 			c.Gtb.FrontHost = gtb.FrontHost
-// 			c.Gtb.Referer = gtb.Referer
-// 			c.Gtb.SsoSubId = gtb.SsoSubId
-// 			c.Gtb.UserId = gtb.UserId
-// 			c.Gtb.UserPermId = gtb.UserPermId
-// 			c.Gtb.MemberId = gtb.MemberId
-// 			c.Gtb.MemberPermId = gtb.MemberPermId
-// 			c.Gtb.SgroupId = gtb.SgroupId
-// 			c.Gtb.BranchId = gtb.BranchId
-// 			c.Gtb.StorageId = gtb.StorageId
-// 			c.Gtb.AgroupId = gtb.AgroupId
-// 			c.Gtb.MemberBuyerId = gtb.MemberBuyerId
-// 			c.Gtb.MemberCompanyId = gtb.MemberCompanyId
-// 			c.Gtb.CompanySort = gtb.CompanySort
-// 			c.Gtb.SalesQtyPoint = gtb.SalesQtyPoint
-// 			c.Gtb.SalesPrcPoint = gtb.SalesPrcPoint
-// 			c.Gtb.SalesAmtPoint = gtb.SalesAmtPoint
-// 			c.Gtb.SalesAmtPoint = gtb.SalesAmtPoint
-// 			c.Gtb.PurchPrcPoint = gtb.PurchPrcPoint
-// 			c.Gtb.PurchAmtPoint = gtb.PurchAmtPoint
-// 			c.Gtb.StockQtyPoint = gtb.StockQtyPoint
-// 			c.Gtb.StockPrcPoint = gtb.StockPrcPoint
-// 			c.Gtb.StockAmtPoint = gtb.StockAmtPoint
-// 			c.Gtb.AccAmtPoint = gtb.AccAmtPoint
-// 		} else {
-// 			return 505, e.LogStr("QWFAEC1AFVDS", "AfterBase64Content Format mismatch: "+c.GateToken)
-// 		}
-// 	}
-
-// 	if c.Db, err = xorm.NewEngine(XConfig["DbType"], c.Gtb.ConnString); err != nil {
-// 		return 600, e.LogStr("ADASEF", "DBEngine Open Error")
-// 	}
-
-// 	if status, msg := c.AttachDB(); status != 200 { // DB 까지 붙여야 memory error 가 안난다.
-// 		return status, e.LogStr("PBUYJM-", msg)
-// 	}
-// 	return 200, ""
-
-// }
-
 type Config struct {
-	// GateTokenDev string `yaml:"gate_token_dev"`
 	Source GateTokenBase
 }
 
@@ -176,27 +69,6 @@ type Target struct {
 	OutputDir string `yaml:"output_dir"`
 }
 
-// func (c *Controller) CustomYmlToGateTokenBaseAndDbGet() (int, string) {
-// 	data, err := ioutil.ReadFile("models/custom.yml")
-// 	if err != nil {
-// 		return 507, e.LogStr("ASDFQEWFA", "Can NOT Read custom.yml")
-// 	}
-
-// 	var config Config
-// 	if err := yaml.Unmarshal(data, &config); err == nil {
-// 		c.Gtb = config.Source
-// 		c.Gtb.ConnString = config.Source.ConnStr // custom.yml의 Variable name 이 서로 달라서 복사해줌.
-// 	} else {
-// 		return 507, e.LogStr("ASDWEWFA", "connString in custom.yml format mismatch ")
-// 	}
-
-// 	if status, msg := c.AttachDB(); status != 200 { // DB 까지 붙여야 memory error 가 안난다.
-// 		return status, e.LogStr("PBUYJM-", msg)
-// 	}
-
-// 	return 200, ""
-// }
-
 func (c *Controller) AttachDB() (int, string) {
 
 	var err error