@@ -45,18 +45,18 @@ func NewAppListingRepositoryQueryBuilder(logger *zap.SugaredLogger) AppListingRe
4545}
4646
4747type AppListingFilter struct {
48- Environments []int `json:"environments"`
49- Statuses []string `json:"statutes"`
50- Teams []int `json:"teams"`
51- AppStatuses []string `json:"appStatuses"`
48+ Environments []int `json:"environments"`
49+ Statuses []string `json:"statutes"`
50+ Teams []int `json:"teams"`
51+ AppStatuses []string `json:"appStatuses"`
5252 TagFilters []TagFilter `json:"tagFilters"`
53- AppNameSearch string `json:"appNameSearch"`
54- SortOrder SortOrder `json:"sortOrder"`
55- SortBy SortBy `json:"sortBy"`
56- Offset int `json:"offset"`
57- Size int `json:"size"`
58- DeploymentGroupId int `json:"deploymentGroupId"`
59- AppIds []int `json:"-"` // internal use only
53+ AppNameSearch string `json:"appNameSearch"`
54+ SortOrder SortOrder `json:"sortOrder"`
55+ SortBy SortBy `json:"sortBy"`
56+ Offset int `json:"offset"`
57+ Size int `json:"size"`
58+ DeploymentGroupId int `json:"deploymentGroupId"`
59+ AppIds []int `json:"-"` // internal use only
6060}
6161
6262type SortBy string
@@ -317,11 +317,6 @@ func (impl AppListingRepositoryQueryBuilder) buildAppListingWhereCondition(appLi
317317 whereCondition += tagWhereCondition
318318 queryParams = append (queryParams , tagQueryParams ... )
319319
320- // Future OR support placeholder (intentionally disabled today):
321- // orTagWhereCondition, orTagQueryParams := impl.buildTagFiltersWhereConditionOR(appListingFilter.TagFilters)
322- // whereCondition += orTagWhereCondition
323- // queryParams = append(queryParams, orTagQueryParams...)
324-
325320 if len (appListingFilter .AppIds ) > 0 {
326321 whereCondition += " and a.id IN (?) "
327322 queryParams = append (queryParams , pg .In (appListingFilter .AppIds ))
@@ -344,22 +339,6 @@ func (impl AppListingRepositoryQueryBuilder) buildTagFiltersWhereConditionAND(ta
344339 return queryBuilder .String (), queryParams
345340}
346341
347- // buildTagFiltersWhereConditionOR is intentionally unused today.
348- // It is kept as documented dead code so switching to OR in future is straightforward.
349- func (impl AppListingRepositoryQueryBuilder ) buildTagFiltersWhereConditionOR (tagFilters []TagFilter ) (string , []interface {}) {
350- if len (tagFilters ) == 0 {
351- return "" , nil
352- }
353- clauses := make ([]string , 0 , len (tagFilters ))
354- queryParams := make ([]interface {}, 0 , len (tagFilters )* 2 )
355- for _ , tagFilter := range tagFilters {
356- predicate , predicateParams := impl .buildTagFilterPredicate (tagFilter )
357- clauses = append (clauses , predicate )
358- queryParams = append (queryParams , predicateParams ... )
359- }
360- return " and (" + strings .Join (clauses , " OR " ) + ") " , queryParams
361- }
362-
363342// buildTagFilterPredicate converts one UI tag filter row into a SQL predicate.
364343// Operator behavior (all case-sensitive):
365344// - EQUALS: key exists with exact value match.
0 commit comments