default value when lookup internal ip
This commit is contained in:
@@ -12,8 +12,11 @@ func HandleJson(c *gin.Context) {
|
|||||||
ipData, _, err := data.Ins().Query(ip)
|
ipData, _, err := data.Ins().Query(ip)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Err(err).Msg("Failed to query IP")
|
log.Err(err).Msg("Failed to query IP")
|
||||||
c.String(http.StatusInternalServerError, "")
|
c.JSON(http.StatusOK, gin.H{
|
||||||
|
"ip": ip,
|
||||||
|
})
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ipData["ip"] = ip
|
||||||
c.JSON(http.StatusOK, ipData)
|
c.JSON(http.StatusOK, ipData)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user