Skip to content

Commit

Permalink
improve streampark-console module base on [3.4 Collection Rule]
Browse files Browse the repository at this point in the history
  • Loading branch information
lihui committed Oct 7, 2023
1 parent fe98be8 commit 2f9abdd
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public static <T> RouterTree<T> buildRouterTree(List<RouterTree<T>> nodes) {
* @param <T> T
* @return ArrayList<VueRouter < T>>
*/
public static <T> ArrayList<VueRouter<T>> buildVueRouter(List<VueRouter<T>> routes) {
public static <T> List<VueRouter<T>> buildVueRouter(List<VueRouter<T>> routes) {
if (routes == null) {
return null;
}
Expand All @@ -110,7 +110,7 @@ public static <T> ArrayList<VueRouter<T>> buildVueRouter(List<VueRouter<T>> rout
}
});

ArrayList<VueRouter<T>> list = new ArrayList<>();
List<VueRouter<T>> list = new ArrayList<>();
VueRouter<T> root = new VueRouter<>();
root.setName("Root");
root.setComponent("BasicView");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;

@Data
Expand Down Expand Up @@ -65,7 +66,7 @@ public boolean equals(Dependency other) {
}
File localJar = WebUtils.getAppTempDir();
File localUploads = new File(Workspace.local().APP_UPLOADS());
HashSet<String> otherJars = new HashSet<>(other.jar);
Set<String> otherJars = new HashSet<>(other.jar);
for (String jarName : jar) {
if (!otherJars.contains(jarName)
|| !FileUtils.equals(new File(localJar, jarName), new File(localUploads, jarName))) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

@Slf4j
@Service
Expand Down Expand Up @@ -85,7 +86,7 @@ public List<ExternalLink> render(Long appId) {
}

private void renderLinkUrl(ExternalLink link, Application app) {
HashMap<String, String> map = new HashMap();
Map<String, String> map = new HashMap<>();
map.put(PlaceholderTypeEnum.JOB_ID.get(), app.getJobId());
map.put(PlaceholderTypeEnum.JOB_NAME.get(), app.getJobName());
map.put(PlaceholderTypeEnum.YARN_ID.get(), app.getAppId());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@

import javax.validation.Valid;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

@Tag(name = "MENU_TAG")
Expand All @@ -55,7 +55,7 @@ public class MenuController {
@PostMapping("router")
public RestResponse getUserRouters(Long teamId) {
// TODO The teamId is required, get routers should be called after choose teamId.
ArrayList<VueRouter<Menu>> routers =
List<VueRouter<Menu>> routers =
this.menuService.getUserRouters(commonService.getUserId(), teamId);
return RestResponse.success(routers);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@

import com.baomidou.mybatisplus.extension.service.IService;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

Expand Down Expand Up @@ -52,5 +51,5 @@ public interface MenuService extends IService<Menu> {
*/
void deleteMenus(String[] menuIds) throws Exception;

ArrayList<VueRouter<Menu>> getUserRouters(Long userId, Long teamId);
List<VueRouter<Menu>> getUserRouters(Long userId, Long teamId);
}
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ public void deleteMenus(String[] menuIds) throws Exception {
}

@Override
public ArrayList<VueRouter<Menu>> getUserRouters(Long userId, Long teamId) {
public List<VueRouter<Menu>> getUserRouters(Long userId, Long teamId) {
List<VueRouter<Menu>> routes = new ArrayList<>();
// The query type is the menu type
List<Menu> menus = this.findUserMenus(userId, teamId);
Expand Down

0 comments on commit 2f9abdd

Please sign in to comment.