gateway.go 1.1 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
)

Y
Your Name 已提交
8
//GetGatewayConfig 获取网关配置
E
eoLinker API Management 已提交
9 10 11 12
func GetGatewayConfig() (map[string]interface{}, error) {
	return console_mysql.GetGatewayConfig()
}

Y
Your Name 已提交
13
//EditGatewayBaseConfig 编辑网关基本配置
E
eoLinker API Management 已提交
14 15 16 17 18 19 20 21 22
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
}

Y
Your Name 已提交
23
//EditGatewayAlarmConfig 编辑网关告警配置
E
eoLinker API Management 已提交
24 25 26 27 28 29 30 31
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
}