Skip to content

Commit

Permalink
[Improve] update page to getPage
Browse files Browse the repository at this point in the history
  • Loading branch information
VampireAchao committed Oct 31, 2023
1 parent b85e297 commit c2efebf
Show file tree
Hide file tree
Showing 30 changed files with 35 additions and 35 deletions.
Original file line number Diff line number Diff line change
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 @@ -66,7 +66,7 @@ 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);
}

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
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 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 Down Expand Up @@ -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.pageDependApps(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.page(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 @@ -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,7 +100,7 @@ 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.
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 @@ -54,5 +54,5 @@ public interface FlinkSqlService extends IService<FlinkSql> {

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,7 +36,7 @@ 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);

Expand Down
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
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,7 +35,7 @@ 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.
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> pageDependApps(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> page(YarnQueue yarnQueue, RestRequest restRequest);
IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest restRequest);

ResponseResult<String> checkYarnQueue(YarnQueue yarnQueue);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ public class ApplicationBackUpServiceImpl
@Autowired private FlinkSqlService flinkSqlService;

@Override
public IPage<ApplicationBackUp> page(ApplicationBackUp bakParam, RestRequest request) {
public IPage<ApplicationBackUp> getPage(ApplicationBackUp bakParam, RestRequest request) {
Page<ApplicationBackUp> page = new MybatisPager<ApplicationBackUp>().getDefaultPage(request);
LambdaQueryWrapper<ApplicationBackUp> queryWrapper =
new LambdaQueryWrapper<ApplicationBackUp>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ public ApplicationConfig get(Long id) {
}

@Override
public IPage<ApplicationConfig> page(ApplicationConfig config, RestRequest request) {
public IPage<ApplicationConfig> getPage(ApplicationConfig config, RestRequest request) {
Page<ApplicationConfig> page =
new MybatisPager<ApplicationConfig>().getPage(request, "version", Constant.ORDER_DESC);
IPage<ApplicationConfig> configList =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public class ApplicationLogServiceImpl extends ServiceImpl<ApplicationLogMapper,
implements ApplicationLogService {

@Override
public IPage<ApplicationLog> page(ApplicationLog applicationLog, RestRequest request) {
public IPage<ApplicationLog> getPage(ApplicationLog applicationLog, RestRequest request) {
Page<ApplicationLog> page =
new MybatisPager<ApplicationLog>().getPage(request, "option_time", Constant.ORDER_DESC);
LambdaQueryWrapper<ApplicationLog> queryWrapper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ public List<FlinkSql> listByTeamId(Long teamId) {
}

@Override
public IPage<FlinkSql> page(Long appId, RestRequest request) {
public IPage<FlinkSql> getPage(Long appId, RestRequest request) {
Page<FlinkSql> page =
new MybatisPager<FlinkSql>().getPage(request, "version", Constant.ORDER_DESC);
LambdaQueryWrapper<FlinkSql> queryWrapper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ public void push(Message message) {
}

@Override
public IPage<Message> getUnRead(NoticeTypeEnum noticeTypeEnum, RestRequest request) {
public IPage<Message> getUnReadPage(NoticeTypeEnum noticeTypeEnum, RestRequest request) {
Page<Message> page = new MybatisPager<Message>().getDefaultPage(request);
LambdaQueryWrapper<Message> queryWrapper =
new LambdaQueryWrapper<Message>()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ public boolean delete(Long id) {
}

@Override
public IPage<Project> page(Project project, RestRequest request) {
public IPage<Project> getPage(Project project, RestRequest request) {
Page<Project> page = new MybatisPager<Project>().getDefaultPage(request);
return this.baseMapper.selectPage(page, project);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public class ResourceServiceImpl extends ServiceImpl<ResourceMapper, Resource>
@Autowired private FlinkSqlService flinkSqlService;

@Override
public IPage<Resource> page(Resource resource, RestRequest restRequest) {
public IPage<Resource> getPage(Resource resource, RestRequest restRequest) {
if (resource.getTeamId() == null) {
return null;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public Boolean delete(Long id, Application appParam) throws InternalException {
}

@Override
public IPage<SavePoint> page(SavePoint savePoint, RestRequest request) {
public IPage<SavePoint> getPage(SavePoint savePoint, RestRequest request) {
Page<SavePoint> page =
new MybatisPager<SavePoint>().getPage(request, "trigger_time", Constant.ORDER_DESC);
LambdaQueryWrapper<SavePoint> queryWrapper =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ public void deleteVariable(Variable variable) {
}

@Override
public IPage<Variable> page(Variable variable, RestRequest request) {
public IPage<Variable> getPage(Variable variable, RestRequest request) {
if (variable.getTeamId() == null) {
return null;
}
Expand All @@ -99,7 +99,7 @@ public IPage<Variable> page(Variable variable, RestRequest request) {
}

@Override
public IPage<Application> pageDependApps(Variable variable, RestRequest request) {
public IPage<Application> getDependAppsPage(Variable variable, RestRequest request) {
List<Application> applications = getDependApplicationsByCode(variable);

IPage<Application> page = new Page<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public class YarnQueueServiceImpl extends ServiceImpl<YarnQueueMapper, YarnQueue
@Autowired private FlinkClusterService flinkClusterService;

@Override
public IPage<YarnQueue> page(YarnQueue yarnQueue, RestRequest request) {
public IPage<YarnQueue> getPage(YarnQueue yarnQueue, RestRequest request) {
Utils.notNull(yarnQueue, "Yarn queue query params mustn't be null.");
Utils.notNull(yarnQueue.getTeamId(), "Team id of yarn queue query params mustn't be null.");
Page<YarnQueue> page = new Page<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ void testFindYarnQueues() {
RestRequest request = new RestRequest();
request.setPageSize(2);
request.setPageNum(1);
IPage<YarnQueue> yarnQueues = yarnQueueService.page(queryParams, request);
IPage<YarnQueue> yarnQueues = yarnQueueService.getPage(queryParams, request);
assertThat(
yarnQueues.getRecords().stream()
.map(YarnQueue::getQueueLabel)
Expand All @@ -97,7 +97,7 @@ void testFindYarnQueues() {
// Test for 1st page, size = 2, order by create time with queue_label
queryParams.setQueueLabel("q3");
IPage<YarnQueue> yarnQueuesWithQueueLabelLikeQuery =
yarnQueueService.page(queryParams, request);
yarnQueueService.getPage(queryParams, request);
assertThat(
yarnQueuesWithQueueLabelLikeQuery.getRecords().stream()
.map(YarnQueue::getQueueLabel)
Expand Down

0 comments on commit c2efebf

Please sign in to comment.