gateway.go 1.0 KB
Newer Older
E
eoLinker API Management 已提交
1 2 3
package gateway

import (
黄孟柱 已提交
4 5
	"github.com/eolinker/goku-api-gateway/server/dao"
	console_mysql "github.com/eolinker/goku-api-gateway/server/dao/console-mysql"
E
eoLinker API Management 已提交
6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30
)

func GetGatewayConfig() (map[string]interface{}, error) {
	return console_mysql.GetGatewayConfig()
}

// 编辑网关基本配置
func EditGatewayBaseConfig(successCode string, nodeUpdatePeriod, monitorUpdatePeriod, timeout int) (bool, string, error) {
	tableName := "goku_gateway"
	flag, result, err := console_mysql.EditGatewayBaseConfig(successCode, nodeUpdatePeriod, monitorUpdatePeriod, timeout)
	if flag {
		dao.UpdateTable(tableName)
	}
	return flag, result, err
}

// 编辑网关告警配置
func EditGatewayAlarmConfig(apiAlertInfo, sender, senderPassword, smtpAddress string, alertStatus, smtpPort, smtpProtocol int) (bool, string, error) {
	tableName := "goku_gateway"
	flag, result, err := console_mysql.EditGatewayAlarmConfig(apiAlertInfo, sender, senderPassword, smtpAddress, alertStatus, smtpPort, smtpProtocol)
	if flag {
		dao.UpdateTable(tableName)
	}
	return flag, result, err
}