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

This commit is contained in:
kim
2023-11-27 14:00:57 +00:00
committed by GitHub
parent d7e35f6bc9
commit 74700cc803
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)
}