mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-08-05 07:10:29 +08:00
fix: agent log return zero total number (#17766)
### Summary As title --------- Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
This commit is contained in:
@@ -28,6 +28,7 @@ type response struct {
|
||||
Code ErrorCode `json:"code"`
|
||||
Data interface{} `json:"data"`
|
||||
Message interface{} `json:"message"`
|
||||
Total interface{} `json:"total,omitempty"`
|
||||
}
|
||||
|
||||
// errorResponse error response
|
||||
@@ -45,6 +46,16 @@ func SuccessWithData(c *gin.Context, data interface{}, message interface{}) {
|
||||
})
|
||||
}
|
||||
|
||||
// SuccessWithDataAndTotal returns success response with data and total number
|
||||
func SuccessWithDataAndTotal(c *gin.Context, data, total, message interface{}) {
|
||||
c.JSON(http.StatusOK, response{
|
||||
Code: CodeSuccess,
|
||||
Data: data,
|
||||
Total: total,
|
||||
Message: message,
|
||||
})
|
||||
}
|
||||
|
||||
// SuccessNoMessage returns success response without message
|
||||
func SuccessNoMessage(c *gin.Context, data interface{}) {
|
||||
c.JSON(http.StatusOK, response{
|
||||
|
||||
Reference in New Issue
Block a user