|
@@ -2,25 +2,16 @@ package com.dragoninfo.dcuc.authweb.restcontroller.app;
|
|
|
|
|
|
import com.dragoninfo.dcuc.app.dto.ResourceRequestParamDTO;
|
|
|
import com.dragoninfo.dcuc.app.dto.ResourceRequestResultDTO;
|
|
|
-import com.dragoninfo.dcuc.app.dto.ServiceResourceDTO;
|
|
|
import com.dragoninfo.dcuc.app.facade.IResourceFacade;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ResourceRequestParam;
|
|
|
import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ResourceRequestResult;
|
|
|
-import com.dragoninfo.dcuc.authweb.restcontroller.app.vo.ServiceResourceVo;
|
|
|
import com.dragoninfo.duceap.core.response.Result;
|
|
|
-import com.dragonsoft.duceap.core.entity.page.PageImpl;
|
|
|
-import com.dragonsoft.duceap.core.entity.page.PageRequest;
|
|
|
-import com.dragonsoft.duceap.core.search.Searchable;
|
|
|
import io.swagger.annotations.ApiImplicitParam;
|
|
|
import io.swagger.annotations.ApiOperation;
|
|
|
import org.springframework.beans.BeanUtils;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
-import org.springframework.data.domain.Page;
|
|
|
-import org.springframework.data.domain.Pageable;
|
|
|
-import org.springframework.http.MediaType;
|
|
|
import org.springframework.web.bind.annotation.*;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@@ -66,23 +57,4 @@ public class ResourceListingController {
|
|
|
return Result.success();
|
|
|
}
|
|
|
|
|
|
- /**
|
|
|
- * 服务资源列表分页查询
|
|
|
- */
|
|
|
- @ApiOperation(value = "查询应用列表")
|
|
|
- @ApiImplicitParam(name = "searchable", value = "查询条件")
|
|
|
- @PostMapping(value = "serviceResource/search", produces = MediaType.APPLICATION_JSON_VALUE)
|
|
|
- public Result<Page<ServiceResourceVo>> serviceResourcePage(Searchable searchable) {
|
|
|
- Page<ServiceResourceDTO> page = iResourceFacade.serviceResourcePage(searchable.toSearchDTO());
|
|
|
- List<ServiceResourceVo> vos = new ArrayList<>();
|
|
|
- List<ServiceResourceDTO> content = page.getContent();
|
|
|
- for (ServiceResourceDTO dto : content) {
|
|
|
- ServiceResourceVo vo = new ServiceResourceVo();
|
|
|
- BeanUtils.copyProperties(dto, vo);
|
|
|
- vos.add(vo);
|
|
|
- }
|
|
|
- Pageable newPageable = new PageRequest(page.getNumber(), page.getSize());
|
|
|
- PageImpl<ServiceResourceVo> pageResult = new PageImpl<>(vos, newPageable, page.getTotalElements());
|
|
|
- return Result.success(pageResult);
|
|
|
- }
|
|
|
}
|