Skip to content

Commit

Permalink
Merge pull request #1771 from actiontech/issue-1768
Browse files Browse the repository at this point in the history
Issue 1768
  • Loading branch information
taolx0 authored Aug 30, 2023
2 parents ffae2c9 + 3a54cb8 commit 99c5d62
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 0 deletions.
4 changes: 4 additions & 0 deletions sqle/api/controller/v1/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -686,6 +686,7 @@ func CheckWorkflowCanCommit(template *model.WorkflowTemplate, tasks []*model.Tas
type GetWorkflowsReqV1 struct {
FilterSubject string `json:"filter_subject" query:"filter_subject"`
FilterWorkflowID string `json:"filter_workflow_id" query:"filter_workflow_id"`
FuzzySearchWorkflowDesc string `json:"fuzzy_search_workflow_desc" query:"fuzzy_search_workflow_desc"`
FilterCreateTimeFrom string `json:"filter_create_time_from" query:"filter_create_time_from"`
FilterCreateTimeTo string `json:"filter_create_time_to" query:"filter_create_time_to"`
FilterCreateUserName string `json:"filter_create_user_name" query:"filter_create_user_name"`
Expand Down Expand Up @@ -852,6 +853,7 @@ func GetWorkflowsV1(c echo.Context) error {

data := map[string]interface{}{
"filter_workflow_id": req.FilterWorkflowID,
"fuzzy_search_workflow_desc": req.FuzzySearchWorkflowDesc,
"filter_subject": req.FilterSubject,
"filter_create_time_from": req.FilterCreateTimeFrom,
"filter_create_time_to": req.FilterCreateTimeTo,
Expand Down Expand Up @@ -999,6 +1001,7 @@ func GetWorkflowV1(c echo.Context) error {

type ExportWorkflowReqV1 struct {
FilterSubject string `json:"filter_subject" query:"filter_subject"`
FuzzySearchWorkflowDesc string `json:"fuzzy_search_workflow_desc" query:"fuzzy_search_workflow_desc"`
FilterCreateTimeFrom string `json:"filter_create_time_from" query:"filter_create_time_from"`
FilterCreateTimeTo string `json:"filter_create_time_to" query:"filter_create_time_to"`
FilterCreateUserName string `json:"filter_create_user_name" query:"filter_create_user_name"`
Expand All @@ -1016,6 +1019,7 @@ type ExportWorkflowReqV1 struct {
// @Tags workflow
// @Security ApiKeyAuth
// @Param filter_subject query string false "filter subject"
// @Param fuzzy_search_workflow_desc query string false "fuzzy search by workflow description"
// @Param filter_create_time_from query string false "filter create time from"
// @Param filter_create_time_to query string false "filter create time to"
// @Param filter_task_execute_start_time_from query string false "filter_task_execute_start_time_from"
Expand Down
6 changes: 6 additions & 0 deletions sqle/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -5090,6 +5090,12 @@ var doc = `{
"name": "filter_subject",
"in": "query"
},
{
"type": "string",
"description": "fuzzy search by workflow description",
"name": "fuzzy_search_workflow_desc",
"in": "query"
},
{
"type": "string",
"description": "filter create time from",
Expand Down
6 changes: 6 additions & 0 deletions sqle/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -5074,6 +5074,12 @@
"name": "filter_subject",
"in": "query"
},
{
"type": "string",
"description": "fuzzy search by workflow description",
"name": "fuzzy_search_workflow_desc",
"in": "query"
},
{
"type": "string",
"description": "filter create time from",
Expand Down
4 changes: 4 additions & 0 deletions sqle/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8271,6 +8271,10 @@ paths:
in: query
name: filter_subject
type: string
- description: fuzzy search by workflow description
in: query
name: fuzzy_search_workflow_desc
type: string
- description: filter create time from
in: query
name: filter_create_time_from
Expand Down
4 changes: 4 additions & 0 deletions sqle/model/workflow_list.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,10 @@ AND inst.name = :filter_task_instance_name
AND w.workflow_id = :filter_workflow_id
{{- end }}
{{- if .fuzzy_search_workflow_desc }}
AND w.desc LIKE '%{{ .fuzzy_search_workflow_desc }}%'
{{- end }}
{{- if .filter_project_name }}
AND p.name = :filter_project_name
{{- end }}
Expand Down

0 comments on commit 99c5d62

Please sign in to comment.