@@ -42,9 +42,9 @@ func GetApplicationDetail(ctx consolectx.Context, req *model.ApplicationDetailRe
4242 instanceResources , err := manager .ListByIndexes [* meshresource.InstanceResource ](
4343 ctx .ResourceManager (),
4444 meshresource .InstanceKind ,
45- map [ string ] string {
46- index .ByMeshIndex : req .Mesh ,
47- index .ByInstanceAppNameIndex : req .AppName ,
45+ []index. IndexCondition {
46+ { IndexName : index .ByMeshIndex , Value : req .Mesh , Operator : index . Equals } ,
47+ { IndexName : index .ByInstanceAppNameIndex , Value : req .AppName , Operator : index . Equals } ,
4848 },
4949 )
5050 if err != nil {
@@ -68,9 +68,9 @@ func GetAppInstanceInfo(ctx consolectx.Context, req *model.ApplicationTabInstanc
6868 pageData , err := manager .PageListByIndexes [* meshresource.InstanceResource ](
6969 ctx .ResourceManager (),
7070 meshresource .InstanceKind ,
71- map [ string ] string {
72- index .ByMeshIndex : req .Mesh ,
73- index .ByInstanceAppNameIndex : req .AppName ,
71+ []index. IndexCondition {
72+ { IndexName : index .ByMeshIndex , Value : req .Mesh , Operator : index . Equals } ,
73+ { IndexName : index .ByInstanceAppNameIndex , Value : req .AppName , Operator : index . Equals } ,
7474 },
7575 req .PageReq ,
7676 )
@@ -120,23 +120,28 @@ func GetAppServiceInfo(ctx consolectx.Context, req *model.ApplicationServiceForm
120120}
121121
122122func getAppProvideServiceInfo (ctx consolectx.Context , req * model.ApplicationServiceFormReq ) (* model.SearchPaginationResult , error ) {
123- var indexes map [string ]string
123+ var conditions []index.IndexCondition
124+ conditions = append (conditions , index.IndexCondition {
125+ IndexName : index .ByMeshIndex ,
126+ Value : req .Mesh ,
127+ Operator : index .Equals ,
128+ })
129+ conditions = append (conditions , index.IndexCondition {
130+ IndexName : index .ByServiceProviderAppName ,
131+ Value : req .AppName ,
132+ Operator : index .Equals ,
133+ })
124134 if strutil .IsNotBlank (req .ServiceName ) {
125- indexes = map [string ]string {
126- index .ByMeshIndex : req .Mesh ,
127- index .ByServiceProviderAppName : req .AppName ,
128- index .ByServiceProviderServiceName : req .ServiceName ,
129- }
130- } else {
131- indexes = map [string ]string {
132- index .ByMeshIndex : req .Mesh ,
133- index .ByServiceProviderAppName : req .AppName ,
134- }
135+ conditions = append (conditions , index.IndexCondition {
136+ IndexName : index .ByServiceProviderServiceName ,
137+ Value : req .ServiceName ,
138+ Operator : index .Equals ,
139+ })
135140 }
136141 pageData , err := manager .PageListByIndexes [* meshresource.ServiceProviderMetadataResource ](
137142 ctx .ResourceManager (),
138143 meshresource .ServiceProviderMetadataKind ,
139- indexes ,
144+ conditions ,
140145 req .PageReq ,
141146 )
142147 if err != nil {
@@ -167,9 +172,9 @@ func getAppConsumeServiceInfo(ctx consolectx.Context, req *model.ApplicationServ
167172 pageData , err := manager .PageListByIndexes [* meshresource.ServiceConsumerMetadataResource ](
168173 ctx .ResourceManager (),
169174 meshresource .ServiceConsumerMetadataKind ,
170- map [ string ] string {
171- index .ByMeshIndex : req .Mesh ,
172- index .ByServiceConsumerAppName : req .AppName ,
175+ []index. IndexCondition {
176+ { IndexName : index .ByMeshIndex , Value : req .Mesh , Operator : index . Equals } ,
177+ { IndexName : index .ByServiceConsumerAppName , Value : req .AppName , Operator : index . Equals } ,
173178 },
174179 req .PageReq ,
175180 )
@@ -220,8 +225,8 @@ func SearchApplications(ctx consolectx.Context, req *model.ApplicationSearchReq)
220225 pageData , err := manager .PageListByIndexes [* meshresource.ApplicationResource ](
221226 ctx .ResourceManager (),
222227 meshresource .ApplicationKind ,
223- map [ string ] string {
224- index .ByMeshIndex : req .Mesh ,
228+ []index. IndexCondition {
229+ { IndexName : index .ByMeshIndex , Value : req .Mesh , Operator : index . Equals } ,
225230 },
226231 req .PageReq ,
227232 )
0 commit comments