@@ -583,16 +583,7 @@ public DomainResponse createDomainResponse(Domain domain) {
583583 if (domain .getChildCount () > 0 ) {
584584 domainResponse .setHasChild (true );
585585 }
586- List <ResourceTagJoinVO > tags = ApiDBUtils .listResourceTagViewByResourceUUID (domain .getUuid (),
587- ResourceTag .ResourceObjectType .Domain );
588- if (CollectionUtils .isNotEmpty (tags )) {
589- Set <ResourceTagResponse > tagResponses = new HashSet <>();
590- for (ResourceTagJoinVO tag : tags ) {
591- ResourceTagResponse tagResponse = ApiDBUtils .newResourceTagResponse (tag , true );
592- tagResponses .add (tagResponse );
593- }
594- domainResponse .setTags (tagResponses );
595- }
586+ populateDomainTags (domain .getUuid (), domainResponse );
596587 domainResponse .setObjectName ("domain" );
597588 return domainResponse ;
598589 }
@@ -3055,6 +3046,20 @@ public static void populateOwner(ControlledViewEntityResponse response, Controll
30553046 response .setDomainPath (getPrettyDomainPath (object .getDomainPath ()));
30563047 }
30573048
3049+ public static void populateDomainTags (String domainUuid , DomainResponse domainResponse ) {
3050+ List <ResourceTagJoinVO > tags = ApiDBUtils .listResourceTagViewByResourceUUID (domainUuid ,
3051+ ResourceTag .ResourceObjectType .Domain );
3052+ if (CollectionUtils .isEmpty (tags )) {
3053+ return ;
3054+ }
3055+ Set <ResourceTagResponse > tagResponses = new HashSet <>();
3056+ for (ResourceTagJoinVO tag : tags ) {
3057+ ResourceTagResponse tagResponse = ApiDBUtils .newResourceTagResponse (tag , true );
3058+ tagResponses .add (tagResponse );
3059+ }
3060+ domainResponse .setTags (tagResponses );
3061+ }
3062+
30583063 private void populateAccount (ControlledEntityResponse response , long accountId ) {
30593064 Account account = ApiDBUtils .findAccountById (accountId );
30603065 if (account == null ) {
0 commit comments