in cmd/controller/workflow.go [80:97]
func (c *WorkflowController) QueryList(ctx *gin.Context) {
request := QueryWorkflowsRequest{}
if err := ctx.ShouldBind(&request); err != nil {
ctx.JSON(http.StatusBadRequest, err.Error())
return
}
res, total, err := c.workflowDAL.SelectList(ctx, &model.QueryParam{
WorkflowID: request.WorkflowID,
Status: request.Status,
Page: request.Page,
Size: request.Size,
})
if err != nil {
ctx.JSON(http.StatusInternalServerError, err.Error())
return
}
ctx.JSON(http.StatusOK, &QueryWorkflowsResponse{Total: total, Workflows: res})
}