update.go 543 字节
Newer Older
E
eoLinker API Management 已提交
1 2 3 4
package handler

import (
	"encoding/json"
Y
Your Name 已提交
5
	v "github.com/eolinker/goku-api-gateway/common/version"
黄孟柱 已提交
6
	"github.com/eolinker/goku-api-gateway/goku-node/manager/updater"
E
eoLinker API Management 已提交
7 8 9
	"net/http"
)

Y
Your Name 已提交
10
func gokuUpdate(w http.ResponseWriter, r *http.Request) {
E
eoLinker API Management 已提交
11 12 13 14 15 16
	updater.Update()
}
func gokuCheckUpdate(w http.ResponseWriter, r *http.Request) {
	resultInfo := map[string]interface{}{
		"type":       "update",
		"statusCode": "000000",
Y
Your Name 已提交
17
		"version":    v.Version,
E
eoLinker API Management 已提交
18 19 20 21 22 23
	}
	resultStr, _ := json.Marshal(resultInfo)

	w.WriteHeader(200)
	_, _ = w.Write(resultStr)
	return
Y
Your Name 已提交
24
}