ServiceAuthController.java 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. package com.dragoninfo.dcuc.authweb.restcontroller.auth;
  2. import com.dragoninfo.dcuc.app.facade.IResourceFacade;
  3. import com.dragoninfo.dcuc.auth.auth.dto.ServiceAuthFlowDTO;
  4. import com.dragoninfo.dcuc.auth.auth.facade.IServiceAuthFacade;
  5. import com.dragoninfo.dcuc.auth.power.facade.IAppFunInfoFacade;
  6. import com.dragoninfo.dcuc.authweb.restcontroller.auth.vo.ServiceAuthVo;
  7. import com.dragoninfo.duceap.core.response.Result;
  8. import com.dragonsoft.duceap.base.entity.search.SearchDTO;
  9. import com.dragonsoft.duceap.commons.util.string.StringUtils;
  10. import io.swagger.annotations.Api;
  11. import io.swagger.annotations.ApiImplicitParam;
  12. import io.swagger.annotations.ApiOperation;
  13. import org.springframework.beans.factory.annotation.Autowired;
  14. import org.springframework.data.domain.Page;
  15. import org.springframework.web.bind.annotation.PostMapping;
  16. import org.springframework.web.bind.annotation.RequestMapping;
  17. import org.springframework.web.bind.annotation.RestController;
  18. import java.util.ArrayList;
  19. import java.util.List;
  20. /**
  21. * @Author yica
  22. * @Date 2021/2/20 17:17
  23. **/
  24. @Api(tags = {"服务授权管理接口"})
  25. @RestController
  26. @RequestMapping(value = "/authsvr/v2/service/")
  27. public class ServiceAuthController {
  28. @Autowired
  29. private IServiceAuthFacade serviceAuthFacade;
  30. @ApiOperation(value = "服务授权列表")
  31. @ApiImplicitParam(name = "searchDTO", value = "查询条件")
  32. @PostMapping(value = "search")
  33. public Result page(SearchDTO searchDTO){
  34. Page<ServiceAuthFlowDTO> serviceAuthFlowDTOS = serviceAuthFacade.serviceAuthFlowPage(searchDTO);
  35. List<ServiceAuthVo> vos=new ArrayList<>();
  36. serviceAuthFlowDTOS.getContent().forEach(item->{
  37. ServiceAuthVo vo=new ServiceAuthVo();
  38. vo.setApplicantName(item.getApplicantName());
  39. vo.setAppName(item.getAppName());
  40. vo.setApprovalOrgName(item.getApplicantOrgName());
  41. vo.setOrderNo(item.getDesc());
  42. vo.setServiceCodes(item.getServiceCodes());
  43. vo.setApplyTime(item.getApplyTime());
  44. vos.add(vo);
  45. });
  46. return Result.success(serviceAuthFlowDTOS.getTotalElements(),vos);
  47. }
  48. }