moonming commented on a change in pull request #280:
URL:
https://github.com/apache/incubator-apisix-dashboard/pull/280#discussion_r445292690
##########
File path: api/route/upstream.go
##########
@@ -0,0 +1,205 @@
+package route
+
+import (
+ "encoding/json"
+ "fmt"
+ "github.com/apisix/manager-api/conf"
+ "github.com/apisix/manager-api/errno"
+ "github.com/apisix/manager-api/service"
+ "github.com/gin-gonic/gin"
+ "github.com/satori/go.uuid"
+ "net/http"
+ "strconv"
+)
+
+func AppendUpstream(r *gin.Engine) *gin.Engine {
+ r.POST("/apisix/admin/upstreams", createUpstream)
+ r.GET("/apisix/admin/upstreams/:uid", findUpstream)
+ r.GET("/apisix/admin/upstreams", listUpstream)
+ r.PUT("/apisix/admin/upstreams/:uid", updateUpstream)
+ r.DELETE("/apisix/admin/upstreams/:uid", deleteUpstream)
+ return r
+}
+
+func createUpstream(c *gin.Context) {
+ u4 := uuid.NewV4()
+ uid := u4.String()
+ // todo 参数校验
Review comment:
English only please
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]