Commit 07037c98 authored by gaoshiyao's avatar gaoshiyao

更新路由设置

parent c9355592
{ {
"uuid": "sdfasd",
"url":"https://apaas.wodcloud.com/cigservice/baseservice/fillder/turnover?applyId=0419f3e1-8e16-4e5e-a187-1760364c04e2", "url":"https://apaas.wodcloud.com/cigservice/baseservice/fillder/turnover?applyId=0419f3e1-8e16-4e5e-a187-1760364c04e2",
"method":"GET", "method":"GET",
"params":null "params":null
......
...@@ -7,6 +7,7 @@ var ( ...@@ -7,6 +7,7 @@ var (
) )
var ProxyConf = struct { var ProxyConf = struct {
UUID string `json:"uuid"`
Url string `json:"url"` Url string `json:"url"`
Method string `json:"method"` Method string `json:"method"`
Params []Param `json:"params"` Params []Param `json:"params"`
......
package handler package handler
import ( import (
"fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/client"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/config"
) )
func GetCount(c *gin.Context) { func GetCount(c *gin.Context) {
//redis, err := client.GetRedisClient() redis, err := client.GetRedisClient()
//if err != nil { if err != nil {
// c.Error(err) c.Error(err)
//} }
//ic, err := redis.Get(fmt.Sprintf("%s%s", config.ProxyHost, config.ProxyPath)) ic, err := redis.Get("bgproxy" + config.ProxyConf.UUID)
//c.JSON(200, gin.H{ c.JSON(200, gin.H{
// "Key": fmt.Sprintf("%s%s", config.ProxyHost, config.ProxyPath), "Key": fmt.Sprintf("bgproxy" + config.ProxyConf.UUID),
// "Count": ic, "Count": ic,
//}) })
} }
...@@ -4,6 +4,7 @@ import ( ...@@ -4,6 +4,7 @@ import (
"fmt" "fmt"
"github.com/gin-gonic/gin" "github.com/gin-gonic/gin"
"github.com/sirupsen/logrus" "github.com/sirupsen/logrus"
"gitlab.wodcloud.com/apaas/apaas-meshproxy/src/client"
"net/http" "net/http"
"github.com/vulcand/oxy/forward" "github.com/vulcand/oxy/forward"
...@@ -71,12 +72,11 @@ func getRequestURI(req *http.Request) string { ...@@ -71,12 +72,11 @@ func getRequestURI(req *http.Request) string {
计数 计数
*/ */
func count() error { func count() error {
//redis, err := client.GetRedisClient() redis, err := client.GetRedisClient()
//if err != nil { if err != nil {
// return err return err
//} }
//ic, err := redis.Incr(fmt.Sprintf("%s%s", config.ProxyHost, config.ProxyPath)) ic, err := redis.Incr("bgproxy" + config.ProxyConf.UUID)
//_, err = ic.Result() _, err = ic.Result()
//return err return err
return nil
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment