Skip to content

Commit

Permalink
[ISSUE-3064][Improve] Improve streampark-console core package module …
Browse files Browse the repository at this point in the history
…service name base on [3.1 Naming Style] (#3295)
  • Loading branch information
VampireAchao authored Nov 1, 2023
1 parent 4dc5eb7 commit 57b9b78
Show file tree
Hide file tree
Showing 40 changed files with 108 additions and 106 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ public RestResponse update(Application app) {
@Operation(summary = "Get applications dashboard data")
@PostMapping("dashboard")
public RestResponse dashboard(Long teamId) {
Map<String, Serializable> map = applicationInfoService.dashboard(teamId);
Map<String, Serializable> map = applicationInfoService.getDashboardDataMap(teamId);
return RestResponse.success(map);
}

Expand Down Expand Up @@ -319,14 +319,14 @@ public RestResponse getMain(Application application) {
@Operation(summary = "List application backups")
@PostMapping("backups")
public RestResponse backups(ApplicationBackUp backUp, RestRequest request) {
IPage<ApplicationBackUp> backups = backUpService.page(backUp, request);
IPage<ApplicationBackUp> backups = backUpService.getPage(backUp, request);
return RestResponse.success(backups);
}

@Operation(summary = "List application operation logs")
@PostMapping("optionlog")
public RestResponse optionlog(ApplicationLog applicationLog, RestRequest request) {
IPage<ApplicationLog> applicationList = applicationLogService.page(applicationLog, request);
IPage<ApplicationLog> applicationList = applicationLogService.getPage(applicationLog, request);
return RestResponse.success(applicationList);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,15 +48,15 @@ public class ApplicationHistoryController {
@PostMapping("uploadJars")
@RequiresPermissions("app:create")
public RestResponse listUploadJars() {
List<String> jars = applicationInfoService.historyUploadJars();
List<String> jars = applicationInfoService.listHistoryUploadJars();
return RestResponse.success(jars);
}

@Operation(summary = "List the k8s namespace history records")
@PostMapping("k8sNamespaces")
@RequiresPermissions("app:create")
public RestResponse listK8sNamespace() {
List<String> namespaces = applicationInfoService.getRecentK8sNamespace();
List<String> namespaces = applicationInfoService.listRecentK8sNamespace();
return RestResponse.success(namespaces);
}

Expand All @@ -69,7 +69,7 @@ public RestResponse listSessionClusterId(int executionMode) {
case KUBERNETES_NATIVE_SESSION:
case YARN_SESSION:
case REMOTE:
clusterIds = applicationInfoService.getRecentK8sClusterId(executionMode);
clusterIds = applicationInfoService.listRecentK8sClusterId(executionMode);
break;
default:
clusterIds = new ArrayList<>(0);
Expand All @@ -82,31 +82,31 @@ public RestResponse listSessionClusterId(int executionMode) {
@PostMapping("flinkBaseImages")
@RequiresPermissions("app:create")
public RestResponse listFlinkBaseImage() {
List<String> images = applicationInfoService.getRecentFlinkBaseImage();
List<String> images = applicationInfoService.listRecentFlinkBaseImage();
return RestResponse.success(images);
}

@Operation(summary = "List the flink pod template history records")
@PostMapping("flinkPodTemplates")
@RequiresPermissions("app:create")
public RestResponse listPodTemplate() {
List<String> templates = applicationInfoService.getRecentK8sPodTemplate();
List<String> templates = applicationInfoService.listRecentK8sPodTemplate();
return RestResponse.success(templates);
}

@Operation(summary = "List the flink JM pod template history records")
@PostMapping("flinkJmPodTemplates")
@RequiresPermissions("app:create")
public RestResponse listJmPodTemplate() {
List<String> templates = applicationInfoService.getRecentK8sJmPodTemplate();
List<String> templates = applicationInfoService.listRecentK8sJmPodTemplate();
return RestResponse.success(templates);
}

@Operation(summary = "List the flink TM pod template history records")
@PostMapping("flinkTmPodTemplates")
@RequiresPermissions("app:create")
public RestResponse listTmPodTemplate() {
List<String> templates = applicationInfoService.getRecentK8sTmPodTemplate();
List<String> templates = applicationInfoService.listRecentK8sTmPodTemplate();
return RestResponse.success(templates);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ public RestResponse template() {
@Operation(summary = "List the application configs")
@PostMapping("list")
public RestResponse list(ApplicationConfig config, RestRequest request) {
IPage<ApplicationConfig> page = applicationConfigService.page(config, request);
IPage<ApplicationConfig> page = applicationConfigService.getPage(config, request);
return RestResponse.success(page);
}

@Operation(summary = "List application config histories")
@PostMapping("history")
public RestResponse history(Application application) {
List<ApplicationConfig> history = applicationConfigService.history(application);
List<ApplicationConfig> history = applicationConfigService.list(application);
return RestResponse.success(history);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public RestResponse verify(String sql, Long versionId, Long teamId) {
@Operation(summary = "List the application sql")
@PostMapping("list")
public RestResponse list(Long appId, RestRequest request) {
IPage<FlinkSql> page = flinkSqlService.page(appId, request);
IPage<FlinkSql> page = flinkSqlService.getPage(appId, request);
return RestResponse.success(page);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public class MessageController {
@PostMapping("notice")
public RestResponse notice(Integer type, RestRequest request) {
NoticeTypeEnum noticeTypeEnum = NoticeTypeEnum.of(type);
IPage<Message> pages = messageService.getUnRead(noticeTypeEnum, request);
IPage<Message> pages = messageService.getUnReadPage(noticeTypeEnum, request);
return RestResponse.success(pages);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ public RestResponse list(Project project, RestRequest restRequest) {
if (project.getTeamId() == null) {
return RestResponse.success(Collections.emptyList());
}
IPage<Project> page = projectService.page(project, restRequest);
IPage<Project> page = projectService.getPage(project, restRequest);
return RestResponse.success().data(page);
}

Expand Down Expand Up @@ -127,7 +127,7 @@ public RestResponse gitCheck(Project project) {
@Operation(summary = "Check the project")
@PostMapping("exists")
public RestResponse exists(Project project) {
boolean exists = projectService.checkExists(project);
boolean exists = projectService.exists(project);
return RestResponse.success().data(exists);
}

Expand Down Expand Up @@ -155,7 +155,7 @@ public RestResponse listConf(Project project) {
@Operation(summary = "List the team projects")
@PostMapping("select")
public RestResponse select(@RequestParam Long teamId) {
List<Project> list = projectService.findByTeamId(teamId);
List<Project> list = projectService.listByTeamId(teamId);
return RestResponse.success().data(list);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ public RestResponse checkResource(@Valid Resource resource) throws Exception {
@Operation(summary = "List resources")
@PostMapping("page")
public RestResponse page(RestRequest restRequest, Resource resource) {
IPage<Resource> page = resourceService.page(resource, restRequest);
IPage<Resource> page = resourceService.getPage(resource, restRequest);
return RestResponse.success(page);
}

Expand All @@ -91,7 +91,7 @@ public RestResponse deleteResource(@Valid Resource resource) {
@Operation(summary = "List resource")
@PostMapping("list")
public RestResponse listResource(@RequestParam Long teamId) {
List<Resource> resourceList = resourceService.findByTeamId(teamId);
List<Resource> resourceList = resourceService.listByTeamId(teamId);
return RestResponse.success(resourceList);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public RestResponse latest(Long appId) {
@Operation(summary = "List application savepoint histories")
@PostMapping("history")
public RestResponse history(SavePoint savePoint, RestRequest request) {
IPage<SavePoint> page = savePointService.page(savePoint, request);
IPage<SavePoint> page = savePointService.getPage(savePoint, request);
return RestResponse.success(page);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public class VariableController {
@PostMapping("page")
@RequiresPermissions("variable:view")
public RestResponse page(RestRequest restRequest, Variable variable) {
IPage<Variable> page = variableService.page(variable, restRequest);
IPage<Variable> page = variableService.getPage(variable, restRequest);
for (Variable v : page.getRecords()) {
v.dataMasking();
}
Expand All @@ -80,7 +80,7 @@ public RestResponse page(RestRequest restRequest, Variable variable) {
@Operation(summary = "List variables")
@PostMapping("list")
public RestResponse variableList(@RequestParam Long teamId, String keyword) {
List<Variable> variableList = variableService.findByTeamId(teamId, keyword);
List<Variable> variableList = variableService.listByTeamId(teamId, keyword);
for (Variable v : variableList) {
v.dataMasking();
}
Expand All @@ -91,7 +91,7 @@ public RestResponse variableList(@RequestParam Long teamId, String keyword) {
@PostMapping("dependApps")
@RequiresPermissions("variable:depend_apps")
public RestResponse dependApps(RestRequest restRequest, Variable variable) {
IPage<Application> dependApps = variableService.dependAppsPage(variable, restRequest);
IPage<Application> dependApps = variableService.getDependAppsPage(variable, restRequest);
return RestResponse.success(dependApps);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public class YarnQueueController {
@ApiAccess
@PostMapping("list")
public RestResponse list(RestRequest restRequest, YarnQueue yarnQueue) {
IPage<YarnQueue> queuePage = yarnQueueService.findYarnQueues(yarnQueue, restRequest);
IPage<YarnQueue> queuePage = yarnQueueService.getPage(yarnQueue, restRequest);
return RestResponse.success(queuePage);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public interface AppBuildPipeService extends IService<AppBuildPipeline> {
boolean allowToBuildNow(@Nonnull Long appId);

/** list pipeline status on application id list */
Map<Long, PipelineStatusEnum> listPipelineStatus(List<Long> appIds);
Map<Long, PipelineStatusEnum> listAppIdPipelineStatusMap(List<Long> appIds);

/**
* delete appBuildPipeline By application
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public interface ApplicationBackUpService extends IService<ApplicationBackUp> {
* @param request The {@link RestRequest} object used for pagination and sorting.
* @return An {@link IPage} containing the retrieved {@link ApplicationBackUp} objects.
*/
IPage<ApplicationBackUp> page(ApplicationBackUp bakParam, RestRequest request);
IPage<ApplicationBackUp> getPage(ApplicationBackUp bakParam, RestRequest request);

/**
* Rolls back the changes made by the specified application backup.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ public interface ApplicationConfigService extends IService<ApplicationConfig> {
* @return an IPage containing the ApplicationConfig objects that match the filter criteria
* specified in the config object, limited by the settings in the request object
*/
IPage<ApplicationConfig> page(ApplicationConfig config, RestRequest request);
IPage<ApplicationConfig> getPage(ApplicationConfig config, RestRequest request);

/**
* Retrieves the history of application configurations for a given application.
*
* @param appParam The application for which to retrieve the history.
* @return The list of application configurations representing the history.
*/
List<ApplicationConfig> history(Application appParam);
List<ApplicationConfig> list(Application appParam);

/**
* Reads a template from a file or a database.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

public interface ApplicationLogService extends IService<ApplicationLog> {

IPage<ApplicationLog> page(ApplicationLog applicationLog, RestRequest request);
IPage<ApplicationLog> getPage(ApplicationLog applicationLog, RestRequest request);

void removeApp(Long appId);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ public interface FlinkClusterService extends IService<FlinkCluster> {

Boolean existsByFlinkEnvId(Long id);

List<FlinkCluster> getByExecutionModes(Collection<FlinkExecutionMode> executionModeEnums);
List<FlinkCluster> listByExecutionModes(Collection<FlinkExecutionMode> executionModeEnums);

void updateClusterState(Long id, ClusterState state);
}
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public interface FlinkSqlService extends IService<FlinkSql> {

FlinkSqlValidationResult verifySql(String sql, Long versionId);

List<FlinkSql> getByTeamId(Long teamId);
List<FlinkSql> listByTeamId(Long teamId);

IPage<FlinkSql> page(Long appId, RestRequest request);
IPage<FlinkSql> getPage(Long appId, RestRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,5 @@ public interface MessageService extends IService<Message> {

void push(Message message);

IPage<Message> getUnRead(NoticeTypeEnum noticeTypeEnum, RestRequest request);
IPage<Message> getUnReadPage(NoticeTypeEnum noticeTypeEnum, RestRequest request);
}
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ public interface ProjectService extends IService<Project> {

boolean delete(Long id);

IPage<Project> page(Project project, RestRequest restRequest);
IPage<Project> getPage(Project project, RestRequest restRequest);

Boolean existsByTeamId(Long teamId);

List<Project> findByTeamId(Long teamId);
List<Project> listByTeamId(Long teamId);

void build(Long id) throws Exception;

Expand All @@ -54,7 +54,7 @@ public interface ProjectService extends IService<Project> {

String getAppConfPath(Long id, String module);

List<Application> getApplications(Project project);
List<Application> listApps(Project project);

boolean checkExists(Project project);
boolean exists(Project project);
}
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public interface ResourceService extends IService<Resource> {
* @param restRequest queryRequest
* @return IPage
*/
IPage<Resource> page(Resource resource, RestRequest restRequest);
IPage<Resource> getPage(Resource resource, RestRequest restRequest);

/**
* check resource exists by user id
Expand Down Expand Up @@ -81,7 +81,7 @@ public interface ResourceService extends IService<Resource> {
* @param teamId
* @return team resources
*/
List<Resource> findByTeamId(Long teamId);
List<Resource> listByTeamId(Long teamId);

/**
* change resource owner
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public interface SavePointService extends IService<SavePoint> {
* @param request The RestRequest object containing additional request parameters.
* @return An instance of IPage<SavePoint> representing the page of SavePoint objects.
*/
IPage<SavePoint> page(SavePoint savePoint, RestRequest request);
IPage<SavePoint> getPage(SavePoint savePoint, RestRequest request);

/**
* Removes all savepoints for the specified application.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,15 @@ public interface VariableService extends IService<Variable> {
* @param restRequest The query request containing search filters and pagination options.
* @return An IPage object containing the found Variable objects matching the search criteria.
*/
IPage<Variable> page(Variable variable, RestRequest restRequest);
IPage<Variable> getPage(Variable variable, RestRequest restRequest);

/**
* Retrieves a list of variables based on the team ID.
*
* @param teamId The ID of the team to filter the variables by.
* @return A list of variables that belong to the specified team.
*/
List<Variable> findByTeamId(Long teamId);
List<Variable> listByTeamId(Long teamId);

/**
* Retrieve a list of variables based on the team ID and search keywords.
Expand All @@ -53,7 +53,7 @@ public interface VariableService extends IService<Variable> {
* nullable.
* @return A List of Variable objects that match the specified team ID and search keywords.
*/
List<Variable> findByTeamId(Long teamId, String keyword);
List<Variable> listByTeamId(Long teamId, String keyword);

/**
* Check if a team exists by teamId.
Expand Down Expand Up @@ -102,7 +102,7 @@ public interface VariableService extends IService<Variable> {
* @param request The REST request containing additional parameters for retrieving the page.
* @return An instance of IPage<Application> containing the dependent applications.
*/
IPage<Application> dependAppsPage(Variable variable, RestRequest request);
IPage<Application> getDependAppsPage(Variable variable, RestRequest request);

/**
* Updates the given variable.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

public interface YarnQueueService extends IService<YarnQueue> {

IPage<YarnQueue> findYarnQueues(YarnQueue yarnQueue, RestRequest restRequest);
IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);

ResponseResult<String> checkYarnQueue(YarnQueue yarnQueue);

Expand Down
Loading

0 comments on commit 57b9b78

Please sign in to comment.