AdmRelationController.java 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. package com.persagy.proxy.adm.controller;
  2. import cn.hutool.core.collection.CollUtil;
  3. import com.fasterxml.jackson.databind.node.ArrayNode;
  4. import com.fasterxml.jackson.databind.node.JsonNodeFactory;
  5. import com.fasterxml.jackson.databind.node.ObjectNode;
  6. import com.persagy.dmp.basic.model.QueryCriteria;
  7. import com.persagy.dmp.common.helper.SpringHelper;
  8. import com.persagy.dmp.digital.entity.ObjectRelation;
  9. import com.persagy.proxy.adm.constant.AdmCommonConstant;
  10. import com.persagy.proxy.adm.model.AdmFloor;
  11. import com.persagy.proxy.adm.model.AdmGraphicType;
  12. import com.persagy.proxy.adm.model.AdmRelationType;
  13. import com.persagy.proxy.adm.model.AdmWindow;
  14. import com.persagy.proxy.adm.request.AdmCreateRequest;
  15. import com.persagy.proxy.adm.request.AdmQueryCriteria;
  16. import com.persagy.proxy.adm.request.AdmResponse;
  17. import com.persagy.proxy.adm.service.IAdmGraphicTypeService;
  18. import com.persagy.proxy.adm.service.IAdmRelationService;
  19. import com.persagy.proxy.adm.service.IAdmRelationTypeService;
  20. import com.persagy.proxy.adm.service.IAdmWindowService;
  21. import com.persagy.proxy.adm.utils.AdmContextUtil;
  22. import com.persagy.proxy.common.entity.InstanceUrlParam;
  23. import org.apache.commons.lang.StringUtils;
  24. import org.springframework.beans.factory.annotation.Autowired;
  25. import org.springframework.beans.factory.annotation.Value;
  26. import org.springframework.web.bind.annotation.PostMapping;
  27. import org.springframework.web.bind.annotation.RequestBody;
  28. import org.springframework.web.bind.annotation.RequestMapping;
  29. import org.springframework.web.bind.annotation.RestController;
  30. import javax.ws.rs.QueryParam;
  31. import java.util.ArrayList;
  32. import java.util.List;
  33. import java.util.stream.Collectors;
  34. /**
  35. * ADM 窗户 API
  36. * @author xujiaheng
  37. * @date 2021-09-3
  38. */
  39. @RestController
  40. @RequestMapping("/rel")
  41. public class AdmRelationController {
  42. @Autowired
  43. private IAdmGraphicTypeService service;
  44. @Value("${middleware.group.code}")
  45. private String groupCode;
  46. /**
  47. * 创建
  48. * @param
  49. * @return
  50. * @throws Exception
  51. */
  52. @PostMapping("/equip/category")
  53. public AdmResponse equipRel(@QueryParam("projectId") String projectId) {
  54. //组装上下文条件
  55. InstanceUrlParam context = AdmContextUtil.toDmpContext();
  56. AdmResponse res = service.query(context);
  57. return res;
  58. }
  59. }