(ctx *gin.Context)
| 233 | } |
| 234 | |
| 235 | func GetLinkParameterHandler(ctx *gin.Context) { |
| 236 | nodeIndexStr := ctx.Param("node_index") |
| 237 | linkID := ctx.Param("link_id") |
| 238 | nodeIndex, err := strconv.Atoi(nodeIndexStr) |
| 239 | if err != nil { |
| 240 | jsonResp := ginmodel.JsonResp{ |
| 241 | Code: -1, |
| 242 | Message: fmt.Sprintf("Invalid Node Index: %s", err.Error()), |
| 243 | } |
| 244 | ctx.JSON(http.StatusBadRequest, jsonResp) |
| 245 | return |
| 246 | } |
| 247 | parameter, err := synchronizer.GetLinkParameter(nodeIndex, linkID) |
| 248 | if err != nil { |
| 249 | jsonResp := ginmodel.JsonResp{ |
| 250 | Code: -1, |
| 251 | Message: fmt.Sprintf("Get Link Parameter of %s Error: %s", linkID, err.Error()), |
| 252 | } |
| 253 | ctx.JSON(http.StatusInternalServerError, jsonResp) |
| 254 | return |
| 255 | } |
| 256 | respData := parameter |
| 257 | jsonResp := ginmodel.JsonResp{ |
| 258 | Code: 0, |
| 259 | Message: "Success", |
| 260 | Data: respData, |
| 261 | } |
| 262 | ctx.JSON(http.StatusOK, jsonResp) |
| 263 | } |
| 264 | |
| 265 | func UpdateLinkParameterHandler(ctx *gin.Context) { |
| 266 | nodeIndexStr := ctx.Param("node_index") |
nothing calls this directly
no outgoing calls
no test coverage detected