(ctx *gin.Context)
| 14 | ) |
| 15 | |
| 16 | func AddLinkHandler(ctx *gin.Context) { |
| 17 | var req ginmodel.AddLinkRequest |
| 18 | if err := ctx.Bind(&req); err != nil { |
| 19 | jsonResp := ginmodel.JsonResp{ |
| 20 | Code: -1, |
| 21 | Message: fmt.Sprintf("Invalid Request Data: %s", err.Error()), |
| 22 | } |
| 23 | ctx.JSON(http.StatusBadRequest, jsonResp) |
| 24 | return |
| 25 | } |
| 26 | // err := synchronizer.AddLink(req.NodeIndex, req.Link) |
| 27 | // if err != nil { |
| 28 | // jsonResp := ginmodel.JsonResp{ |
| 29 | // Code: -1, |
| 30 | // Message: fmt.Sprintf("Add Link Error: %s", err.Error()), |
| 31 | // } |
| 32 | // ctx.JSON(http.StatusInternalServerError, jsonResp) |
| 33 | // return |
| 34 | // } |
| 35 | jsonResp := ginmodel.JsonResp{ |
| 36 | Code: 0, |
| 37 | Message: "Success", |
| 38 | } |
| 39 | ctx.JSON(http.StatusOK, jsonResp) |
| 40 | } |
| 41 | |
| 42 | func DelLinkHandler(ctx *gin.Context) { |
| 43 | linkID := ctx.Param("link_id") |
nothing calls this directly
no outgoing calls
no test coverage detected