Skip to content

Commit

Permalink
codestyle
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinw66 committed Feb 19, 2025
1 parent e507927 commit 9a2edef
Show file tree
Hide file tree
Showing 9 changed files with 22 additions and 28 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@
*/
package org.apache.bigtop.manager.server.command.validator;

import jakarta.annotation.Resource;
import org.apache.bigtop.manager.common.enums.Command;
import org.apache.bigtop.manager.dao.po.ServicePO;
import org.apache.bigtop.manager.dao.repository.ServiceDao;
import org.apache.bigtop.manager.server.command.CommandIdentifier;
import org.apache.bigtop.manager.server.enums.ApiExceptionEnum;
import org.apache.bigtop.manager.server.enums.CommandLevel;
import org.apache.bigtop.manager.server.exception.ApiException;

import org.apache.commons.collections4.CollectionUtils;

import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;
import java.util.List;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,20 +18,19 @@
*/
package org.apache.bigtop.manager.server.command.validator;

import jakarta.annotation.Resource;
import org.apache.bigtop.manager.common.enums.Command;
import org.apache.bigtop.manager.dao.po.ClusterPO;
import org.apache.bigtop.manager.dao.po.ServicePO;
import org.apache.bigtop.manager.dao.repository.ClusterDao;
import org.apache.bigtop.manager.dao.repository.ServiceDao;
import org.apache.bigtop.manager.server.command.CommandIdentifier;
import org.apache.bigtop.manager.server.enums.ApiExceptionEnum;
import org.apache.bigtop.manager.server.enums.CommandLevel;
import org.apache.bigtop.manager.server.exception.ApiException;
import org.apache.bigtop.manager.server.model.dto.command.ClusterCommandDTO;

import org.apache.commons.collections4.CollectionUtils;

import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;
import java.util.List;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,19 @@
*/
package org.apache.bigtop.manager.server.command.validator;

import jakarta.annotation.Resource;
import org.apache.bigtop.manager.common.enums.Command;
import org.apache.bigtop.manager.dao.po.ServicePO;
import org.apache.bigtop.manager.dao.repository.ServiceDao;
import org.apache.bigtop.manager.server.command.CommandIdentifier;
import org.apache.bigtop.manager.server.enums.ApiExceptionEnum;
import org.apache.bigtop.manager.server.enums.CommandLevel;
import org.apache.bigtop.manager.server.exception.ApiException;

import org.apache.commons.collections4.CollectionUtils;

import org.springframework.stereotype.Component;

import jakarta.annotation.Resource;
import java.util.List;

@Component
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -74,14 +74,14 @@ public ResponseEntity<PageVO<ServiceVO>> list(ServiceQuery query) {
}

@Parameters({
@Parameter(in = ParameterIn.QUERY, name = "pageNum", schema = @Schema(type = "integer", defaultValue = "1")),
@Parameter(in = ParameterIn.QUERY, name = "pageSize", schema = @Schema(type = "integer", defaultValue = "10")),
@Parameter(in = ParameterIn.QUERY, name = "orderBy", schema = @Schema(type = "string", defaultValue = "id")),
@Parameter(
in = ParameterIn.QUERY,
name = "sort",
description = "asc/desc",
schema = @Schema(type = "string", defaultValue = "asc"))
@Parameter(in = ParameterIn.QUERY, name = "pageNum", schema = @Schema(type = "integer", defaultValue = "1")),
@Parameter(in = ParameterIn.QUERY, name = "pageSize", schema = @Schema(type = "integer", defaultValue = "10")),
@Parameter(in = ParameterIn.QUERY, name = "orderBy", schema = @Schema(type = "string", defaultValue = "id")),
@Parameter(
in = ParameterIn.QUERY,
name = "sort",
description = "asc/desc",
schema = @Schema(type = "string", defaultValue = "asc"))
})
@Operation(summary = "service user list", description = "List service users")
@GetMapping("/users")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@
*/
package org.apache.bigtop.manager.server.controller;

import org.apache.bigtop.manager.server.model.vo.ClusterVO;
import org.apache.bigtop.manager.server.model.vo.ServiceClusterVO;
import org.apache.bigtop.manager.server.model.vo.StackVO;
import org.apache.bigtop.manager.server.service.StackService;
import org.apache.bigtop.manager.server.utils.ResponseEntity;

import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,6 @@

import lombok.Data;

import java.util.List;

@Data
public class ServiceUserVO {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
*/
package org.apache.bigtop.manager.server.service;

import org.apache.bigtop.manager.server.model.vo.ClusterVO;
import org.apache.bigtop.manager.server.model.vo.ServiceClusterVO;
import org.apache.bigtop.manager.server.model.vo.StackVO;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@

import org.apache.commons.collections4.CollectionUtils;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.Page;
Expand All @@ -61,7 +60,6 @@
import lombok.extern.slf4j.Slf4j;

import jakarta.annotation.Resource;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
Expand Down Expand Up @@ -103,7 +101,7 @@ public PageVO<ServiceVO> list(ServiceQuery query) {
public PageVO<ServiceUserVO> serviceUsers(Long clusterId) {
PageQuery pageQuery = PageUtils.getPageQuery();
try (Page<?> ignored =
PageHelper.startPage(pageQuery.getPageNum(), pageQuery.getPageSize(), pageQuery.getOrderBy())) {
PageHelper.startPage(pageQuery.getPageNum(), pageQuery.getPageSize(), pageQuery.getOrderBy())) {
ServiceQuery query = ServiceQuery.builder().clusterId(clusterId).build();
List<ServicePO> servicePOList = serviceDao.findByQuery(query);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@
*/
package org.apache.bigtop.manager.server.service.impl;

import org.apache.bigtop.manager.dao.po.ClusterPO;
import org.apache.bigtop.manager.dao.po.ServicePO;
import org.apache.bigtop.manager.dao.query.ServiceQuery;
import org.apache.bigtop.manager.dao.repository.ClusterDao;
import org.apache.bigtop.manager.dao.repository.ServiceDao;
import org.apache.bigtop.manager.server.model.converter.ClusterConverter;
Expand All @@ -35,6 +33,7 @@
import org.apache.bigtop.manager.server.utils.StackUtils;

import org.apache.commons.collections4.CollectionUtils;

import org.springframework.stereotype.Service;

import lombok.extern.slf4j.Slf4j;
Expand Down Expand Up @@ -82,10 +81,9 @@ public List<ServiceClusterVO> serviceClusters() {
Map<Long, ClusterVO> clusterVOMap = ClusterConverter.INSTANCE.fromPO2VO(clusterDao.findAll()).stream()
.collect(Collectors.toMap(ClusterVO::getId, Function.identity()));
// Name - ServicePO map
Map<String, List<ServicePO>> servicePONameMap = serviceDao.findAll().stream()
.collect(Collectors.groupingBy(ServicePO::getName));
List<ServiceDTO> serviceDTOList = StackUtils.getAllStacks()
.stream()
Map<String, List<ServicePO>> servicePONameMap =
serviceDao.findAll().stream().collect(Collectors.groupingBy(ServicePO::getName));
List<ServiceDTO> serviceDTOList = StackUtils.getAllStacks().stream()
.map(StackUtils::getServiceDTOList)
.flatMap(List::stream)
.toList();
Expand Down

0 comments on commit 9a2edef

Please sign in to comment.