list.go 562 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3 4
package balance

import (
	"fmt"
黄孟柱 已提交
5 6
	"github.com/eolinker/goku-api-gateway/console/controller"
	"github.com/eolinker/goku-api-gateway/console/module/balance"
Y
Your Name 已提交
7
	"net/http"
E
eoLinker API Management 已提交
8 9
)

Y
Your Name 已提交
10
//GetBalanceList 获取负载列表
E
eoLinker API Management 已提交
11
func GetBalanceList(w http.ResponseWriter, r *http.Request) {
Y
Your Name 已提交
12

E
eoLinker API Management 已提交
13 14 15 16 17 18 19 20 21 22 23 24
	_ = r.ParseForm()

	keyword := r.FormValue("keyword")
	result, err := balance.Search(keyword)
	if err != nil {
		controller.WriteError(w, "260000", "balance", fmt.Sprintf("[ERROR] %s", err.Error()), err)
		return
	}
	controller.WriteResultInfo(w, "balance", "balanceList", result)

	return
}