[performance] http response encoding / writing improvements (#2374)

This commit is contained in:
kim 2023-11-27 14:00:57 +00:00 committed by GitHub
commit 74700cc803
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
104 changed files with 526 additions and 267 deletions

View file

@ -174,5 +174,6 @@ func (m *Module) ListAccountsGETHandler(c *gin.Context) {
if resp.LinkHeader != "" {
c.Header("Link", resp.LinkHeader)
}
c.JSON(http.StatusOK, resp.Items)
apiutil.JSON(c, http.StatusOK, resp.Items)
}

View file

@ -116,5 +116,5 @@ func (m *Module) ListAccountsPOSTHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{})
apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONObject)
}

View file

@ -126,5 +126,5 @@ func (m *Module) ListAccountsDELETEHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{})
apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONObject)
}

View file

@ -102,5 +102,5 @@ func (m *Module) ListCreatePOSTHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, apiList)
apiutil.JSON(c, http.StatusOK, apiList)
}

View file

@ -87,5 +87,5 @@ func (m *Module) ListDELETEHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, gin.H{})
apiutil.Data(c, http.StatusOK, apiutil.AppJSON, apiutil.EmptyJSONObject)
}

View file

@ -91,5 +91,5 @@ func (m *Module) ListGETHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, resp)
apiutil.JSON(c, http.StatusOK, resp)
}

View file

@ -77,5 +77,5 @@ func (m *Module) ListsGETHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, lists)
apiutil.JSON(c, http.StatusOK, lists)
}

View file

@ -148,5 +148,5 @@ func (m *Module) ListUpdatePUTHandler(c *gin.Context) {
return
}
c.JSON(http.StatusOK, apiList)
apiutil.JSON(c, http.StatusOK, apiList)
}