(c *gin.Context)
| 17 | } |
| 18 | |
| 19 | func (h *HttpTestHandler) Do(c *gin.Context) { |
| 20 | var req service.HttpTestReq |
| 21 | if err := c.ShouldBindJSON(&req); err != nil { |
| 22 | c.JSON(http.StatusBadRequest, gin.H{ |
| 23 | "error": "invalid request: " + err.Error(), |
| 24 | }) |
| 25 | return |
| 26 | } |
| 27 | |
| 28 | resp, err := h.svc.Do(&req) |
| 29 | if err != nil { |
| 30 | c.JSON(http.StatusBadRequest, gin.H{ |
| 31 | "error": err.Error(), |
| 32 | }) |
| 33 | return |
| 34 | } |
| 35 | |
| 36 | c.JSON(http.StatusOK, resp) |
| 37 | } |
nothing calls this directly
no outgoing calls
no test coverage detected