| | |
| | | @ManagerAuth |
| | | public R query(String condition) { |
| | | EntityWrapper<Node> wrapper = new EntityWrapper<>(); |
| | | wrapper.like("name", condition); |
| | | wrapper.like("name", condition).or().like("uuid", condition); |
| | | Page<Node> page = nodeService.selectPage(new Page<>(0, 10), wrapper); |
| | | List<Map<String, Object>> result = new ArrayList<>(); |
| | | for (Node node : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", node.getId()); |
| | | map.put("value", node.getName()); |
| | | map.put("value", node.getUuid() + "(" +node.getName()+ ")"); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |
| | |
| | | for (Tag tag : page.getRecords()){ |
| | | Map<String, Object> map = new HashMap<>(); |
| | | map.put("id", tag.getId()); |
| | | map.put("value", tag.getUuid() + "(" + tag.getName() + ")"); |
| | | map.put("value", tag.getName()); |
| | | result.add(map); |
| | | } |
| | | return R.ok(result); |